Conversation
- Add Auth0IssuerParam and Auth0AudienceParam SAM parameters - Define explicit GmailTranslatorHttpApi with Auth0JwtAuthorizer using native API Gateway JWT verification (no Lambda authorizer needed) - Apply authorizer to all three OAuth routes via ApiId reference - Update Outputs to reference the explicit HttpApi resource - Add Auth0 placeholder values to samconfig.toml with usage comments Closes LEY-14
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds Auth0 JWT verification to the HTTP API at the API Gateway layer, so all three OAuth routes require a valid JWT before any Lambda is invoked.
Changes
Auth0IssuerParamandAuth0AudienceParamSAM parametersGmailTranslatorHttpApi(AWS::Serverless::HttpApi) withAuth0JwtAuthorizerusing native API Gateway JWT verification — no Lambda authorizer neededApiIdreference on each function event (/auth/google/start,/auth/google/callback,/auth/google/disconnect)Outputsto reference the explicitGmailTranslatorHttpApiinstead of the previous implicitServerlessHttpApiAuth0IssuerParamandAuth0AudienceParamplaceholder values tosamconfig.tomlwith inline comments explaining where to find the real values in the Auth0 dashboardHow it works
API Gateway natively verifies the JWT signature (using Auth0's JWKS endpoint), expiry, issuer, and audience before the Lambda is ever invoked. A request without a valid
Authorization: Bearer <token>header receives a401immediately.Testing
sam validate --lintpasses cleanNotes
Auth0IssuerParamandAuth0AudienceParamto be set at deploy time (seesamconfig.tomlcomments)