Repository navigation
feat(api): name the hosts whose OAuth clients a server admits without registration - #3499
Merged
Merged
Conversation
…ver follows ADR 091, proposed. "MCP in Zitadel" is a local stdio server in the CLI, /mcp on the platform project's issuer, and the MCP servers customers build with Zitadel as their authorization server, built in order of dependency. It records that a tool is one operation generated from the operation table, that the spec marks which operations only read, belong to applications or return a credential, that an agent reads by default and writes only in development, and that a destructive call needs the person's confirmation for that call. The local server is experimental and second to the CLI for an agent that has a shell; whether it ships beyond that is an open question. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0137eGmVSt2DgYJj2CjZbi1U
…s in the spec Three facts a client had to guess from a method or a name are now said on the operation, beside x-zitadel-cli and x-zitadel-destructive: - x-zitadel-read-only: a POST that changes nothing (the queries, the search, a policy evaluation, the invitation lookup). - x-zitadel-plane: app: an operation an application's backend calls while a user signs in (auth attempts, session creation and exchange, passkey registration). - x-zitadel-returns-secret: a response that carries a secret shown once or a token that signs a caller in. The operation table carries them as readOnly, plane and returnsSecret, and the CLI's Operation reads them. Only the bundled OpenAPI document changes among the generated files. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0137eGmVSt2DgYJj2CjZbi1U
A port of the #2315 prototype to the current CLI, with the rules of ADR 091. Experimental, and marked so in its help and in SKILL.md. zitadel mcp is a stdio MCP server an MCP client starts. It serves one tool per operation an operator calls, named by its operationId and typed by the generated schemas, with the server and project secret every project command resolves. - Only read-only operations are tools unless --allow-writes, which is refused outside the development environment unless --dry-run is given. - A tool that deletes, revokes or rolls back asks the person at the client first, and sends nothing when they decline, when the client cannot ask, or when a confirmation arrives for a call nothing asked about. - An application-plane operation and one that returns a credential are never tools. - stdout carries the protocol alone: --json and a run at a terminal are refused before the first byte. The protocol library loads only when a session is served, so no other command pays for it. Not in this change: an integration spec for the command, a docs page on connecting a client, and a telemetry dimension. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0137eGmVSt2DgYJj2CjZbi1U
This reverts commit efa4e84. The server already runs on a developer's machine, so an MCP endpoint in the server is local too, and one implementation then serves a local server, a self-hosted one and the cloud with the rules enforced by the server. The CLI command only mirrored API operations, which an agent with a shell already calls with the api command. The spec markers and the operation table fields stay. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0137eGmVSt2DgYJj2CjZbi1U
The Go server can mount a Model Context Protocol endpoint at /mcp (ADR 091). Experimental and off by default: mcp.enabled turns it on. - A tool is one operation of the API, read from the embedded OpenAPI document when the server starts. Its input schema is the spec's, with the component schemas it refers to in its own $defs. - A tool call is the operation's own request, served in-process by the API's handler behind the whole middleware chain with the caller's bearer, so it is authenticated, authorized, validated, limited and logged as the same request over HTTP is. - The credential is a project secret as the API takes it. A request without one is challenged with 401; a server that cannot check one answers 500, never 401. - Only read-only operations are tools unless mcp.allow_writes is set. An application-plane operation and one that returns a credential are never tools. - A tool that deletes, revokes or rolls back asks the person at the client first (multi round-trip requests), bound to that exact call by a state keyed with the credential. A client on a protocol revision before 2026-07-28 cannot be asked and is refused. - Streamable HTTP without sessions, answering JSON. The library's loopback host check is off, since a reverse proxy on the same machine forwards under the public host name and the endpoint takes no ambient credential. ADR 091 is rewritten around the endpoint, with the CLI stdio server as a rejected alternative. Adds github.com/modelcontextprotocol/go-sdk v1.9.0. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0137eGmVSt2DgYJj2CjZbi1U
… use mcp.enabled now defaults to true; mcp.allow_writes stays false. The endpoint opens nothing new: a caller needs the credential the API takes, and reading only it offers less than the API does. A switch that defaults to off would only keep agents out of servers whose operators never heard of it. So that a server no agent connects to pays nothing for it, the tools are built on the first request that carries a credential the server accepts, not at start: reading the embedded document and its schemas takes about 50 ms. A request the server refuses never triggers the build, and a document that cannot become tools fails this endpoint with 500 while the API serves on. Also tests that an id holding a slash stays inside its path segment, against the fake API and over the real one. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0137eGmVSt2DgYJj2CjZbi1U
- The endpoint is on by default because it opens nothing, and costs a server nothing until it is used; off by default is a rejected alternative. - Agent Skills through MCP's Skills extension (io.modelcontextprotocol/skills, SEP-2640) are wanted on the same endpoint: section 10, a step of the sequence, and an open question on which skills a server serves. Not built; the Go SDK at v1.9.0 does not carry the extension. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0137eGmVSt2DgYJj2CjZbi1U
…ts the spec backs createInvitation returns a link that gives its role to whoever opens it, and the link appears only in that response. It is now marked x-zitadel-returns-secret, so the MCP endpoint no longer offers it and the link cannot enter a model's context. Every write that was not marked destructive carried destructiveHint false, which the protocol defines as "only additive updates". An update, a password change and a variable removal are not that. Every tool also carried openWorldHint false. A write now carries a destructive hint only where the spec marks it, and no open-world hint, so a client reads the protocol's defaults. A read stays marked read-only and closed. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0137eGmVSt2DgYJj2CjZbi1U
…and four open questions in ADR 091 Reading by default narrows the tools, not the project secret the client holds. The Skills extension can be built on the Go SDK's custom methods now. The protocol deprecated dynamic client registration and has an MCP server pass no token on, which asks whether /mcp and the management API are one protected resource. Open questions added: createProjectClaim as a tool, the audience, tool names, and a marker for writes that only add. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0137eGmVSt2DgYJj2CjZbi1U
The pieces a person's token on /mcp needs were built once in the closed prototype #2451, are read against the epic in #2860, and public clients are being built again in #3409. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0137eGmVSt2DgYJj2CjZbi1U
…place of a server switch mcp.allow_writes is gone. One server holds many projects, so a switch on the server was the wrong size, and it hid tools from a client that still held a credential that writes. Every operation already names the scopes it needs in the OpenAPI document, and the API checks a credential against them. The endpoint now reads those scopes and shows a client a tool only when its credential carries every scope of the tool's operation, by the API's own rule (the security handler hands the endpoint the credential with that rule). The list is narrowed per request; authorization stays the API's, which refuses a call to a tool a client was not shown as it refuses that request from anywhere. A project secret carries every scope, so a client that holds one is now shown all 76 tools, writes among them. A destructive call still asks the person at the client first. The integration test creates a team through a tool and sees a deactivation left unsent when nobody can be asked. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0137eGmVSt2DgYJj2CjZbi1U
Section 5 is rewritten: the scopes each operation names decide the list, a project secret carries them all today, and who may write is decided where an agent is connected. The server switch and a per-project setting join the rejected alternatives, and a credential that only reads is an open question. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0137eGmVSt2DgYJj2CjZbi1U
The earlier wording said the API checks a credential against the scopes an operation names. It does not: it authorizes by the credential's ceiling and the caller's grants, and checks a scope only on an expand. ADR 091, the configuration guide and the code comments now say so, and the ADR records as an open question where the check belongs and which scopes in the spec are off. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0137eGmVSt2DgYJj2CjZbi1U
A tool's description was its summary with the method and path, such as
"Update a team: PATCH /teams/{team_id}.". A model reads the description and
not the title, and the summary only names the operation. The description is
now the first sentence of the operation's description, which the spec writes
to stand alone: "Renames an active team. API: PATCH /teams/{team_id}.". The
question a destructive call asks the person carries the same sentence, so it
says what will happen and not only the operation's name.
The seven query tools take their page token in the body and had no paging
hint; they now carry one that says so.
Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0137eGmVSt2DgYJj2CjZbi1U
A summary is an MCP tool's title, an API reference page's title and the generated clients' doc comment. Eight still named an operation as it was called before the renames of #3007, so a tool named deleteGrant was titled "Revoke a grant" and one named listVariables "Get a project's variables". They now open with the verb of their operationId, and a test in the MCP package holds that for every tool. search is "Search resources": it searches the resources of projects, not the projects. getUserPasswordState declared its user_id inline and without a description; it now refers to the shared parameter, as setUserPassword on the same path does. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0137eGmVSt2DgYJj2CjZbi1U
A tool takes its name, title and description from the spec. The API checks a scope for an expand and for the kinds in a release bundle, and nowhere else. The open questions now say which scope and name oddities are deliberate, which break a written rule, and add buildRelease's weight and createDeployment's missing question. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0137eGmVSt2DgYJj2CjZbi1U
…too heavy Every session carries the whole tool list in the agent's context. buildRelease was 35,000 bytes of it, more than a fifth, because its input repeats the schema of every kind of config. It also takes the files of .zitadel/ as written on disk, which an agent with a shell sends with the CLI. One tool may now weigh 16,000 bytes at most. An operation whose tool would weigh more stays an operation of the API and is not a tool, and a test names each one, so the next to grow past the budget is dropped by a decision. The list is 75 tools and 124,000 bytes, held under 130,000. The confirmation texts no longer list delete, revoke and roll back, since a deployment asks as well. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0137eGmVSt2DgYJj2CjZbi1U
Both replace what a project serves. A rollback asked before it was sent and a deployment did not. The MCP endpoint now asks the person at the client before a deployment, @zitadel/api lists it among destructiveOperations, and `zitadel api createDeployment` asks first, so without a terminal it needs --force. `zitadel deploy`, `deployment create` and `preview` are unchanged: they already ask on their own terms. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0137eGmVSt2DgYJj2CjZbi1U
Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0137eGmVSt2DgYJj2CjZbi1U
… part of it Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0137eGmVSt2DgYJj2CjZbi1U
A project secret carries project.write and project.read, and the API reads project.write as every scope. ADR 091 and the configuration guide said it carries every scope. The ADR's scope question also names the removals that stay on a write scope as what they are: deliberate, and open in the gate contract test. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0137eGmVSt2DgYJj2CjZbi1U
The tools are the operations of the v1 contract, so the endpoint carries that contract's prefix (ADR 077 §3). A proxy or an edge that routes the API by its prefix routes the endpoint with it: the cloud already sends /api/ to the server, so it needs no routing rule, and /mcp at the root stays the website's. The server's console path check no longer reserves the endpoint's path, which is the API's now. ADR 091 records the root path as a rejected alternative, drops two sentences the scopes change and the removed reads-only default left stale, and notes which TypeScript SDK line speaks the revision a destructive call's confirmation needs. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0137eGmVSt2DgYJj2CjZbi1U
…ts scopes With oauth.enabled the management API takes an access token the platform project's issuer signed for a person (ADR 036, amendment of 2026-11-25). The person is the principal, with the grants their Console session has, on the operations a Console session may call. The token's scopes are a ceiling on them and never a grant: an operation that names a scope the token was not issued with answers 403 auth.scope_insufficient, and project.write is one scope among the others, not the umbrella it is for a project secret. Where a session's grants waive a scope on an expanded read, a token still needs the scope. The two secrets keep the rule they had. The verifier checks the signature against the platform project's own keys, the type, the issuer and the expiry, and that the session the token names is active and its subject's, so a token ends when its session does. A token issued for the MCP endpoint is taken only on the calls the endpoint makes, so its holder cannot call an operation the endpoint offers no tool for. The endpoint shows a person's token the tools its scopes cover among the operations the API takes it on. Nothing issues such a token yet: the token endpoint still signs for the client as audience and drops every scope. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0137eGmVSt2DgYJj2CjZbi1U
… session The platform project's issuer signs tokens for the server's own API. An authorization request names the API with resource (RFC 8707), by the API's URL or the MCP endpoint's, and asks for scopes the API's document declares. The request is stored with both, and the token its code buys carries the resource as its audience, the scopes, and the session it was issued in, which the API checks on every call. A request without a resource gets what it got: a token for its client, with no scope and no session claim. A resource the issuer has no API for is refused with invalid_target, which for a customer project's issuer is every resource, and a scope the API does not define with invalid_scope. Both go back to the client before anyone signs in. OpenID Connect's scopes are ignored, as before. The authorization requests table gains a nullable resource column in the three dialects. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0137eGmVSt2DgYJj2CjZbi1U
…th the read scope The MCP endpoint is an OAuth protected resource when the platform project's issuer signs tokens for it. It serves its metadata (RFC 9728) at /.well-known/oauth-protected-resource/api/v1/mcp, ahead of the OAuth server's well-known subtree, and names it in the challenge of a 401. The metadata names the issuer and the scopes a person's token can be used for: those of the operations that take such a token. Three reads a person's token reaches name project.write, which guards them from the preview secret until the credential planes split: getProject, listProjectMembers and search. A person's token reads them with project.read, as the permission catalog has it for an operator, and that scope writes nothing. A test holds the list to the spec. The endpoint asks the API one question about a credential, whether it covers an operation, where it asked two. ADR 091 and the permission catalog say what is checked now, and what still keeps a client from signing a person in. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0137eGmVSt2DgYJj2CjZbi1U
The playground test opens deleteGrant by its page title, which the spec's summary sets. The summary became "Delete a grant" on this branch, so the deployment check of the docs no longer found the page. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0137eGmVSt2DgYJj2CjZbi1U
…token-scope-checks
…r consent first A flow started with auth_request_id now ends in the redirect that carries the code to the client (ADR 081 §8 and §9), and the engine puts a consent step before it for a client that is not the project's own (§11). - POST /flows opens a flow for a request only from the browser that holds the request's binding cookie, on the issuer's origin, while the request is open, and against the deployment it resolved. Anything else answers flow.auth_request_invalid. On a secure origin only the __Host- cookie is read. - The code is issued after the handoff, which is what proves the sign-in complete, and is bound to the flow's session: it buys a token only once the browser exchanged the handoff. - The consent step is the engine's. No definition holds it, and consent and account_choice are reserved step names. It is asked of a person who has proven who they are, on every request, and carries the client's name, the host its answer goes to, the API and the scopes. Accepting continues to the code. Denying returns access_denied, signs nobody in and spends the request. - The platform project's issuer sends the browser to the Console's sign-in page. - A client that is asked for consent anyway may send prompt=consent. TestOAuthSignInFromTheAuthorizationEndpointToAToken runs the authorization code flow over HTTP from the authorization endpoint to the token endpoint. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0137eGmVSt2DgYJj2CjZbi1U
…with its consent screen The login page the authorization endpoint sends a browser to has the request's handle in its auth_request parameter. - <zitadel-login> reads the handle from the page URL and sends it with the flow it starts, also when it restarts one. - It renders the consent step with its built-in template whatever the project's branding says: the client's name, the host its answer goes to, the API and one line per scope, worded by consent.scope.<scope> in locales or else the scope itself. Focus goes to that summary, never to a button, so the Enter that sent the password allows nothing. - On the redirect that answers the request it exchanges the handoff first, since the code buys a token only once the session holds the sign-in. A refusal carries no handoff and is followed at once. A redirect of a flow for no request is unchanged. - The Console's /login keeps the handle and shows the sign-in to someone it already knows too, where it used to send them on. - The centered branding design stays the bundled template's copy. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0137eGmVSt2DgYJj2CjZbi1U
…project's template places
From the frontend review of the sign-in that answers an authorization request.
The consent step was the one step rendered by the built-in template whatever
a project's branding said, with its markup and styles in the template and
the shared stylesheet. It is now a step like any other:
- `<zl-consent>` is an atom, with a manifest entry, a story under the
accessibility gate and its own styles. The built-in template and both
ejectable designs place it above the step's two answers.
- A template that renders no summary gets it back before its first button,
by the safety net that puts back a required field: nobody is asked to
allow a client they are not shown.
- `consent.title` names the client through `{client}`, which the page fills
in from the step, so a template that greets the visitor in every title
needs no switch for this step.
- The handoff is exchanged before the browser leaves by one helper, shared
by the answer to an authorization request and `post-sign-in-url`.
The mock API learns both ends of it: a test opens a request with
`openAuthRequest(...)`, and a flow started with its handle passes through
the `consent` step and ends in the client's redirect. The component's spec
drives that mock in place of handlers of its own, and the focus test runs in
the browser project.
Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0137eGmVSt2DgYJj2CjZbi1U
… verb of their names `main` added `createTeamMembership` and `deleteTeamMembership`, titled "Add a user to a team" and "Remove a member from a team". An MCP client shows a person the summary and a model the `operationId`, and a test of the endpoint holds that the two open with the same verb. They are now "Create a team membership" and "Delete a team membership"; their descriptions keep the words a reader looks for. With them the endpoint offers 76 tools, about 127,000 bytes of the 130,000 its list may weigh. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0137eGmVSt2DgYJj2CjZbi1U
Both take a bearer and a session cookie, so their error lists gain `auth.scope_insufficient`, as every such operation's does on this branch. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0137eGmVSt2DgYJj2CjZbi1U
…tokens # Conflicts: # docs/design/api/events-catalog.md # packages/components/custom-elements.json
…en-scope-checks The consent step's summary became the `<zl-consent>` atom below this branch, so what this branch adds to it moves into the atom: the host that serves an unregistered client's document (`document-host`) and the warning under an answer that goes to the visitor's own device (`loopback-warning`). The three templates, the safety net, the mock API's request and the specs follow. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0137eGmVSt2DgYJj2CjZbi1U
github-merge-queue
Bot
removed this pull request from the merge queue due to a conflict with the base branch
Dec 1, 2026
…-admission-policy Brings in the cold-start flake fixes from main. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0137eGmVSt2DgYJj2CjZbi1U
The five pull requests below this one landed on main as squash commits. main's tree equals what this branch already holds of them, merged with the previous main (checked: the trees match), so this merge keeps the branch's tree and only records main as merged. What remains against main is this pull request's own change. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0137eGmVSt2DgYJj2CjZbi1U
GitHub's code scanning did not register the JavaScript analysis of the previous commit, although the analysis ran and its upload completed, and a default-setup scan cannot be re-run. This commit changes nothing; it only gives the scan a new commit to report on. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0137eGmVSt2DgYJj2CjZbi1U
fforootd
enabled stacked auto-merge
December 1, 2026 21:20
fforootd
pushed a commit
that referenced
this pull request
Dec 1, 2026
…ecorder Picks up main, which gained the client admission policy (#3499). Its deployment resolver still answers the instance alone, so it takes the instance from the resolved policy, and the dry run's resolver keeps both methods. The client admission gate evaluates as on main and records no decision yet. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0137eGmURNCsyVFcQC2EKSU6
fforootd
pushed a commit
that referenced
this pull request
Dec 1, 2026
Picks up main, with #3505 and the client admission policy (#3499). Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0137eGmURNCsyVFcQC2EKSU6
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Context
Summary
An issuer that admits OAuth clients by their client ID metadata document admitted one from any host. A server can now name the hosts.
auth.client.admit, with one setting:document_hosts, the hosts whose client documents are admitted. A host is spelled as a client ID spells it, in lower case and with:portonly when the URL names one, and is matched whole:claude.aidoes not admitsub.claude.ai. At most 64 hosts of at most 64 characters.400 invalid_clientand says that the server does not admit clients whose document that host serves; the token endpoint answers401 invalid_client.oauth.client_document_hosts(NEXTGEN_OAUTH_CLIENT_DOCUMENT_HOSTS, separated by commas) names the hosts, and the start deploys them with the platform's release, as it deploys the platform's other policies. Empty, the default, deploys no policy. A list no policy takes stops the start and names the setting.POST /policies, the policy reads,POST /policies/evaluate(input: theclient_ida client would present; nothing is fetched), the.zitadel/policies/file schemas,zitadel policy test, the Console's release view ("Client admission policy", "Admitted hosts") and the mock API.No customer project's issuer admits client documents yet, so the policy takes effect on the platform project only. A policy file for it in a customer's project is accepted, stored and pinned, and changes nothing; the docs and the CLI's skill say so.
Validation
Run in
apps/apiunless noted. All passed, on the commit before the last one:go vet ./..., and with-tags sqlite_integrationon the integration packagesgo test ./... -count=1go test -tags sqlite_integration ./internal/api/integration_test/... ./internal/storage/stmttest/... ./internal/storage/dialect/sqlite/... ./internal/bootstrap/platform/ -count=1ZITADEL_TEST_POSTGRES_URL):go test -tags postgres_integration ./internal/api/integration_test/ ./internal/storage/stmttest/ ./internal/service/ -count=1node scripts/go-lint.mjs,turbo run check-generate openapi --filter=@zitadel/server,node scripts/check-adrs-index.mjs,pnpm run check-openapi-rulesandnode scripts/check-changesets-status.mjs(repo root)turbo run lint typecheck --filter=@zitadel/config --filter=@zitadel/cli --filter=@zitadel/console --filter=@zitadel/api-mock --filter=@zitadel/components --filter=@zitadel/docsandturbo run test --filter=@zitadel/config --filter=@zitadel/api-mock --filter=@zitadel/console(repo root), and the components' unit projectpnpm exec vitest run tests/unitinapps/cli, with a UTF-8 terminal): 10,094 of 10,095 run tests passed. The one that failed,auth-method sso enable"when the schema cannot be written", makes a file read-only and cannot fail that way as root, which the container runs as; this PR does not touch it.The two commits after that changed where the server checks its host list (
cmd/server) and merged the fixes of #3488 (a network fault on a document's host). After them:go test ./internal/service/ -count=1, and before the merge:node scripts/go-lint.mjs,go vet ./..., andgo test ./cmd/... ./internal/service/ ./internal/policy/ ./internal/bootstrap/... -count=1.TestOAuthClientAdmissionPolicyruns it over HTTP from end to end: a client signs in with no policy; a policy that names its host changes nothing for it; one that names another host refuses it at the authorization endpoint, refuses its refresh, and leaves a new document on that host unfetched; an empty list admits none; a policy that sets nothing admits it again; a dry run answers the same.TestEnsureDeployedSQLiteDeploysTheClientAdmissionPolicystarts the platform bootstrap with a list of hosts, with another, and with none, and reads the policy the live release pins each time.Against a local server. Built from this branch and started with
zitadel start(NEXTGEN_OAUTH_ENABLED=true), with a client's document on a local TLS host the server was told to trust:NEXTGEN_OAUTH_CLIENT_DOCUMENT_HOSTSnaming that host: the authorization endpoint sends the client to the sign-in after one fetch of its document; the platform project holds theauth.client.admitpolicy with that host, its live release pins it, and the Console's release view shows "Client admission policy" with "Admitted hosts";claude.ai,chatgpt.com: a new release is live with those hosts; the same client is answered400 invalid_client, "this server does not admit clients whose document that host serves", with no host named, and its document is not fetched;https://claude.ai: the server stops before it serves, and its log namesoauth.client_document_hostsand says what an entry must look like.Not run: the Spanner lane locally, the e2e lanes, and a real MCP client.
After an automated review, three more commits: a code exchange asks the current deployment's policy (
TestOAuthClientAdmissionPolicysends a made-up code that names an admitting deployment and expects401 invalid_clientand no fetch), the gate has a method of its own for that (CheckCurrent), so the flow operations keep their error lists, and the mock API keeps an explicit:443as part of the host, as the server does. Run for them inapps/api:go vet ./...,go test ./... -count=1,go test -tags sqlite_integration ./internal/api/integration_test/ ./internal/api/integration_test/helpers/ ./internal/bootstrap/platform/ -count=1; and at the repo rootturbo run lint --filter=@zitadel/server, which includescheck-generate, andturbo run lint typecheck test --filter=@zitadel/api-mock.Release notes / changeset
.changeset/oauth-client-admission-policy.md— a server names the hosts whose OAuth clients it admits without registration, as the newauth.client.admitpolicy (@zitadel/server,@zitadel/api,@zitadel/config,@zitadel/cli)Notes
oauth.enabledis for the issuer itself.auth.client.admitfollowsarea.resource.verb(ADR 066). The check runs where every lookup of such a client passes, not in the write path ofauth.request.created: the token endpoint must ask too, and the fetch must wait for the answer.clientdoc.not_admitted. It is thecodeof a refused dry run. The generator lists it on the flow operations, besideclientdoc.invalid.deploy --dry-runand the file schema refuse an entry that is no host (a URL, upper case, a pattern), asPOST /policiesdoes. The policy template checks it once more for a release build and for the server's own setting.https://claude.ai/code/session_0137eGmVSt2DgYJj2CjZbi1U
Generated by Claude Code