Skip to content

refactor(oauth2): rename require_pkce_for_public to require_pkce - #356

Merged
voidvec merged 2 commits into
masterfrom
refactor/rename-require-pkce
Nov 19, 2026
Merged

voidvec merged 2 commits into
masterfrom
refactor/rename-require-pkce

Conversation

@voidvec

@voidvec voidvec commented Nov 19, 2026

Copy link
Copy Markdown
Owner

Summary

auth.require_pkce_for_public never distinguished client_type — when enabled (the default, F-011 / RFC 9700 §2.1.1) it requires PKCE for every authorization_code client, so the _for_public suffix was a lie. This renames the key to auth.require_pkce as a hard cut (no fallback read, same policy as the v1.6.0 allow_pkce_plain removal) and corrects every "PUBLIC clients" claim in the shipped surface to match the actual all-clients behavior.

Changes:

  • Read sites (3): SessionController login CHECK 4 + consent, AuthorizationEndpointController silent re-auth — default stays true.
  • External wording: error_description "PKCE (code_challenge) is required for public clients" → "PKCE (code_challenge) is required" (login + authorize); the login LOG_WARN no longer claims the client is PUBLIC.
  • Configs: require_pkce: true in all 5 shipped configs (config{,.dev,.ci,.prod,.bench}.json).
  • Contract: openapi.yaml descriptions (login body + authorize query param) → go/python/ts SDKs regenerated (regen_clients.py --check green, version linkage 1.6.0); apps/server/docs/api/openapi.json description hand-synced to the new C++ ParameterInfo text (derived artifact per sync-points fix(admin): session persistence, token timestamps, audit log filters + test coverage #7).
  • Docs: configuration guide, security-architecture, api-reference, oidc-guide, token-lifecycle, verification-checklist — EN + website/i18n/zh-CN mirrors; llms-full.txt regenerated. Also fixes the stale "plain is supported" claims in security-architecture/oidc-guide/api-reference (S256-only since the v1.6.0 plain removal, AuthorizationEndpointController.cc:411).
  • Housekeeping: benchmark scenario comments, .claude rules/skills/agents wording, LoginEnforcementTest docstring refreshed to current behavior, CHANGELOG breaking-change migration note under Unreleased.

Intentionally untouched (historical records): the 2026-08-07 compliance-audit ADR (+ zh-CN mirror), which self-documents F-011's fix in its disposition table, and the v1.5.0 CHANGELOG entry.

Migration: deployments that explicitly set require_pkce_for_public must rename the key; otherwise it silently falls back to the secure default true.

Type of change

  • Bug fix (non-breaking)
  • New feature (non-breaking)
  • Breaking change (API, config, or protocol surface)
  • Docs / tests / CI only

Checklist

General:

  • Tests added or updated; full suite green locally (or N/A — say why)
  • CHANGELOG.md entry added (user-visible changes)
  • Docs updated (incl. website/i18n/zh-CN mirrors when docs/ content changed)

If this touches the API surface (skip otherwise):

  • OpenAPI spec kept in sync (authoritative apps/server/openapi.yaml and its mirror points)
  • Error codes synced at all five points (spec, catalog test, SDKs where applicable) — no code added/changed, description text only
  • Endpoint fingerprints / golden baselines regenerated if endpoints changed — no endpoint/route/schema change
  • api-diff and oasdiff gates addressed (a justified --force / ignore entry is fine — explain below)
  • Breaking changes curated into the Breaking changes section of CHANGELOG.md

Notes on the checklist:

  • Tests: behavior is unchanged (key rename + string literals), covered by the existing Integration_P1_Login_PKCE_Config_Exists (updated to read the new key). C++ build/integration suite not run locally (fresh worktree, no build dir) — the source changes are literals/comments/JSON keys only; relying on CI for the compile legs.
  • api-diff: PASS (no header changes). oasdiff: description-only edits are non-breaking, no ignore entry needed.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 19, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-19T01:44:21.143110Z 3029682 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

wangrh0909
wangrh0909 previously approved these changes Nov 19, 2026
The flag applies to every authorization_code client regardless of
client_type, so the _for_public suffix was a lie. Hard cut with no
fallback read (same policy as the v1.6.0 allow_pkce_plain removal):
deployments that set the old key explicitly must rename it or fall
back to the secure default true.

- read sites: SessionController login CHECK 4 + consent,
  AuthorizationEndpointController silent re-auth
- error_description now 'PKCE (code_challenge) is required' (was
  '... for public clients'); login LOG_WARN no longer claims PUBLIC
- openapi.yaml descriptions updated; go/python/ts SDKs regenerated
  (drift gate green); openapi.json description hand-synced to the
  new C++ ParameterInfo text (derived artifact)
- shipped configs, configuration/architecture/domain guides (EN +
  zh-CN site mirrors), benchmark comments, .claude rules/skills,
  LoginEnforcementTest docstring refreshed to current behavior
- also fixes the stale 'plain is supported' claims in
  security-architecture/oidc-guide/api-reference: S256 only since
  the v1.6.0 plain removal
- CHANGELOG: breaking-change migration note under Unreleased

Historical records intentionally untouched: the 2026-08-07 compliance
audit ADR (+ zh-CN mirror) and the v1.5.0 CHANGELOG entry.

Local gates green: spec-governance, sdk-drift, api-diff, double-move,
migration, test-naming; llms-full.txt regenerated.
@voidvec
voidvec force-pushed the refactor/rename-require-pkce branch from 3029682 to 1e6c32f Compare November 19, 2026 06:08
@voidvec
voidvec merged commit 8aac1cc into master Nov 19, 2026
22 checks passed
@voidvec
voidvec deleted the refactor/rename-require-pkce branch December 2, 2026 04:43
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