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

Reference Auth #2118

Merged
merged 71 commits into from
Nov 11, 2024
Merged

Reference Auth #2118

merged 71 commits into from
Nov 11, 2024

Conversation

awsluja
Copy link
Contributor

@awsluja awsluja commented Oct 16, 2024

Problem

Replaces PR (#2076)

Summary:
#1548

This adds support for referencing existing auth resources, while supporting the same behaviors that defineAuth allows.
You can use existing UserPool, IdentityPool, roles, and groups.
Data/Storage/Function resources do not require any changes or customization to work with reference auth.

Example fully featured backend, with groups, data, storage, and function handler.
image

Issue number, if available:

Changes

Corresponding docs PR, if applicable:

Validation

Checklist

  • If this PR includes a functional change to the runtime behavior of the code, I have added or updated automated test coverage for this change.
  • If this PR requires a change to the Project Architecture README, I have included that update in this PR.
  • If this PR requires a docs update, I have linked to that docs PR above.
  • If this PR modifies E2E tests, makes changes to resource provisioning, or makes SDK calls, I have run the PR checks with the run-e2e label set.

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

@awsluja awsluja reopened this Nov 1, 2024
Comment on lines 2 to 3
// ReferenceAuthConstruct is intentionally not public, but props are required
export { ReferenceAuthProps } from './reference_construct.js';
Copy link
Member

@sobolk sobolk Nov 6, 2024

Choose a reason for hiding this comment

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

Instead of this comment.
I'd move the type to reference_factory.ts.
To underscore that its primary purpose is to type the input to referenceAuth.
It can then be then used in construct as well.
If this happen to created import cycle then right place might be types.ts

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated, moved to reference_factory to make it more clear

Comment on lines 1 to 2
// This executes within the custom resource lambda and errors get handled by the provider framework
/* eslint-disable amplify-backend-rules/prefer-amplify-errors */
Copy link
Member

Choose a reason for hiding this comment

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

For Lambda runtime sources we'd rather create local .eslintrc.json in lambda directory and put suppression there.

See example here https://github.com/aws-amplify/amplify-backend/blob/main/packages/backend/src/engine/branch-linker/lambda/.eslintrc.json .

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated

awsluja and others added 3 commits November 6, 2024 16:21
* chore: add working setup for e2e resources in ref auth

* feed pr base sha and ref into envs before scripts (#2168)

* feed pr base sha and ref into envs before scripts

* removing empty file

* chore: update names to use test prefix

* chore: remove extra hyphen

* chore: fix cleanup and add sandbox test

* chore: make sure to throw if error describing stack is unknown

---------

Co-authored-by: Roshane Pascual <[email protected]>
Copy link
Member

@sobolk sobolk left a comment

Choose a reason for hiding this comment

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

LGTM, please address codeql.

@awsluja awsluja requested a review from a team as a code owner November 8, 2024 18:43
@awsluja awsluja closed this Nov 8, 2024
@awsluja awsluja reopened this Nov 8, 2024
@awsluja awsluja closed this Nov 8, 2024
@awsluja awsluja reopened this Nov 8, 2024
sobolk
sobolk previously approved these changes Nov 8, 2024
@awsluja awsluja merged commit 90a7c49 into main Nov 11, 2024
73 of 76 checks passed
@awsluja awsluja deleted the reference-auth branch November 11, 2024 21:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
run-e2e Label that will include e2e tests in PR checks workflow
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants