Repository navigation
feat: create, revise and read registered applications - #2901
Conversation
|
Deployment failed for project cloud with the following error: View Documentation: https://vercel.com/docs/accounts/team-members-and-roles |
a4f8241 to
ae3d0d5
Compare
🦋 Changeset detectedLatest commit: 0df9aa0 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 |
ae3d0d5 to
0681a39
Compare
4a5dcf5 to
6cf5d44
Compare
6cf5d44 to
63d1284
Compare
63d1284 to
71a46ee
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.
06743d0 to
d3e0207
Compare
d3e0207 to
2919220
Compare
| if err != nil { | ||
| return nil, err | ||
| } | ||
| app, err := toAPIApplicationResponse(result.Application) |
There was a problem hiding this comment.
why map the application twice? First toAPIApplicationResponse then manually to the CreateApplicationResponse.
There was a problem hiding this comment.
toAPIApplicationResponse decodes the stored document into definition, and GET uses it too. ogen generates CreateApplicationResponse and ApplicationResponse as two separate structs, because create adds client_secrets. So the second step is only a field copy between the two types. Calling the helper keeps the decode in one place.
There was a problem hiding this comment.
but why do the intermediate step, it does not seem to contain any logic except unmarshaling the document
…_denied and revision_conflict errors 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>
… service Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…n and IdP services Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ey text 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 Fable 5.2 <noreply@anthropic.com>
…ation call Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
a5dd376 to
8a90f84
Compare
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…orm project main gained registered applications (#2901). An application's clients sign people in to its project, so on the reserved platform project one is configuration, as an origin is: applicationAccess sets `configuration`, and createApplication there asks for the admin role (D42, Console ADR 0004 §1, ADR 082). The gate contract's table still lists createApplication as not implemented, so its rows did not show the new resource. The platform test now reads the resources the gate declares from its source, so one without a row in the table has to be classed too, and it holds createApplication with a row of its own until the table has one. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Context
Summary
The third of three PRs for #2788. It adds the service layer and the API
wiring of
POST /applicationsandGET /applications/{id}.CreateOrRevisechecks the document againstapplication.jsonand therules of
ValidateApplicationDocument.revises it otherwise.
transaction, so two concurrent revisions cannot both treat the same
client as new.
Getreturns the newest revision.secrets.Generator(
sk_client_+ 32 base62 characters).domain.HashSecretis stored inapplication_client_secrets, in thesame transaction as the client.
client_secrets, with the client's slugand
client_id.client_secrets.application.createdwithslug,name,client_idsandrevision_id.application.updatedwithrevision_id,namewhen itchanged, and the
client_idsthe revision added.client_idslists the clients the write created, each of which got asecret.
loses the slug race emits only the update.
are part of this PR.
ended:
application, that application is revised. Otherwise a supplied
client_idthat another client holds isapp.client_id_taken.client_idisclient_id_taken, anything elseapp.revision_conflict.app.invalid,app.field_immutable,app.not_found,app.client_id_taken,app.permission_deniedandapp.revision_conflict, with their schemas, examples and status mapping(400, 400, 404, 409, 403, 409). The operation text lists them.
ResourceKindApplicationIdempotency-Keyis accepted but not used yet; the operation text saysso.
Validation
cd apps/api && go build ./... && go test ./internal/service/... ./internal/api/... ./internal/domain/... ./internal/audit/... ./api/cmd/gen_event_schemas/ ./cmd/...go test -tags {sqlite,postgres}_integration ./internal/api/integration_test/ -run 'TestCreateApplication|TestApplicationAccess'moon run server:generate,moon run server:openapi,moon run server:check-generate-prunedRelease notes / changeset
.changeset/applications-service.md—@zitadel/serverminor:POST /applicationscreates or revises an application and returns eachnew client's secret once, and
GET /applications/{id}returns its newestrevision. Each write records an
application.createdorapplication.updatedevent.Idempotency-Keyis accepted but not usedyet.
Notes
main.of feat(api): add the applications contract #2888 and feat: store applications, their revisions and client credentials #2900, and from the API reference card.
Idempotency-Keysecretfield (Applications: declared applications in releases #2790)🤖 Generated with Claude Code