Skip to content

feat(api)!: name the platform issuer's first-party clients in the server's configuration - #3553

Merged
fforootd merged 2 commits into
mainfrom
claude/oauth-first-party-clients
Dec 2, 2026
Merged

fforootd merged 2 commits into
mainfrom
claude/oauth-first-party-clients

Conversation

@fforootd

@fforootd fforootd commented Dec 2, 2026

Copy link
Copy Markdown
Member

Context

Step 3 of ADR 094's sequence (§8), closing its escalation path 9. A first-party client is asked no consent, so its tokens carry every scope it asks for. On the platform project's issuer, the first_party flag of a client's document could be set by whoever publishes an application there. ADR 094 requires this closed before any later step lets a person publish an application on the platform project.

Summary

  • New setting oauth.first_party_clients: the clients the platform project's issuer asks no consent, by client ID. It is empty by default, and it refuses a client with a metadata document, a blank entry and a client named twice.
  • The client directory decides the party for the consent step, the authorization endpoint and the token endpoint alike: on the platform issuer by the setting, on every other issuer by the document's flag, as before.
  • ADR 082 and ADR 094 say what is built; docs/operations/nextgen.example.yaml and the configuration guide document the setting.

Validation

Run by the session that wrote the change, in its cloud container:

  • SQLite and Postgres 16: the full internal/api/integration_test suite passes with the change.
  • New tests, each failing without the change: TestLoadConfigOAuthFirstPartyClients, TestClientDirectory_PlatformFirstPartyClients.

Run again when opening this draft, on the commit cherry-picked onto current main:

  • go build ./... in apps/api
  • go test ./internal/service/ -run TestClientDirectory
  • go test ./cmd/server/ -run TestLoadConfig
  • node scripts/check-pr-title.mjs --title "…"

Release notes / changeset

  • Changeset: .changeset/platform-first-party-clients.md (@zitadel/server, minor, with a Breaking note). On the platform project's issuer an application's first_party flag no longer skips consent; list the client ID in oauth.first_party_clients to keep skipping it.

Notes

  • Who notices today. No first-party client exists on the platform issuer: the Console signs in with its session cookie, and the platform release declares no application. Nothing changes for a running deployment unless it publishes one.
  • Decisions taken for review:
    • A client with a metadata document stays never-first-party, on the platform issuer too (the setting refuses a URL), as ADR 082 §9 has it. The alternative is to let the setting name one, which a CLI that signs in by a client document would need in order to skip consent.
    • The setting defaults to empty. The alternative is to ship the Console's and the CLI's client IDs once they exist.
  • Independent of the session type and its gates (step 2), which are a separate stack. This commit was cherry-picked from the writing session's branch, where it sits on top of step 2.
  • Written in the session https://claude.ai/code/session_0137eGmTQoT7kemXw7jcdBJ3; the draft was opened by the coordinating session below.

Generated by Claude Code

…ation

ADR 094 §8, step 3 of its sequence. A first-party client is asked no
consent, so its tokens carry every scope it asks for. On the platform
project's issuer the first_party flag of a client's document could be set
by whoever publishes an application there; escalation path 9 of the ADR
needs that closed before a person may publish one.

- oauth.first_party_clients names the clients the platform issuer asks no
  consent, by client ID; empty by default, and it refuses a client with a
  metadata document, a blank entry and a client named twice.
- The client directory decides the party for consent, the authorization
  endpoint and the token endpoint alike: on the platform issuer by the
  setting, on every other issuer by the document's flag.

Today no first-party client exists on the platform issuer (the Console
signs in with its session cookie, and the platform release declares no
application), so nothing changes for a running deployment unless it
publishes one; the changeset says how to keep one.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0137eGmTQoT7kemXw7jcdBJ3
(cherry picked from commit 45f7861)
@vercel

vercel Bot commented Dec 2, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
cloud Ready Ready Preview Dec 2, 2026 3:00pm UTC

Request Review

@github-actions

github-actions Bot commented Dec 2, 2026

Copy link
Copy Markdown
Contributor

🦋 Changeset detected

Latest commit: 4009656

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 27 packages
Name Type
@zitadel/server Minor
@zitadel/cli Minor
@zitadel/testing Minor
@zitadel/server-darwin-arm64 Minor
@zitadel/server-darwin-x64 Minor
@zitadel/server-linux-arm64 Minor
@zitadel/server-linux-x64 Minor
@zitadel/server-win32-x64 Minor
@zitadel/api Minor
@zitadel/components Minor
@zitadel/config Minor
@zitadel/sdk-angular Minor
@zitadel/sdk-core Minor
@zitadel/sdk-next Minor
@zitadel/sdk-nuxt Minor
@zitadel/sdk-qwik Minor
@zitadel/sdk-qwik-router Minor
@zitadel/sdk-react Minor
@zitadel/sdk-solid Minor
@zitadel/sdk-solid-start Minor
@zitadel/sdk-svelte Minor
@zitadel/sdk-sveltekit Minor
@zitadel/sdk-tanstack-start Minor
@zitadel/sdk-vue Minor
@zitadel/cloud Patch
@zitadel/client-sdk-contract Patch
@zitadel/server-sdk-contract Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Dec 2, 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
🔒 Security Review ✅ Completed 2026-12-02T14:13:36.777500Z 4009656 Draft marked ready
ℹ️ 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.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Approval recommended

No active review issues block the move to server-configured first-party client controls.

No open issues 🎉

What changed in this PR

Moves the platform issuer’s consent exemption from application flags to server configuration, implementing ADR 094’s first-party client control.

Changes:

  • Adds oauth.first_party_clients, empty by default, with configuration validation.
  • Applies consistent classification across consent, authorization, and token handling while preserving other issuers’ behavior.
  • Adds tests, configuration guidance, and breaking-change release notes.
File Description
docs/​quick-start/​configuration.md Documents the setting and consent behavior.
docs/​operations/​nextgen.example.yaml Adds the configuration example.
docs/​adrs/​094-project-permission-model.md Marks the configuration control as built.
docs/​adrs/​082-oauth-and-oidc-server.md Documents the platform-specific override.
apps/​api/​internal/​service/​client_directory.go Centralizes effective first-party classification.
apps/​api/​internal/​service/​client_directory_test.go Tests platform and non-platform classification.
apps/​api/​cmd/​server/​server.go Wires configuration and its empty default.
apps/​api/​cmd/​server/​server_test.go Tests configuration loading and rejection cases.
apps/​api/​cmd/​server/​config.go Defines and validates the setting.
.changeset/​platform-first-party-clients.md Explains the breaking change and migration.

Review effort: Balanced

@fforootd
fforootd enabled auto-merge December 2, 2026 14:49
@fforootd
fforootd added this pull request to the merge queue Dec 2, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Dec 2, 2026
@fforootd
fforootd added this pull request to the merge queue Dec 2, 2026
Merged via the queue into main with commit 3e7b828 Dec 2, 2026
16 of 17 checks passed
@fforootd
fforootd deleted the claude/oauth-first-party-clients branch December 2, 2026 15:17
@github-project-automation github-project-automation Bot moved this from Inbox to Done in Engineering Kanban Dec 2, 2026
fforootd pushed a commit that referenced this pull request Dec 2, 2026
main named the platform issuer's first-party clients in the server's
configuration (#3553), in the directory this branch teaches the CLI's
client. Both stay: the CLI's client is answered from memory before the
first-party list is asked, and it is a client with a document, which is
never first-party.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0137eGmVSt2DgYJj2CjZbi1U

This branch was successfully deployed

1 active deployment
Preview — 66dd0582 Deployed Dec 2, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants