Skip to content
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

Storage Browser Default Auth #13866

Merged

Conversation

ashika112
Copy link
Member

@ashika112 ashika112 commented Sep 30, 2024

Description of changes

  • Creates Amplify Auth adapter [This is expected to be moved to UI. Including this atm to make testing easier.]
  • Creates ListPaths which is equivalent to ListLocations
  • Updates type for ListPaths

TODO

  • Pagination + Memoization
  • Aligning behavior on user group edge case

Description of how you validated changes

  • Unit test
  • Manual testing using sample app

Checklist

  • PR description included
  • yarn test passes
  • Unit Tests are changed or added
  • Relevant documentation is changed or added (and PR referenced)

Checklist for repo maintainers

  • Verify E2E tests for existing workflows are working as expected or add E2E tests for newly added workflows
  • New source file paths included in this PR have been added to CODEOWNERS, if appropriate

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@ashika112 ashika112 marked this pull request as ready for review October 4, 2024 19:19
@ashika112 ashika112 requested a review from a team as a code owner October 4, 2024 19:31
Copy link
Member Author

@ashika112 ashika112 Oct 4, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adapter will most likely be moved to UI

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adapter will most likely be moved to UI

/**
* @internal
*/
export interface PathAccess {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Keeping this separate for now. In a separate PR will align this and managed Auth Location access into one.

Copy link
Member

@AllanZhengYP AllanZhengYP left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me! Only have 1 nit comment.

@@ -50,6 +50,8 @@ export interface AmplifyOutputsStorageBucketProperties {
bucket_name: string;
/** Region for the bucket */
aws_region: string;
/** Paths to object with access permissions */
paths?: Record<string, Record<string, string[] | undefined>>;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The in-line type is a bit hard the follow, what about using a interface with property names:

type Permission = string;

interface StorageBucketPaths {
  [pathPrefix: string]: {
    [accessType: string]: Permission[] | undefined;
  }
}

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Our ESLint does not allow for index signature. But i think we can create alias and align if we want. I can look into this in my follow up PR for pagination if there are no other comments :)

@ashika112 ashika112 merged commit e515d24 into aws-amplify:storage-browser/integrity Oct 18, 2024
28 checks passed
@ashika112 ashika112 deleted the feat/sb-default-auth branch October 18, 2024 18:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants