-
Notifications
You must be signed in to change notification settings - Fork 35
docs(terraform): OpenAPI callback for frontend client #2178
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
When using the OpenAPI (rapidoc) web interface, for obtaining token it uses /openapi/oauth-receiver.html as target for callback redirect. ( as can be seen also in common/infrastructure/src/app/http.rs#L607 ) While Cognito requires each callback page to be specified by full URL, having just domain or top-level url (as in console-url) is not enough. So this adds the openapi endpoint directly to allowed CallbackURLs for the fronted client.
Reviewer's guide (collapsed on small PRs)Reviewer's GuideUpdates the Terraform configuration for the frontend Cognito user pool client so that the OpenAPI (RapiDoc) OAuth callback URL is explicitly whitelisted, ensuring token retrieval via the /openapi/oauth-receiver.html endpoint works correctly. Sequence diagram for OpenAPI OAuth callback via CognitosequenceDiagram
actor Developer
participant Browser
participant OpenAPI_UI as OpenAPI_RapiDoc_UI
participant Cognito as AWS_Cognito
participant OAuthReceiver as OpenAPI_OAuth_Receiver_Page
Developer->>Browser: Open OpenAPI docs URL
Browser->>OpenAPI_UI: Load OpenAPI UI
Developer->>OpenAPI_UI: Click authorize to obtain token
OpenAPI_UI->>Cognito: Redirect to Cognito authorize endpoint
Developer->>Cognito: Authenticate via SSO
Cognito-->>OAuthReceiver: Redirect to callback URL /openapi/oauth-receiver.html with tokens
OAuthReceiver-->>OpenAPI_UI: Expose tokens to OpenAPI UI
OpenAPI_UI-->>Developer: Authenticated API calls available
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
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.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2178 +/- ##
=======================================
Coverage 68.22% 68.22%
=======================================
Files 376 376
Lines 21190 21190
Branches 21190 21190
=======================================
+ Hits 14456 14457 +1
+ Misses 5868 5862 -6
- Partials 866 871 +5 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
When using the OpenAPI (rapidoc) web interface,
for obtaining token it uses /openapi/oauth-receiver.html as target for callback redirect.
(As can be seen also in common/infrastructure/src/app/http.rs#L607)
While Cognito requires each callback page to be specified by full URL,
having just domain or top-level url (as in console-url) is not enough.
So this adds the openapi endpoint directly to allowed CallbackURLs for the fronted client.
Summary by Sourcery
Enhancements: