Skip to content

feat: add apps with their OAuth clients and APIs, and zitadel apps create - #2452

Closed
fforootd wants to merge 12 commits into
mainfrom
claude/apps-model-25449c
Closed

fforootd wants to merge 12 commits into
mainfrom
claude/apps-model-25449c

Conversation

@fforootd

@fforootd fforootd commented Oct 29, 2026 •

Copy link
Copy Markdown
Member

Context

Summary

  • One app document holds an app's clients, the APIs it serves (MCP servers among them) and whether clients may register into it. It is a file in the release (.zitadel/apps/<slug>.json) and the body of POST /apps, with one JSON Schema per config kind, generated from the OpenAPI YAML and shipped into .zitadel/meta/. The document keeps the fields, never the preset.
  • Clients state their type and take RFC 7591's grant_types. A public client signs users in; a confidential client without grant_types holds only credentials. A client_id is minted (client_…) or chosen in the document (v4 imports, known clients), fixed for life and never reused.
  • Credentials are a resource of their own: named secrets and keys under /apps/{id}/clients/{client}/credentials, for declared and registered apps alike, each revoked on its own, and a deploy never removes one. They belong to the client's row, so a client a newer revision removes keeps them revocable while older deployments still accept them, and a kid names one key of a client, in its file or through the API. A declared client may still name a ${{ NAME }} secret or carry jwks in its file. Generated secrets take the format of docs: propose apps, machine identities and client credentials #2430 (zcs_, base62, CRC32 checksum); an imported v4 bcrypt hash is rehashed to SHA-256 on its first match.
  • Scopes are refused, never dropped: a scope neither built in nor defined by the API is invalid_scope.
  • Storage on Postgres, SQLite and Spanner, revisioned like IdP connections (ADR 063), plus client ids, API identifiers and credentials that outlive revisions.
  • API: POST /apps creates or revises a registered app by slug; POST /apps/query, GET /apps/{id} and the revision reads return it; the credentials endpoints add, list and revoke. app.* audit events are written in the same transaction.
  • Releases: .zitadel/apps/ rides the bundle and the deploy diff, and each deployment serves the revision its release pins. A release and the API never write each other's apps.
  • Clients that register themselves (RFC 7591) are stored per project under a dcr_… client_id, keep the name, logo and links they claim, and join the app whose API their first authorization request names; another app's API is then refused. Each registration purges a batch of the project's expired ones, and the authorization server's consents keep a registration alive or go with it on delete, in the same transaction, through ClientRegistrationConsents.
  • AppDirectory is the lookup the authorization server uses: clients, APIs, secret checks, ClientKeys for private_key_jwt (each key once), registrations and JoinClientRegistration, and Registration(at).
  • CLI: zitadel apps create <slug> --preset <preset> writes the app file from one of eight presets in @zitadel/config/app, or registers the app with --registered; zitadel apps list|get and zitadel client-registrations list|get|delete.
  • Design write-up: docs/design/api/apps.md.

Validation

  • go test -count=1 ./... in apps/api
  • go test -count=1 -tags sqlite_integration ./... in apps/api
  • Against a local Postgres 18: go test -count=1 -p 1 -tags postgres_integration ./internal/storage/stmttest/ ./internal/api/integration_test/... ./internal/bootstrap/...
  • go vet -tags {sqlite,postgres,spanner}_integration ./...
  • moon run server:openapi, moon run server:check-generate-pruned, moon run cli:lint config:lint
  • vitest run in packages/config (540 tests) and vitest run tests/unit in apps/cli (280 files, 4937 tests)
  • moon run docs:e2e for the docs site's contract suite (45 passed)
  • Not run locally: the Spanner lane (no Docker here).

Release notes / changeset

  • Changeset: .changeset/apps-one-document.md — apps as one document, their credentials, POST /apps, declared apps in releases, stored client registrations, zitadel apps create, zitadel client-registrations and the presets (@zitadel/server, @zitadel/cli, @zitadel/config minor).

Notes

  • A prototype for review. Merged with main after docs: propose users, apps and connections as the identity model #2445; feat: align apps with the identity model is the change the model asked for, and the Apps page fixes the docs preview.
  • internal/oauth is untouched; feat: sign in to a server as yourself with zitadel login, for the CLI and MCP clients #2451 replaces its PlatformApp() lookups with AppDirectory and builds on this PR's documents and stored registrations.
  • One writer per app: POST /apps refuses a slug a release declares (app.declared), and a release refuses a slug the API registered.
  • Left for later, with grants for clients: PATs for clients, app create --role, introspection.clients on an API, and team-owned apps. SAML and SCIM configs are designed, not built.
  • The server wires service.NoConsents{} until feat: sign in to a server as yourself with zitadel login, for the CLI and MCP clients #2451's authorization server stores consents.
  • The migrations this PR adds were changed in place (alpha, unmerged); a preview database created from an earlier push needs dropping.
  • orval (8.42 and 8.46) writes some members of the events union without their base fields, depending on how many events there are and where they sit. This PR's 50 events generate whole; adding one can break the CLI's events typecheck again.

🤖 Generated with Claude Code

fforootd and others added 4 commits October 28, 2026 19:35
Decides what the app document holds (clients, APIs, registration; one JSON
Schema per config kind), who picks a client_id, how scopes and audiences are
refused rather than dropped, the storage and API, how a release declares an
app, and the directory the authorization server reads. Lifetimes and claim
mappings move to token-issuance policies (ADR 066); SAML IdP and SCIM
provisioning configs, the console's filtered lists and the presets are
designed here and not yet built.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
One app document holds an app's OAuth and OIDC clients, the APIs it serves
and whether clients may register into it.

- Schemas: app.json with one schema per config kind, generated from the
  OpenAPI YAML, shipped into .zitadel/meta/.
- Domain: the rules the schema cannot state (slugs, references, redirect
  URIs, identifiers, public and confidential clients), and the scope rules:
  an unknown or disallowed scope is invalid_scope, never dropped.
- Storage on Postgres, SQLite and Spanner: apps and revisions like IdP
  connections, plus client ids, API identifiers and secret hashes that
  outlive revisions. A client keeps a minted or chosen client_id for life.
- API: POST /apps (create or revise a registered app), query, get, revision
  reads, and client secrets (generated, or imported, v4 bcrypt included).
- Releases: .zitadel/apps/ rides the bundle as declared apps, pinned per
  release; a release and the API never write each other's apps.
- AppDirectory: the lookup the authorization server would use, serving each
  deployment the revision its release pins.
- CLI: `zitadel apps create --preset` writes the app file from one of eight
  presets in @zitadel/config/app, or registers it with --registered;
  `apps list` and `apps get`.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Part A (the authorization server) agreed to the AppDirectory shape and asked
for the fields it decides with: a client's consent policy and account
choice, the display fields a client ID metadata document carries, public
keys for private_key_jwt, and an optional ES256 signing algorithm for ID
tokens and access tokens. A private_key_jwt client gets no generated secret
and takes none.

The design note classifies an app's records by the user's three kinds of
data (configuration aside: stateful users, transient sessions and consent,
events as audit only), records what part A agreed, including stored
dynamically registered clients, and no longer feeds the SCIM engine from
audit events.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Part A's follow-up on the stored dynamically registered clients: an unused
registration expires after a short lifetime of its own, a registration keeps
its RFC 7591 display fields as the client's own claims, and deleting one
deletes its consents and their tokens in the same transaction.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@vercel

vercel Bot commented Oct 29, 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 Nov 4, 2026 1:18am UTC

Request Review

@github-actions

github-actions Bot commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

🦋 Changeset detected

Latest commit: 68c2ab9

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

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

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

Dynamically registered clients (RFC 7591) are stored instead of sealed into
their client_id, so they can be listed and revoked one by one, as agreed
with the authorization server's session.

- Domain: a registration's metadata (RFC 7591 names) and its rules: public
  or a generated secret, the code grant with refresh, redirect URIs under
  the app client rules, display text without control or bidi controls.
  AccessTo allows a third_party API of an app that opens dynamic
  registration. A chosen app client_id may not take the dcr_ form.
- Storage on Postgres, SQLite and Spanner: client_registrations, keyed by
  the minted dcr_ client_id, with expires_at.
- Service: Register (called by POST /register), Get, List, Delete. Each
  registration purges a batch of the project's expired ones; the
  authorization server's consents keep a registration (Named) and go with
  it on delete (Delete), in the same transaction, behind
  ClientRegistrationConsents. NoConsents until it stores consents.
- AppDirectory: ClientRegistration, VerifyClientRegistrationSecret, and
  Registration(at), the switches the apps serving a deployment turn on.
- API and CLI: POST /client_registrations/query, GET and DELETE
  /client_registrations/{id}; zitadel client-registrations list, get and
  delete. Events client_registration.created and .deleted.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
fforootd and others added 3 commits November 3, 2026 10:58
Resolve the conflicts with main's move of the Go module into apps/api
(#2271), the server stubs in apps/api/internal/api/generated with the client
in packages/go/api (#2273), the CLI's typed resource registry and next
steps (#2523), and the session scheme now named sessionCookie.

- Move the apps and client registration endpoints and the appstore package
  under apps/api, where git's rename detection did not take them.
- Renumber the Spanner migrations to 000043_apps.sql and
  000044_client_registrations.sql: main took 000042.
- Write the apps and client-registrations registry entries with
  resource(), list() and get(), and give each query its own filter
  operations, as the other entries do.
- Regenerate the server stubs, the Go client and the event schemas.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The identity model (docs/design/api/identity-model.md) merged; this brings
the app document, its credentials and registered clients in line with it.

- grant_types replaces grants, with RFC 7591's name and values, and is
  optional: a confidential client without it holds only credentials, and
  takes no redirect URIs or APIs. A public client needs authorization_code.
- The document keeps the fields, never the preset; the service-account
  preset is now service, ADR 082's kind.
- Credentials are a resource of their own: named secrets and keys under
  /apps/{id}/clients/{client}/credentials, for declared clients too, each
  revoked on its own and never removed by a deploy. auth_method goes: a
  client authenticates with whatever it holds, a declared ${{ NAME }} or
  jwks included. A registered app's new confidential client still gets an
  initial secret, shown once. Generated secrets take #2430's format, with a
  base62 CRC32 the server checks before hashing. app.credential.added and
  app.credential.revoked replace app.client_secret.added.
- A dynamically registered client joins the app whose API its first
  authorization request names (JoinClientRegistration), and is refused
  every other app's API; the API and CLI show and filter by that app.
- AppDirectory.ClientKeys returns a client's keys for private_key_jwt.
- A domain error that wraps a unique violation keeps its code, so a taken
  client_id or credential name is no longer reported as a revision
  conflict.
- apps create --registered no longer sends the preset's secret reference,
  which the server refuses for a registered app.
- Biome formatting for the CLI and config files CI flagged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The Apps tag had operations but no page of its own, so the docs site's
contract suite found operation pages no tag page linked, and links to a page
that did not answer. Also refuse importing a secret in the generated form
whose checksum fails: verification turns it away before any hash runs, so it
could never authenticate.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ames

- List and revoke a client's credentials by its row, which outlives
  revisions: a client a newer revision removed keeps credentials that a
  deployment pinning an older revision still accepts. Only a client the
  newest revision has takes a new one.
- A kid names one key per client. A revision whose jwks gives a stored
  key's kid to another key is refused (app.credential_taken, now also from
  POST /apps and release builds), and so is a key written through the API
  under a kid that any revision of a declared app gives another key. The
  same key in both places is one key, which ClientKeys lists once.
- zitadel deploy diffs .zitadel/apps/, which the bundle publishes.
- A preset's secret variable for a slug that starts with a digit takes a
  leading underscore, since a variable name may not start with one.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

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.

Note

Copilot was unable to complete this review at the selected tier due to model policy or plan restrictions.

🟡 Changes recommended

The change still has a moderate active issue where EnsureClientRegistrationListOptions does not actually append an id tiebreaker when a caller provides an explicit sort, which can lead to non-deterministic ordering and unstable keyset pagination when sort keys collide.

1 open issue
What changed in this PR

This pull request introduces “Apps” as a first-class, revisioned document that can be declared in releases (.zitadel/apps/<slug>.json) or registered via API, encapsulating OAuth/OIDC clients, served APIs, registration settings, and a credential lifecycle, with corresponding storage, OpenAPI/schema generation, CLI support, audit events, and documentation.

Changes:

  • Adds Apps + Client Registrations API surface (OpenAPI, generated Go client/server code, handlers, authz scopes, events/webhooks).
  • Adds multi-dialect storage support (Postgres/SQLite/Spanner) with migrations and pagination-related tests.
  • Extends release bundling/build/deploy to carry declared app documents; adds CLI commands and config presets/meta-schemas; updates docs.

Key review notes (unresolved):

  • Moderate: OpenAPI enum for apps query filter/sort includes a value (source) that is documented as filter-only, while server-side sorting rejects it (schema/codegen mismatch).
  • Moderate: OpenAPI enum for client registrations filter/sort includes a value (app) that is documented as filter-only, while server-side sorting rejects it (schema/codegen mismatch).
  • Moderate: Client registration listing options do not consistently add a deterministic id tiebreaker when an explicit sort is provided, risking unstable ordering/keyset pagination.
  • Nit: Go formatting issue in integration test helper due to non-gofmt method-chaining line breaks.
  • Nit: App bundle validation reuses an IdP-specific slug helper name (IDPDocumentSlug), which is misleading for apps.

Approval Readiness

This pull request requires changes.

File Notes
packages/​go/​api/​oas_request_encoders_gen.go Reviewed
packages/​go/​api/​oas_operations_gen.go Reviewed
packages/​go/​api/​oas_interfaces_gen.go Reviewed
packages/​go/​api/​oas_defaults_gen.go Reviewed
packages/​config/​tsdown.config.ts Reviewed
packages/​config/​src/​meta-schemas.ts Reviewed
packages/​config/​src/​meta-schemas.test.ts Reviewed
packages/​config/​src/​app/​presets.test.ts Reviewed
packages/​config/​src/​app/​index.ts Reviewed
packages/​config/​package.json Reviewed
docs/​design/​api/​README.md Reviewed
docs/​design/​api/​events-catalog.md Reviewed
docs/​adrs/​047-dialect-id-generation.md Reviewed
apps/​docs/​content/​docs/​reference/​api/​meta.json Reviewed
apps/​docs/​content/​docs/​reference/​api/​apps/​index.mdx Reviewed
apps/​cli/​tests/​unit/​lib/​release/​git.test.ts Reviewed
apps/​cli/​tests/​unit/​lib/​release/​bundle.test.ts Reviewed
apps/​cli/​tests/​unit/​commands/​resources.test.ts Reviewed
apps/​cli/​tests/​unit/​commands/​help.test.ts Reviewed
apps/​cli/​tests/​unit/​commands/​app-create.test.ts Reviewed
apps/​cli/​tests/​unit/​commands/​api-coverage.test.ts Reviewed
apps/​cli/​src/​lib/​release/​git.ts Reviewed
apps/​cli/​src/​lib/​release/​bundle.ts Reviewed
apps/​cli/​src/​lib/​app/​index.ts Reviewed
apps/​cli/​src/​index.ts Reviewed
apps/​cli/​skills/​zitadel-cli/​SKILL.md Reviewed
apps/​cli/​package.json Reviewed
apps/​api/​internal/​storage/​stmttest/​schema_nullability_test.go Reviewed
apps/​api/​internal/​storage/​stmttest/​cursor_battle_test.go Reviewed
apps/​api/​internal/​storage/​stmttest/​cursor_battle_apps_test.go Reviewed
apps/​api/​internal/​storage/​dialect/​sqlite/​statement.go Reviewed
apps/​api/​internal/​storage/​dialect/​sqlite/​migration/​sql/​000027_client_registrations.sql Reviewed
apps/​api/​internal/​storage/​dialect/​spanner/​statement.go Reviewed
apps/​api/​internal/​storage/​dialect/​spanner/​migration/​sql/​000044_client_registrations.sql Reviewed
apps/​api/​internal/​storage/​dialect/​postgres/​statement.go Reviewed
apps/​api/​internal/​storage/​dialect/​postgres/​migration/​sql/​000040_client_registrations.sql Reviewed
apps/​api/​internal/​storage/​appstore/​schema.go Reviewed
apps/​api/​internal/​storage/​appstore/​client_registration.go Reviewed
apps/​api/​internal/​service/​release.go Reviewed
apps/​api/​internal/​service/​release_test.go Reviewed
apps/​api/​internal/​service/​release_build_test.go Reviewed
apps/​api/​internal/​service/​deployment_variables.go Reviewed
apps/​api/​internal/​domain/​schema_validator.go Reviewed
apps/​api/​internal/​domain/​releasepointerkind_enumer.go Reviewed
apps/​api/​internal/​domain/​release.go Reviewed
apps/​api/​internal/​domain/​event.go Reviewed
apps/​api/​internal/​domain/​event_payload.go Reviewed
apps/​api/​internal/​domain/​bundle_shape.go Reviewed
apps/​api/​internal/​domain/​authz.go Reviewed
apps/​api/​internal/​bootstrap/​platform/​deploy_sqlite_test.go Reviewed
apps/​api/​internal/​audit/​catalog_producers_test.go Reviewed
apps/​api/​internal/​api/​release.go Reviewed
apps/​api/​internal/​api/​integration_test/​helpers/​server.go Reviewed
apps/​api/​internal/​api/​integration_test/​helpers/​release.go Reviewed
apps/​api/​internal/​api/​integration_test/​client_registration_test.go Reviewed
apps/​api/​internal/​api/​handler.go Reviewed
apps/​api/​internal/​api/​generated/​oas_operations_gen.go Reviewed
apps/​api/​internal/​api/​generated/​oas_interfaces_gen.go Reviewed
apps/​api/​internal/​api/​generated/​oas_defaults_gen.go Reviewed
apps/​api/​internal/​api/​error_handler.go Reviewed
apps/​api/​internal/​api/​client_registration.go Reviewed
apps/​api/​internal/​api/​authz.go Reviewed
apps/​api/​cmd/​server/​server.go Reviewed
apps/​api/​api/​openapi/​security/​oauth2.yaml Reviewed
apps/​api/​api/​openapi/​openapi-spec.yaml Reviewed
apps/​api/​api/​openapi/​endpoints/​schemas/​app.yaml Reviewed
apps/​api/​api/​openapi/​endpoints/​schemas/​app.json Reviewed
apps/​api/​api/​openapi/​endpoints/​schemas/​app-registration.yaml Reviewed
apps/​api/​api/​openapi/​endpoints/​schemas/​app-registration.json Reviewed
apps/​api/​api/​openapi/​endpoints/​schemas/​app-client-jwk.yaml Reviewed
apps/​api/​api/​openapi/​endpoints/​schemas/​app-client-api.yaml Reviewed
apps/​api/​api/​openapi/​endpoints/​schemas/​app-api.yaml Reviewed
apps/​api/​api/​openapi/​endpoints/​schemas/​app-api.json Reviewed
apps/​api/​api/​openapi/​endpoints/​schemas/​app-api-scope.yaml Reviewed
apps/​api/​api/​openapi/​endpoints/​releases/​build/​configuration-bundle.yaml Reviewed
apps/​api/​api/​openapi/​endpoints/​releases/​build/​buildRelease-error-response.yaml Reviewed
apps/​api/​api/​openapi/​endpoints/​events/​webhooks/​client_registration-deleted.yaml Reviewed
apps/​api/​api/​openapi/​endpoints/​events/​webhooks/​client_registration-created.yaml Reviewed
apps/​api/​api/​openapi/​endpoints/​events/​webhooks/​app-updated.yaml Reviewed
apps/​api/​api/​openapi/​endpoints/​events/​webhooks/​app-credential-revoked.yaml Reviewed
apps/​api/​api/​openapi/​endpoints/​events/​webhooks/​app-credential-added.yaml Reviewed
apps/​api/​api/​openapi/​endpoints/​events/​webhooks/​app-created.yaml Reviewed
apps/​api/​api/​openapi/​endpoints/​events/​types/​client_registration-deleted-event.yaml Reviewed
apps/​api/​api/​openapi/​endpoints/​events/​types/​client_registration-created-event.yaml Reviewed
apps/​api/​api/​openapi/​endpoints/​events/​types/​app-updated-event.yaml Reviewed
apps/​api/​api/​openapi/​endpoints/​events/​types/​app-credential-revoked-event.yaml Reviewed
apps/​api/​api/​openapi/​endpoints/​events/​types/​app-credential-added-event.yaml Reviewed
apps/​api/​api/​openapi/​endpoints/​events/​types/​app-created-event.yaml Reviewed
apps/​api/​api/​openapi/​endpoints/​events/​payloads/​client-registration-payload.yaml Reviewed
apps/​api/​api/​openapi/​endpoints/​events/​payloads/​app-payload.yaml Reviewed
apps/​api/​api/​openapi/​endpoints/​events/​payloads/​app-credential-payload.yaml Reviewed
apps/​api/​api/​openapi/​endpoints/​events/​event.yaml Reviewed
apps/​api/​api/​openapi/​endpoints/​client_registrations/​query/​queryClientRegistrations-error-response.yaml Reviewed
apps/​api/​api/​openapi/​endpoints/​client_registrations/​query/​query-client-registrations-response.yaml Reviewed
apps/​api/​api/​openapi/​endpoints/​client_registrations/​query/​query-client-registrations-request.yaml Reviewed
apps/​api/​api/​openapi/​endpoints/​client_registrations/​query/​methods.yaml Reviewed
apps/​api/​api/​openapi/​endpoints/​client_registrations/​query/​client-registration-filter-field.yaml Reviewed
apps/​api/​api/​openapi/​endpoints/​client_registrations/​client-registration-response.yaml Reviewed
apps/​api/​api/​openapi/​endpoints/​client_registrations/​by_id/​methods.yaml Reviewed
apps/​api/​api/​openapi/​endpoints/​client_registrations/​by_id/​getClientRegistrationById-error-response.yaml Reviewed
apps/​api/​api/​openapi/​endpoints/​client_registrations/​by_id/​deleteClientRegistration-error-response.yaml Reviewed
apps/​api/​api/​openapi/​endpoints/​apps/​revisions/​by_id/​methods.yaml Reviewed
apps/​api/​api/​openapi/​endpoints/​apps/​revisions/​by_id/​getAppRevisionById-error-response.yaml Reviewed
apps/​api/​api/​openapi/​endpoints/​apps/​query/​queryApps-error-response.yaml Reviewed
apps/​api/​api/​openapi/​endpoints/​apps/​query/​query-apps-response.yaml Reviewed
apps/​api/​api/​openapi/​endpoints/​apps/​query/​query-apps-request.yaml Reviewed
apps/​api/​api/​openapi/​endpoints/​apps/​query/​methods.yaml Reviewed
apps/​api/​api/​openapi/​endpoints/​apps/​query/​app-filter-field.yaml Reviewed
apps/​api/​api/​openapi/​endpoints/​apps/​createApp-error-response.yaml Reviewed
apps/​api/​api/​openapi/​endpoints/​apps/​create-app-request.yaml Reviewed
apps/​api/​api/​openapi/​endpoints/​apps/​by_id/​revisions/​methods.yaml Reviewed
apps/​api/​api/​openapi/​endpoints/​apps/​by_id/​revisions/​listAppRevisions-error-response.yaml Reviewed
apps/​api/​api/​openapi/​endpoints/​apps/​by_id/​revisions/​list-app-revisions-response.yaml Reviewed
apps/​api/​api/​openapi/​endpoints/​apps/​by_id/​methods.yaml Reviewed
apps/​api/​api/​openapi/​endpoints/​apps/​by_id/​getAppById-error-response.yaml Reviewed
apps/​api/​api/​openapi/​endpoints/​apps/​by_id/​clients/​by_slug/​credentials/​methods.yaml Reviewed
apps/​api/​api/​openapi/​endpoints/​apps/​by_id/​clients/​by_slug/​credentials/​listAppClientCredentials-error-response.yaml Reviewed
apps/​api/​api/​openapi/​endpoints/​apps/​by_id/​clients/​by_slug/​credentials/​list-app-client-credentials-response.yaml Reviewed
apps/​api/​api/​openapi/​endpoints/​apps/​by_id/​clients/​by_slug/​credentials/​by_id/​revokeAppClientCredential-error-response.yaml Reviewed
apps/​api/​api/​openapi/​endpoints/​apps/​by_id/​clients/​by_slug/​credentials/​by_id/​methods.yaml Reviewed
apps/​api/​api/​openapi/​endpoints/​apps/​by_id/​clients/​by_slug/​credentials/​addAppClientCredential-error-response.yaml Reviewed
apps/​api/​api/​openapi/​endpoints/​apps/​by_id/​clients/​by_slug/​credentials/​add-app-client-credential-request.yaml Reviewed
apps/​api/​api/​openapi/​endpoints/​apps/​app-response.yaml Reviewed
apps/​api/​api/​openapi/​endpoints/​apps/​app-client-secret.yaml Reviewed
apps/​api/​api/​openapi/​endpoints/​apps/​app-client-id.yaml Reviewed
apps/​api/​api/​openapi/​endpoints/​apps/​app-client-credential.yaml Reviewed
apps/​api/​api/​openapi/​components/​schemas/​errors/​app-revision_conflict.yaml Reviewed
apps/​api/​api/​openapi/​components/​schemas/​errors/​app-permission_denied.yaml Reviewed
apps/​api/​api/​openapi/​components/​schemas/​errors/​app-not_found.yaml Reviewed
apps/​api/​api/​openapi/​components/​schemas/​errors/​app-invalid.yaml Reviewed
apps/​api/​api/​openapi/​components/​schemas/​errors/​app-invalid_scope.yaml Reviewed
apps/​api/​api/​openapi/​components/​schemas/​errors/​app-identifier_taken.yaml Reviewed
apps/​api/​api/​openapi/​components/​schemas/​errors/​app-field_immutable.yaml Reviewed
apps/​api/​api/​openapi/​components/​schemas/​errors/​app-declared.yaml Reviewed
apps/​api/​api/​openapi/​components/​schemas/​errors/​app-credential_taken.yaml Reviewed
apps/​api/​api/​openapi/​components/​schemas/​errors/​app-credential_not_found.yaml Reviewed
apps/​api/​api/​openapi/​components/​schemas/​errors/​app-client_secret_invalid.yaml Reviewed
apps/​api/​api/​openapi/​components/​schemas/​errors/​app-client_registration_other_app.yaml Reviewed
apps/​api/​api/​openapi/​components/​schemas/​errors/​app-client_registration_not_found.yaml Reviewed
apps/​api/​api/​openapi/​components/​schemas/​errors/​app-client_registration_invalid.yaml Reviewed
apps/​api/​api/​openapi/​components/​schemas/​errors/​app-client_not_found.yaml Reviewed
apps/​api/​api/​openapi/​components/​schemas/​errors/​app-client_id_taken.yaml Reviewed
apps/​api/​api/​openapi/​components/​schemas/​errors/​app-api_not_found.yaml Reviewed
apps/​api/​api/​openapi/​components/​parameters/​client-registration-id.yaml Reviewed
apps/​api/​api/​openapi/​components/​parameters/​app-revision-id.yaml Reviewed
apps/​api/​api/​openapi/​components/​parameters/​app-id.yaml Reviewed
apps/​api/​api/​openapi/​components/​parameters/​app-client-slug.yaml Reviewed
apps/​api/​api/​openapi/​components/​parameters/​app-client-credential-id.yaml Reviewed
apps/​api/​api/​cmd/​gen_event_schemas/​main.go Reviewed
apps/​api/​api/​cmd/​gen_event_schemas/​main_test.go Reviewed
.redocly.lint-ignore.yaml Reviewed
.changeset/​apps-one-document.md Reviewed

Review effort: Balanced

Comment on lines +49 to +59
out := *opts
if len(out.Pagination.OrderBy.Columns) == 0 {
out.Pagination.OrderBy = database.OrderBy[domain.ClientRegistrationField]{
Columns: []database.Column[domain.ClientRegistrationField]{
database.Col(domain.ClientRegistrationFieldCreatedAt),
database.Col(domain.ClientRegistrationFieldID),
},
Direction: database.OrderAsc,
}
}
return &out

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

The comment over-claimed: like the other stores' helpers, this one only sets the default. The service's listOrderBy already ends every sort with id, so expires_at pages as [expires_at, id]. In f43747f the comment now says so, and a new unit test, TestClientRegistrationService_List_EndsTheSortWithID, proves it.

🤖 Addressed by Claude Code

The storage helper's comment said it appended an id tiebreak after a
caller's order; like the other stores' helpers, it only sets the default.
The service's list sort ends every order with id, so a sort by expires_at
already pages stably; a unit test now proves it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
fforootd and others added 2 commits November 3, 2026 17:07
Main's #2638 gave every command one lifecycle: BaseCommand.run admits the
flags and calls execute, flags are read camelCase, and a value is refused
by its own flag. apps create still overrode run, so the merged tree failed
cli:typecheck and cli:lint.

The command now does its work in execute. The slug, --redirect-uri and
--identifier refuse a bad value as they parse, and the prompts hold an
answer to the same URI rule. The file conflict is a Refusal on execute's
first line.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
fforootd added a commit that referenced this pull request Nov 4, 2026
#2452 adds apps and client registrations as Postgres 39/40, SQLite 26/27
and Spanner 43/44, the numbers this branch used. This PR stacks on it, so
its consents and signing key migrations follow: Postgres 41/42, SQLite
28/29, Spanner 45/46.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
fforootd added a commit that referenced this pull request Nov 4, 2026
This PR now builds on #2452's apps, client registrations and
AppDirectory, so the authorization server can read its clients from them.

Resolved:
- security/oauth2.yaml keeps this branch's scheme, a person's token by
  the authorization code flow. #2452's operations take the pat scheme
  with their scopes and the person's token too, as every operation
  outside the app plane does here.
- The handler wiring takes both sides' services: apps and client
  registrations, consents and authorization requests.
- The event lists hold both sides' events (52), in the generator's order.
- The root help lists login, whoami and logout at the wider column
  client-registrations needs; the command reference gains --credential
  on apps and client-registrations.
- Generated code is regenerated: server:generate, the service mocks.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@fforootd
fforootd added this pull request to stack #2694 November 4, 2026 01:33
fforootd added a commit that referenced this pull request Nov 4, 2026
…irectory

The platform project's authorization server now finds the client and the
API a request names the way a customer's will: through AppDirectory, with
the zitadel app as a built-in app beside the project's stored ones.

- POST /register writes through ClientRegistrationService: a dcr_ client
  instead of a sealed one, which joins the app whose API its first
  authorization request names and is held to it. The consents implement
  ClientRegistrationConsents, so a live consent keeps a registration past
  its hour and deleting one deletes its consents and their tokens.
- What a client may get comes from its document (AccessTo, GrantScopes),
  and its consent policy and grant types decide the consent step and the
  grants the token endpoint takes.
- As agreed with #2452: a request names its API as resource, and a scope
  the API does not define is invalid_scope, no longer dropped.
- Confidential clients stay unknown until the token endpoint authenticates
  clients; the directory reads apps at their newest revision.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@wim07101993 wim07101993 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I went over the api contract (only the contract) in a first sweep and have some initial comments/questions

I think it would be useful to specify defaults in the api contract. Right now docs sometimes say: "value is x when left out" but the contract can specify these directly.

maxItems: 20
items:
$ref: app-api.yaml
description: The APIs the app serves, MCP servers among them.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

What is the difference between the APIs in clients and here?
Whay make it separate entries?

https://github.com/zitadel/nextgen/pull/2452/changes#diff-2f90d5daefd88b34049765e9fb21f7cabc151310580691c18066e1ed4bd7d7d5R59

maxLength: 2048
description: The app's logo, shown on the consent and account-choice screens. The display fields
are those a client ID metadata document carries (RFC 7591), so the screens read both alike.
client_uri:

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Do we want to commit to a fixed set of links? In v4 there were requests for the login screen to modify the links. This is not the login screen, but is that a request we want to anticipate for the consent screen in nextgen?

minLength: 1
maxLength: 2048
description: Where RP-initiated logout may send the user afterwards, matched exactly.
first_party:

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

why have a separate flag for this while the same can be achieved using the consent indicator?

title: AppRegistration
description: |
How clients may join the app on their own. A client that registers names no app: the app is the one
whose API its first authorization request names as `resource`, and the client may ask only for that

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Could this be an attack surface? A small one if so.

It also feels dirty to have an authorization request modify the client/app it is for.

properties:
slug:
type: string
pattern: ^[a-z0-9][a-z0-9_-]*$

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

maybe slugs should be a separate type in the openapi.

description: The client_id of each client the document lists, in its order.
items:
$ref: app-client-id.yaml
client_secrets:

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

why expose the credentials? And if they should be exposed, why not put them under clients?

content:
application/json:
schema:
$ref: add-app-client-credential-request.yaml

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

To make it clear this is either a client-secret or a prublic key, maybe we can use a oneof with dedicated payloads?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

As a consumer of the api it might be confusing to have both an app-client-credential type and a app-client-secret type.

type: string
description: Names the credential, unique among the client's credentials.
example: ci-2026-11
kind:

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

instead of having a kind, we could use two different types

x-zitadel-cli: client-registrations get
summary: Get a client registration
description: |
Reads a client that registered itself through dynamic client registration,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Why read dynamically registered clients in a separate endpoint? When an DR-client has not made an authorization request yet, it does not yet exist under an app. But having a separate endpoint for specifically those clients, feels wierd.

Maybe have a clients endpoint which surfaces all clients? And have the apps endpoint reference it?

peintnermax added a commit that referenced this pull request Nov 6, 2026
#2785 settles Application as the name and takes #2452 as a reference only,
so those two stop being open questions. The note now also records that
#2785 and #2794/#2795 disagree on PKCE and `iss`, that `application create`
deploys nothing and the developer sets a declared client's secret, and asks
whether `application create` turns the issuer on.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@fforootd fforootd closed this Nov 16, 2026
@github-project-automation github-project-automation Bot moved this from Inbox to Done in Engineering Kanban Nov 16, 2026

This branch was successfully deployed

1 active deployment
Preview — 68c2ab9a Deployed Nov 4, 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

Archived in project

Development

Successfully merging this pull request may close these issues.

3 participants