dcicutils 7.11.0.1b9__py3-none-any.whl → 7.12.0.1b4__py3-none-any.whl
Sign up to get free protection for your applications and to get access to all the features.
- dcicutils/glacier_utils.py +16 -4
- dcicutils/license_utils.py +677 -165
- dcicutils/misc_utils.py +9 -97
- dcicutils/scripts/run_license_checker.py +77 -0
- {dcicutils-7.11.0.1b9.dist-info → dcicutils-7.12.0.1b4.dist-info}/METADATA +1 -3
- {dcicutils-7.11.0.1b9.dist-info → dcicutils-7.12.0.1b4.dist-info}/RECORD +9 -9
- {dcicutils-7.11.0.1b9.dist-info → dcicutils-7.12.0.1b4.dist-info}/entry_points.txt +1 -0
- dcicutils/sheet_utils.py +0 -1131
- {dcicutils-7.11.0.1b9.dist-info → dcicutils-7.12.0.1b4.dist-info}/LICENSE.txt +0 -0
- {dcicutils-7.11.0.1b9.dist-info → dcicutils-7.12.0.1b4.dist-info}/WHEEL +0 -0
dcicutils/glacier_utils.py
CHANGED
@@ -58,6 +58,10 @@ class GlacierUtils:
|
|
58
58
|
self.env_key = self.key_manager.get_keydict_for_env(env_name)
|
59
59
|
self.health_page = get_health_page(key=self.env_key, ff_env=env_name)
|
60
60
|
|
61
|
+
@property
|
62
|
+
def kms_key_id(self) -> str:
|
63
|
+
return self.health_page.get("s3_encrypt_key_id", "")
|
64
|
+
|
61
65
|
@classmethod
|
62
66
|
def is_glacier_storage_class(cls, storage_class: S3StorageClass):
|
63
67
|
return storage_class in S3_GLACIER_CLASSES
|
@@ -295,6 +299,9 @@ class GlacierUtils:
|
|
295
299
|
}
|
296
300
|
if tags:
|
297
301
|
cmu['Tagging'] = tags
|
302
|
+
if self.kms_key_id:
|
303
|
+
cmu['ServerSideEncryption'] = 'aws:kms'
|
304
|
+
cmu['SSEKMSKeyId'] = self.kms_key_id
|
298
305
|
mpu = self.s3.create_multipart_upload(**cmu)
|
299
306
|
mpu_upload_id = mpu['UploadId']
|
300
307
|
except Exception as e:
|
@@ -381,16 +388,21 @@ class GlacierUtils:
|
|
381
388
|
else:
|
382
389
|
# Force copy the object into standard in a single operation
|
383
390
|
copy_source = {'Bucket': bucket, 'Key': key}
|
384
|
-
|
391
|
+
copy_args = {
|
385
392
|
'Bucket': bucket, 'Key': key,
|
386
393
|
'StorageClass': storage_class,
|
387
394
|
}
|
388
395
|
if version_id:
|
389
396
|
copy_source['VersionId'] = version_id
|
390
|
-
|
397
|
+
copy_args['CopySourceVersionId'] = version_id
|
391
398
|
if tags:
|
392
|
-
|
393
|
-
|
399
|
+
copy_args['Tagging'] = tags
|
400
|
+
if self.kms_key_id:
|
401
|
+
copy_args['ServerSideEncryption'] = 'aws:kms'
|
402
|
+
copy_args['SSEKMSKeyId'] = self.kms_key_id
|
403
|
+
response = self.s3.copy_object(
|
404
|
+
**copy_args, CopySource=copy_source
|
405
|
+
)
|
394
406
|
PRINT(f'Response from boto3 copy:\n{response}')
|
395
407
|
PRINT(f'Object {bucket}/{key} copied back to its original location in S3')
|
396
408
|
return response
|