Repository navigation
feat: store applications, their revisions and client credentials - #2900
Conversation
|
Deployment failed for project cloud with the following error: View Documentation: https://vercel.com/docs/accounts/team-members-and-roles |
🦋 Changeset detectedLatest commit: 8b832fb The changes in this PR will be included in the next version bump. This PR includes changesets to release 25 packages
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 |
e25ea61 to
d38c60d
Compare
dd070f8 to
fe6ca05
Compare
fe6ca05 to
f300f1d
Compare
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing. Review the Copilot code review billing settings.
3a7d45c to
b7879c8
Compare
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… what the application row holds Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ort every immutable field Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…tions Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ations Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…pt migrations Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
b7879c8 to
93796b3
Compare
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Replaced by a newer auto-merge request
Context
Summary
The second of three PRs for #2788. It adds the domain rules and storage for
registered applications; the service and API follow in the next PR.
ValidateApplicationDocumentchecks the rulesapplication.jsondescribes but cannot enforce:
client_idused twice in one documentrefresh_tokenonly withauthorization_codeauthorization_codehttponly onloopback hosts
ApplicationClientsToCreate(current, document)returns the slugs of theclients a write adds; on create,
currentis empty.client_id;application.field_immutablelists every case in{"fields": [...]}.client_idkeeps the one it has.client_ordcr_prefix;application.invalidlists every such client.applicationsholds what is fixed for an application's life: id, slugand creation time.
application_revisionsgets a row with the document on every write; thenewest by
created_atis the current one (ADR 063).application_clientsholds one row per client with itsclient_id,unique per project.
application_client_secretsholds each client's secret hashes, with aforeign key to the client.
ApplicationStatements:the newest revision by id or slug
client_idclient_idgets a copy of its generatedclient_*key (ADR 047 §5).
client_idfrom its row intothe stored document, including a stored client's id that the revision
leaves out, so a revision can send a generated id back unchanged.
Validation
cd apps/api && go build ./... && go test ./internal/domain/... ./internal/service/... ./internal/storage/...go test -tags {sqlite,postgres}_integration ./internal/storage/stmttest/ -run 'TestApplicationStatements|TestSchemaNullabilityMatchesDDL'go test -tags {sqlite,postgres}_integration ./internal/storage/dialect/*/migration/...(migration round trip)moon run server:generate,moon run server:check-generate-prunedRelease notes / changeset
.changeset/applications-storage.md—@zitadel/serverminor:the server stores applications, their revisions and client credentials;
the endpoints still return not implemented.
Notes
Spanner reports an empty constraint name. The service PR (feat: create, revise and read registered applications #2901) tells the
cases apart by reading state after the transaction has ended:
caller created, then checks the
client_idclient_id, and anything else isrevision_conflictapplication.invalidandapplication.field_immutable,which the domain raises. They sit in
unmappedClientCodesuntil feat: create, revise and read registered applications #2901maps them.
application.not_found,application.client_id_taken,application.permission_deniedandapplication.revision_conflictcomewith feat: create, revise and read registered applications #2901, together with their schemas and the operation text.
than one.
has its own statement because it needs the client's row id, which the
client insert sets.
any field it does not define.
applicationsfrees aclient_idand deletes theclient's secrets when an application is deleted. The PR that adds deletion
owns the contract's promise that an id once held is never reused.
statement sets the new revision id and the filled document on the entity
only after every write succeeds.
🤖 Generated with Claude Code