Skip to content

chore(other): align cafe api description with dcr rfc7591 and oauth2 rfc6749 - #21

Open
DmitryAnansky wants to merge 15 commits into
mainfrom
chore/docs-update-align-cafe-api-with-dcr-and-oauth2-rfcs
Open

chore(other): align cafe api description with dcr rfc7591 and oauth2 rfc6749#21
DmitryAnansky wants to merge 15 commits into
mainfrom
chore/docs-update-align-cafe-api-with-dcr-and-oauth2-rfcs

Conversation

@DmitryAnansky

@DmitryAnansky DmitryAnansky commented Aug 20, 2026

Copy link
Copy Markdown
Collaborator

Aligned Cafe API description with dcr rfc7591 and oauth2 rfc6749.

Preview LINK

@DmitryAnansky DmitryAnansky self-assigned this Aug 20, 2026
@DmitryAnansky
DmitryAnansky requested a review from a team August 20, 2026 13:47
@DmitryAnansky DmitryAnansky changed the title chore(other): align cafe api description wirh dcr rfc7591 and oauth2 rfc6749 chore(other): align cafe api description with dcr rfc7591 and oauth2 rfc6749 Aug 20, 2026
@DmitryAnansky
DmitryAnansky requested a review from a team August 20, 2026 14:26
@DmitryAnansky
DmitryAnansky marked this pull request as ready for review August 20, 2026 14:57

@redocly redocly Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

cafe AI Review: 🟢 Completed

Redocly Agent has reviewed your changes and found 36 potential issue(s).

Note

Low Risk

The blast radius is limited to API documentation and a theme script. Since there are no modifications to underlying backend services or core application logic, the operational risk is minimal.

Overview

Aligns the Cafe API OpenAPI documentation with standard OAuth2 (RFC 6749) and Dynamic Client Registration (RFC 7591) protocols:

  • Migrates client registration schemas to use standard snake_case properties (e.g., client_id, grant_types).
  • Updates OAuth2 error response definitions to use standard formats instead of RFC 9457 problem+json.
  • Adds OpenAPI paths for token, revocation, well-known authorization metadata, and client configuration endpoints.
  • Modifies @theme/ext/use-configure-replay.ts to consume the standard RFC 7591 registration fields.

Comment thread openapi/components/schemas/OAuth2Client.yaml Outdated
Comment thread openapi/components/schemas/UpdateClientObject.yaml
- client_id_issued_at
- client_secret_expires_at
- registration_client_uri
- registration_access_token

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Severity: High

OAuth2Client.yaml requires client_secret and registration_access_token. Returning these in GET/PUT responses for /oauth2/register/{clientId} violates RFC 7592 Section 2.1 and exposes sensitive credentials unnecessarily. Use a separate schema for management responses.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Not valid

What RFC 7592 actually specifies:

Section 2.1 (Read) and Section 2.2 (Update) both say, verbatim: "Some values in the response, including the client_secret and registration_access_token, MAY be different from those in the initial registration response." The RFC doesn't merely permit these fields in GET/PUT responses — it builds a feature on top of them: the server may rotate the secret or registration token during a read/update, and the response is how the client learns the new values. Omitting them would break that mechanism.
Section 3 (Client Information Response) — the response format both operations reference — says the server "MUST return all registered metadata about this client", extends RFC 7591's client information response ("the response contains the client identifier as well as the client secret, if the client is a confidential client"), and its example response literally contains both client_secret and registration_access_token.

So our GET/PUT responses (and OAuth2Client.yaml requiring those fields) are not a violation of §2.1 — they're an implementation of it. The contract tests validate exactly this shape.

Where the reviewer likely went wrong: §2.2 does contain a MUST NOT, but it applies to the request: the update request must not include registration_access_token, registration_client_uri, client_id_issued_at, or client_secret_expires_at (and any included client_secret must match). We enforce that direction correctly. It's an easy sentence to misattribute to the response.

Comment thread openapi/paths/oauth2_register_{clientId}.yaml Outdated
Comment thread openapi/components/schemas/UpdateClientObject.yaml Outdated
Comment thread openapi/paths/well-known_oauth-authorization-server.yaml
Comment thread openapi/components/schemas/RegisterClientObject.yaml Outdated
Comment thread openapi/components/schemas/OAuthError.yaml
Comment thread openapi/components/schemas/RegisterClientObject.yaml
Comment thread openapi/components/schemas/OAuth2Client.yaml
Comment thread openapi/paths/oauth2_register_{clientId}.yaml
Comment thread openapi/paths/oauth2_register_{clientId}.yaml
Comment thread openapi/cafe.yaml
Comment thread openapi/components/schemas/RegisterClientObject.yaml
Comment thread openapi/components/schemas/RegisterClientObject.yaml
Comment thread openapi/components/schemas/RegisterClientObject.yaml
Comment thread openapi/components/schemas/RegisterClientObject.yaml
Comment thread openapi/components/schemas/RegisterClientObject.yaml
Comment thread openapi/components/schemas/RegisterClientObject.yaml
Comment thread openapi/paths/oauth2_register.yaml
Comment thread openapi/paths/oauth2_register.yaml
Comment thread @theme/ext/use-configure-replay.ts
Comment thread openapi/components/schemas/OAuth2Client.yaml
Comment thread openapi/components/schemas/OAuth2Client.yaml
Comment thread openapi/components/schemas/RegisterClientObject.yaml Outdated
Comment thread openapi/paths/oauth2_register.yaml Outdated
Comment thread openapi/components/schemas/RegisterClientObject.yaml Outdated
Comment thread openapi/components/schemas/UpdateClientObject.yaml
Comment thread openapi/components/responses/OAuth2Unauthorized.yaml Outdated
Comment thread openapi/components/schemas/OAuth2Client.yaml Outdated
Comment thread openapi/components/schemas/OAuth2Client.yaml Outdated
Comment thread openapi/components/schemas/OAuth2Client.yaml Outdated
Comment thread openapi/components/schemas/OAuth2Client.yaml Outdated
Comment thread openapi/paths/oauth2_token.yaml Outdated
Comment thread openapi/paths/oauth2_token.yaml Outdated
Comment thread openapi/paths/oauth2_token.yaml Outdated
Comment thread openapi/paths/oauth2_token.yaml Outdated
Comment thread openapi/paths/oauth2_token.yaml Outdated
@DmitryAnansky
DmitryAnansky requested a review from JLekawa August 27, 2026 12:28
Comment thread openapi/components/schemas/RegisterClientObject.yaml
Comment thread openapi/components/schemas/RegisterClientObject.yaml Outdated
Comment thread openapi/components/schemas/RegisterClientObject.yaml
Comment thread openapi/paths/oauth2_token.yaml
Comment thread openapi/paths/oauth2_token.yaml
Comment thread openapi/components/schemas/UpdateClientObject.yaml
Comment thread openapi/components/schemas/OAuth2Client.yaml Outdated
Comment thread openapi/components/responses/OAuth2Unauthorized.yaml Outdated
Comment thread openapi/components/schemas/OAuth2Client.yaml Outdated
Comment thread openapi/components/schemas/RegisterClientObject.yaml Outdated
Comment thread openapi/paths/oauth2_revoke.yaml Outdated
Co-authored-by: Jacek Łękawa <164185257+JLekawa@users.noreply.github.com>
Comment thread openapi/components/responses/OAuth2Unauthorized.yaml Outdated
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.

2 participants