-
Notifications
You must be signed in to change notification settings - Fork 44
Fix SSM env params fallback for optional env variables #4858
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
Conversation
Signed-off-by: Lukasz Gryglicki <[email protected]> Assisted by [OpenAI](https://platform.openai.com/) Assisted by [GitHub Copilot](https://github.com/features/copilot)
|
Note Other AI code review bot(s) detectedCodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review. WalkthroughThree Auth0 claim environment variables in two serverless configurations now accept runtime environment overrides with empty-string defaults. A new Bash script adds production Auth0 claim values into AWS SSM (two regions) and then invokes an existing retrieval script. Changes
Sequence Diagram(s)sequenceDiagram
participant Dev as Operator (run script)
participant SSM1 as AWS SSM (us-east-1)
participant SSM2 as AWS SSM (us-east-2)
participant Get as ./utils/get_prod_claims.sh
rect rgb(223,240,216)
Dev->>SSM1: put-parameter username/email/name (lfproduct-prod)
Dev->>SSM2: put-parameter username/email/name (lfproduct-prod)
end
Dev->>Get: invoke get_prod_claims.sh
sequenceDiagram
participant Runtime as Lambda / Service
participant Env as OS Env
participant Provider as serverless.yml provider env
rect rgb(232,242,254)
note right of Provider: provider env entries now include env:<VAR>, ''\n(fallback to empty string)
end
Runtime->>Provider: resolve env var
alt env var set
Provider->>Runtime: use OS Env value
else not set
Provider->>Runtime: use '' (empty string)
end
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes
Possibly related PRs
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro Disabled knowledge base sources:
📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
Comment |
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.
Pull Request Overview
This PR adds fallback configuration for Auth0 CLI claims and creates a utility script for setting production Auth0 claim parameters in AWS SSM.
- Adds environment variable and empty string fallbacks to Auth0 CLI claim variables in serverless configurations
- Creates a new
set_prod_claims.shutility script to populate Auth0 CLI claim SSM parameters for production - Adds extra whitespace alignment to Auth0 CLI claim variables in
cla-backend/serverless.yml
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| utils/set_prod_claims.sh | New utility script to set Auth0 CLI claims in AWS SSM for production environment (both us-east-1 and us-east-2 regions) |
| cla-backend/serverless.yml | Updated AUTH0 CLI claim environment variables to include env variable and empty string fallbacks, with aligned spacing |
| cla-backend-go/serverless.yml | Updated AUTH0 CLI claim environment variables to include env variable and empty string fallbacks |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
Actionable comments posted: 2
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
Disabled knowledge base sources:
- Jira integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (3)
cla-backend-go/serverless.yml(1 hunks)cla-backend/serverless.yml(1 hunks)utils/set_prod_claims.sh(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
- GitHub Check: build-test-lint
- GitHub Check: cypress-functional
🔇 Additional comments (2)
cla-backend/serverless.yml (1)
315-317: Consistent fallback pattern for optional AUTH0 CLI claim variables.The changes correctly implement the fallback chain (env.json → SSM → environment variable → empty string) for optional environment variables. This allows CLI claims to be configured at runtime via environment variables while maintaining backward compatibility with SSM and local env.json configurations.
cla-backend-go/serverless.yml (1)
226-228: Consistent environment variable fallback across Go backend.The changes mirror the Python backend updates with appropriate use of
opt:stageparameter syntax. Both backends now support optional AUTH0 CLI claim variables with environment variable overrides and empty-string fallback.
Co-authored-by: Copilot <[email protected]> Signed-off-by: Łukasz Gryglicki <[email protected]>
Fallback to missing if not avail in SSM - those are optional env variables cc @mlehotskylf @ahmedomosanya
Signed-off-by: Lukasz Gryglicki [email protected]
Assisted by OpenAI
Assisted by GitHub Copilot