mirror of
https://github.com/strapi/strapi.git
synced 2025-09-05 06:43:07 +00:00
fix: add only credentials object when credentials are present
This commit is contained in:
parent
af5a6e37b2
commit
e52ced96a5
@ -80,7 +80,7 @@ const getConfig = ({ baseUrl, rootPath, s3Options, ...legacyS3Options }: InitOpt
|
|||||||
const config = {
|
const config = {
|
||||||
...s3Options,
|
...s3Options,
|
||||||
...legacyS3Options,
|
...legacyS3Options,
|
||||||
...[credentials ? { credentials } : {}],
|
...(credentials ? { credentials } : {}),
|
||||||
};
|
};
|
||||||
|
|
||||||
config.params.ACL = getOr(ObjectCannedACL.public_read, ['params', 'ACL'], config);
|
config.params.ACL = getOr(ObjectCannedACL.public_read, ['params', 'ACL'], config);
|
||||||
|
@ -89,7 +89,7 @@ function getBucketFromAwsUrl(fileUrl: string): BucketInfo {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// TODO Remove this in V5 since we will only support the new config structure
|
// TODO Remove this in V5 since we will only support the new config structure
|
||||||
export const extractCredentials = (options: InitOptions): AwsCredentialIdentity => {
|
export const extractCredentials = (options: InitOptions): AwsCredentialIdentity | null => {
|
||||||
// legacy
|
// legacy
|
||||||
if (options.accessKeyId && options.secretAccessKey) {
|
if (options.accessKeyId && options.secretAccessKey) {
|
||||||
return {
|
return {
|
||||||
@ -114,5 +114,5 @@ export const extractCredentials = (options: InitOptions): AwsCredentialIdentity
|
|||||||
secretAccessKey: options.s3Options.credentials.secretAccessKey,
|
secretAccessKey: options.s3Options.credentials.secretAccessKey,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
return {};
|
return null;
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user