-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(storage): integrate locationCredentialsProvider #13590
base: storage-browser/main
Are you sure you want to change the base?
feat(storage): integrate locationCredentialsProvider #13590
Conversation
a4eec0d
to
1757c15
Compare
export interface S3InternalConfig { | ||
serviceOptions: S3ServiceOptions; | ||
libraryOptions: S3LibraryOptions; | ||
export interface S3InternalConfig extends S3ServiceOptions, S3LibraryOptions { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why flatten this out further? It seems a little more organized to keep serviceOptions
& libraryOptions
in their own fields.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This feedback came from @AllanZhengYP, the argument was that serviceOptions
and libraryOptions
are related to the configuration from the singleton and would be best just to pass the specific storage configuration. Open to discussion
@@ -44,16 +68,194 @@ const createDefaultIdentityIdProvider = (amplify: AmplifyClassV6) => { | |||
*/ | |||
export const createStorageConfiguration = ( | |||
amplify: AmplifyClassV6, | |||
apiInput: unknown, | |||
permission: Permission, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if permission
should just be optional so we don't need to pass in "dummy" values for our normal APIs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
every Storage API needs to pass a permission to resolve the locationCredentialsProvider
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1. I dont think we should pass in a value on all API that is not provided by the customer and we can not assume permission for them. we can keep it optional and throw an error from resolve for locationCreds if there is no permission in there. I think that will be better
Description of changes
Integrates the
locationCredentialsProvider
into the Storage APIsThe following changes will throw an exception,
locationCredentialsProvider
is defined, andpath
is not a string;bucket
is an emptystring
or is not defined;bucket
andregion
are not defined from the Amplify singleton or API inputIssue #, if available
Description of how you validated changes
Checklist
yarn test
passesChecklist for repo maintainers
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.