Add support for s3 ServerSideEncryption (#15952)

This commit is contained in:
Rémi Peron
2022-10-12 19:05:04 +02:00
committed by GitHub
parent fb58fd9bf2
commit 33d5f86937
2 changed files with 6 additions and 0 deletions

View File

@@ -88,6 +88,7 @@ const allowedEnvironmentVars = [
'STORAGE_.+_ENDPOINT',
'STORAGE_.+_ACL',
'STORAGE_.+_CONTAINER_NAME',
'STORAGE_.+_SERVER_SIDE_ENCRYPTION',
'STORAGE_.+_ACCOUNT_NAME',
'STORAGE_.+_ACCOUNT_KEY',
'STORAGE_.+_ENDPOINT',

View File

@@ -36,6 +36,7 @@ export class AmazonWebServicesS3Storage extends Storage {
protected $bucket: string;
protected $root: string;
protected $acl?: string;
protected $serverSideEncryption?: string;
constructor(config: AmazonWebServicesS3StorageConfig) {
super();
@@ -50,6 +51,7 @@ export class AmazonWebServicesS3Storage extends Storage {
this.$bucket = config.bucket;
this.$root = config.root ? normalize(config.root).replace(/^\//, '') : '';
this.$acl = config.acl;
this.$serverSideEncryption = config.serverSideEncryption;
}
/**
@@ -71,6 +73,7 @@ export class AmazonWebServicesS3Storage extends Storage {
Bucket: this.$bucket,
CopySource: `/${this.$bucket}/${src}`,
ACL: this.$acl,
ServerSideEncryption: this.$serverSideEncryption,
};
try {
@@ -260,6 +263,7 @@ export class AmazonWebServicesS3Storage extends Storage {
Bucket: this.$bucket,
ACL: this.$acl,
ContentType: type ? type : '',
ServerSideEncryption: this.$serverSideEncryption,
};
try {
@@ -312,4 +316,5 @@ export interface AmazonWebServicesS3StorageConfig extends ClientConfiguration {
bucket: string;
root?: string;
acl?: string;
serverSideEncryption?: string;
}