mirror of
https://github.com/directus/directus.git
synced 2026-04-25 03:00:53 -04:00
Add support for s3 ServerSideEncryption (#15952)
This commit is contained in:
@@ -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',
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user