fix(#260): restore admin portal CORS access to AI backend - #261
Merged
Conversation
Align API Gateway CORS allowlist with admin/frontend domain variants across environments and restrict middleware origin regex to purposepath.app only to prevent unowned-domain access. Made-with: Cursor
|
🍹 The Update for mottych/purposepath-coaching-api/preprod (at 21f93d3) was successful. ✨ Neo ExplanationThis deployment pushes updated application code to the preprod Lambda function and expands the API's CORS policy to permit requests from additional frontend and admin subdomains.Root Cause AnalysisTwo independent changes are being deployed together: (1) new application code has been built into a fresh Docker image, and (2) the API Gateway CORS configuration has been expanded to allow additional origins. Dependency Chain
Risk analysisNo stateful resources (databases, storage) are being modified or replaced. The Lambda update is an in-place image swap with no replacement. The CORS change is additive (origins are being added, none removed). No downtime or data loss risk. Resource Changes Name Type Operation
~ coaching-api aws:apigatewayv2/api:Api update
~ coaching-api aws:lambda/function:Function update
~ coaching-image docker:index/image:Image update
|
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
www/non-wwwfrontend variants.purposepath.app(remove accidentalpurpopsepath.app).Root cause
API Gateway CORS
allow_originsdid not include admin portal origins. Browser preflight requests were rejected at API Gateway before FastAPI middleware could apply CORS headers.Validation
uv run mypy coaching/src shared/ --explicit-package-basesuv run ruff check coaching/ shared/ --fixfails due pre-existing repo-wideUP042findings unrelated to this hotfixuv run --no-sync pytestfails during collection with environment dependency issue:ImportError: cannot import name 'BeautifulSoup' from 'bs4'Preprod + production verification plan
masterand monitor production deployment.adminorigin.Incident scope control
This PR intentionally changes only CORS configuration and origin-matching logic required for the incident.