You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Creating an instance of S3Adapter (from @keystone/file-adapters) without providing accessKeyId, secretAccessKey and region throws an error and terminates Keystone's Node.js instance. The error is thrown with the following message:
constfileAdapter=newS3Adapter({// accessKeyId // not provided// secretAccessKey: // not provided// region: // not providedbucket: 'website-submission-attachments',folder: 'test',s3Options: {apiVersion: '2006-03-01',},uploadParams: ({ filename, id, mimetype, encoding }: UploadParams)=>{return{Metadata: {keystone_id: String(id),},};},});
Expected behaviour
The S3Adapter connects to the S3 bucket regardless of the presence of the 3 missing parameters and that no attempt is made by the S3Adapter to pass the the three missing parameters on to the AWS.S3 constructor params.
Screenshots
N/A
System information
macOS
Additional context
@keystone/file-adapter's S3Adapter requires - among others - the following parameters in its constructor which are then passed to the AWS SDK constructor: AWS.S3:
accessKeyId,
secretAccessKey,
region,
There are many common use cases where creating an S3 instance without these parameters are valid - and in fact - accessKeyId and secretAccessKey are deprecated in the AWS SDK.
Proposed solution
Remove the hard requirement for these parameters to be provided and instead simply allow the user to provide them as required in the s3Options object.
The text was updated successfully, but these errors were encountered:
Bug report
Describe the bug
Creating an instance of
S3Adapter
(from@keystone/file-adapters
) without providing accessKeyId, secretAccessKey and region throws an error and terminates Keystone's Node.js instance. The error is thrown with the following message:To Reproduce
Create an instance of the
S3Adapter
as follows:Expected behaviour
The
S3Adapter
connects to the S3 bucket regardless of the presence of the 3 missing parameters and that no attempt is made by theS3Adapter
to pass the the three missing parameters on to theAWS.S3
constructor params.Screenshots
N/A
System information
macOS
Additional context
@keystone/file-adapter
'sS3Adapter
requires - among others - the following parameters in its constructor which are then passed to the AWS SDK constructor:AWS.S3
:There are many common use cases where creating an S3 instance without these parameters are valid - and in fact -
accessKeyId
andsecretAccessKey
are deprecated in the AWS SDK.Proposed solution
Remove the hard requirement for these parameters to be provided and instead simply allow the user to provide them as required in the
s3Options
object.The text was updated successfully, but these errors were encountered: