Skip to content

Conversation

@torcolvin
Copy link
Collaborator

  • Note that APIs can return 401 if the authenticating user doesn't have access to DB
  • Annotate use of login_origin and origin
  • Update User-session-information and consolidate usage

Preview with:

npx --yes @redocly/cli@1 admin
npx --yes @redocly/cli@1 public

- Note that APIs can return 401 if the authenticating user doesn't have access to DB
- Annotate use of login_origin and origin
Copilot AI review requested due to automatic review settings October 23, 2025 22:34
@github-actions
Copy link

github-actions bot commented Oct 23, 2025

Redocly previews

Copy link
Contributor

Copilot AI left a 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-information schema and adding 401 response handling
  • Updates CORS descriptions to specify that both cors.login_origin and cors.origin must match the Origin header
  • 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

@torcolvin torcolvin requested a review from Copilot October 31, 2025 14:54
Copy link
Contributor

Copilot AI left a 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.

Copy link
Collaborator

@adamcfraser adamcfraser left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typos

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".
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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 adamcfraser self-assigned this Oct 31, 2025
Copy link
Collaborator

@adamcfraser adamcfraser left a 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":
Copy link
Collaborator

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.

Copy link
Collaborator Author

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":
Copy link
Collaborator

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":
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Check 404 usage.

Copy link
Collaborator Author

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
Copy link
Collaborator

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?

Copy link
Collaborator Author

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.

@torcolvin torcolvin merged commit 41a14a5 into main Oct 31, 2025
63 of 64 checks passed
@torcolvin torcolvin deleted the CBG-4948 branch October 31, 2025 21:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants