Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def __init__(self, *args, **kwargs):
super(S3ContentsManager, self).__init__(*args, **kwargs)
self.run_init_s3_hook()
self.bucket = _validate_bucket(self.bucket, self.log)
self._fs = S3FS(
log=self.log,
access_key_id=self.access_key_id,
secret_access_key=self.secret_access_key,
endpoint_url=self.endpoint_url,
region_name=self.region_name,
bucket=self.bucket,
prefix=self.prefix,
session_token=self.session_token,
signature_version=self.signature_version,
delimiter=self.delimiter,
sse=self.sse,
kms_key_id=self.kms_key_id,
boto3_session=self.boto3_session,
)
def __init__(self, log, **kwargs):
super(S3FS, self).__init__(**kwargs)
self.log = log
client_kwargs = {
"endpoint_url": self.endpoint_url,
"region_name": self.region_name,
}
config_kwargs = {}
if self.signature_version:
config_kwargs["signature_version"] = self.signature_version
s3_additional_kwargs = {}
if self.sse:
s3_additional_kwargs["ServerSideEncryption"] = self.sse
if self.kms_key_id:
s3_additional_kwargs["SSEKMSKeyId"] = self.kms_key_id
self.fs = s3fs.S3FileSystem(