s3vaultlib.s3 package

Submodules

s3vaultlib.s3.s3fs module

class s3vaultlib.s3.s3fs.S3Fs(connection_factory, bucket, path='')[source]

Bases: object

Object that abstracts operation with encrypted objects on S3

fs = None
Type:pyboto3.s3
get_object(name)[source]

Return a s3fsobject identified by name

Parameters:name – object name
Returns:s3fsobject
Return type:S3FsObject
static is_file(s3elem)[source]

Return true is an s3 json element represents a valid file

objects

Return a list of s3fsobjects

put_object(name, content, encryption_key_arn, force_dot_file=False)[source]

Put an object in the S3 path by encrypting it with SSE

Parameters:
  • name – object name
  • content – content of the object
  • encryption_key_arn – key arn to use for encryption
  • force_dot_file – if enabled it disable the check with dot in the file
Returns:

the created s3object

Return type:

S3FsObject

update_s3fsobject(s3fsobject)[source]

Update an S3FSObject

Parameters:s3fsobject – S3FsObject to update
Type:S3FsObject
Returns:the updated object
Return type:S3FsObject
exception s3vaultlib.s3.s3fs.S3FsException[source]

Bases: Exception

exception s3vaultlib.s3.s3fs.S3FsObjectNotFoundException[source]

Bases: s3vaultlib.s3.s3fs.S3FsException

s3vaultlib.s3.s3fsobject module

class s3vaultlib.s3.s3fsobject.S3FsObject(data, bucket, path, fs)[source]

Bases: object

Implement the S3FsObject, an abstraction around a S3 file with SSE encryption

is_encrypted

Return true if the object is encrypted

Returns:True or False
Return type:bool
static is_json(data)[source]

Return True if the content is a valid json

Parameters:data – content to evaluate
Returns:True or False
Return type:bool
kms_arn

Return the KMS ARN used to encrypt the object

Returns:KMS ARN
Return type:basestring
metadata

Return the metadata associated with the object (file metadata)

Returns:medatata
Return type:dict
raw()[source]
exception s3vaultlib.s3.s3fsobject.S3FsObjectException[source]

Bases: Exception

Module contents