-
Notifications
You must be signed in to change notification settings - Fork 140
CBG-4948 update the documentation for CORS #7833
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
- Note that APIs can return 401 if the authenticating user doesn't have access to DB - Annotate use of login_origin and origin
Redocly previews |
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 updates OpenAPI documentation for CORS configuration and session-related endpoints across public and admin APIs. The changes clarify authentication requirements, consolidate schema definitions, and improve CORS documentation.
- Standardizes session endpoint documentation by consolidating the
User-session-informationschema and adding 401 response handling - Updates CORS descriptions to specify that both
cors.login_originandcors.originmust match theOriginheader - Consolidates CORS configuration schema into a reusable component
Reviewed Changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| docs/api/paths/public/db-_session.yaml | Added 401 responses, consolidated 200 response schema, updated CORS description and request body schema |
| docs/api/paths/public/db-_google.yaml | Updated CORS description and response reference |
| docs/api/paths/public/db-_facebook.yaml | Updated CORS description and response reference |
| docs/api/paths/admin/db-_session.yaml | Removed duplicate GET endpoint, added 401 response, standardized quote style |
| docs/api/paths/admin/db-_google.yaml | Updated CORS description and response reference |
| docs/api/paths/admin/db-_facebook.yaml | Updated CORS description and response reference |
| docs/api/components/schemas.yaml | Consolidated CORS schema, enhanced User-session-information schema with detailed field descriptions |
| docs/api/components/responses.yaml | Added Unauthorized response, renamed Invalid-CORS to Invalid-CORS-LoginOrigin with improved description |
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
Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.
adamcfraser
left a 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.
Typos
docs/api/components/schemas.yaml
Outdated
| properties: | ||
| authentication_handlers: | ||
| description: The ways authentication can be established to authenticate as the user. | ||
| description: The ways authentication can be established to authenticate as a user. Used for CouchDB compatability. Always contains "default" and "cookie". |
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.
| description: The ways authentication can be established to authenticate as a user. Used for CouchDB compatability. Always contains "default" and "cookie". | |
| description: The ways authentication can be established to authenticate as a user. Used for CouchDB compatibility. Always contains "default" and "cookie". |
adamcfraser
left a 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.
A few comments/suggestions.
| '404': | ||
| "401": | ||
| $ref: ../../components/responses.yaml#/Unauthorized | ||
| "404": |
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.
As discussed, check whether 404 is (still) returned by this endpoint.
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.
This can't return 404.
| $ref: ../../components/responses.yaml#/Invalid-CORS-LoginOrigin | ||
| "401": | ||
| $ref: ../../components/responses.yaml#/Unauthorized | ||
| "404": |
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.
Check 404 usage
| $ref: ../../components/responses.yaml#/Invalid-CORS-LoginOrigin | ||
| "401": | ||
| $ref: ../../components/responses.yaml#/Unauthorized | ||
| "404": |
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.
Check 404 usage.
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.
This returns 404 if the session_id doesn't exist.
| '400': | ||
| $ref: ../../components/responses.yaml#/Invalid-CORS | ||
| "401": | ||
| $ref: ../../components/responses.yaml#/Unauthorized |
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.
Possibly 404 is still returned here if admin auth is disabled?
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.
Returned if there is no DB.
Co-authored-by: Adam Fraser <[email protected]>
Co-authored-by: Adam Fraser <[email protected]>
Co-authored-by: Adam Fraser <[email protected]>
User-session-informationand consolidate usagePreview with: