Files
iam/internal/applications/zipdoc_gen.go
zooqueenandHanzo Dev 484922ec8b applications: only a SuperAdmin writes an application that serves other orgs
An application serves every org when it is shared or offers an org choice
(orgChoiceMode other than "" and "None"). Create and Update refuse a
non-SuperAdmin any such write -- making one, editing one, or confining one --
through one gate, authorizeSpan, on schema.Application.Spans.

Tenant isolation reads ServesAnyOrg, which also requires the platform to own
the row (Owner "admin"). A row any other org owns serves that org alone,
whatever it declares, so the code mint, the password grant, impersonation,
device approval and federation cross tenants only through a platform
application.

The seed files an owner-less application under the owner its key names.
Regenerates the internal/tokens zipdoc.

Co-authored-by: Hanzo Dev <[email protected]>
2026-10-14 23:38:53 -07:00

78 lines
16 KiB
Go

// Code generated by zipdoc; DO NOT EDIT.
package applications
import (
"github.com/zap-proto/zip"
)
func init() {
zip.Describe("github.com/hanzoai/iam/internal/applications DELETE /v1/iam/applications/:owner/:name", zip.Doc{
Description: "Removes an application. Anyone mid-sign-in through it is\nturned away and its client credentials stop working, so retire the integration\nbefore deleting it.",
})
zip.Describe("github.com/hanzoai/iam/internal/applications GET /v1/iam/applications", zip.Doc{
Description: "Returns the applications in one organization, newest first —\neach product or site your people sign in to, with the sign-in methods and\nredirect URIs it allows.",
Fields: map[string]string{
"Application.clientId": "ClientId is the OAuth2/OIDC client identifier and the GLOBAL key every\nconfidential-client resolver authenticates against (store.GetApplicationByClientId,\nthe mint gates, Basic auth). It MUST be globally unique across ALL owners — a\ncollision would let one app shadow another at that key. This store persists each\nentity as a JSON document in a shared table, so there is no per-field column to\ncarry a DB UNIQUE index; uniqueness is enforced at the write in\napplications.Create/Update (ensureClientIdUnique), exactly as the (owner,name)\nnatural key is, and store.GetApplicationByClientId resolves admin-preferring as\ndefense-in-depth.",
"Application.platform": "Platform marks an application the platform itself declares (init_data.json):\nits own consoles and apps, never one a tenant registered. The seed stamps it on\nevery declared application at boot, and only a SuperAdmin may change it over\nthe API. It is what lets a signed-in person act through IAM with a bearer on\nthe platform's behalf — sending an invitation from the platform's own email\naccount, joining an org — which a tenant's application may not do with the\ntokens its users hand it.",
"Model[github.com/hanzoai/iam/pkg/schema.Application].id": "Persisted fields",
"Model[github.com/hanzoai/iam/pkg/schema.Cert].id": "Persisted fields",
"Model[github.com/hanzoai/iam/pkg/schema.Organization].id": "Persisted fields",
"Model[github.com/hanzoai/iam/pkg/schema.Provider].id": "Persisted fields",
"Organization.avatar": "How the organization appears across Hanzo — the square mark beside its\nname — as an image or as one emoji, never both. It is the pair a person\ncarries (User.Avatar) under the same names, resolved the same way, so a\nscreen draws a subject without asking which kind of subject it has. Both\nhalves live on the row: a mark that appears everywhere cannot be kept on\none device. Written through schema.MarkOf; Logo and LogoDark above are a\ndifferent thing, the wordmark a login screen draws.",
"Organization.failedSigninLimit": "Per-organization signin throttle. Zero means \"inherit the application\ndefault\"; a non-zero value overrides it. Safe bounds are clamped by the\nresource service before persistence.",
"Organization.founder": "Founder is the stable storage id of the identity that provisioned this org\n(self-service onboarding). It is the resume token that makes provisioning\nconverge on a backend where each write autocommits independently (no\ntransaction rollback): after a partial failure that created the org but did\nnot move the founder in, a retry recognises the org as the founder's own and\ncompletes it, instead of refusing it as \"already taken\". It also fences the\norg to ONE tenant — a different identity can never complete or join it.",
"Organization.orgBalance": "Balance fields are read-only mirrors; authoritative balances live in\nCommerce (billing.hanzo.ai). Carried for field-complete v1 parity.",
"Organization.platform": "Platform marks an organization the platform itself declares (init_data.json):\nthe brand orgs and the others the seed creates, never one a customer made. The\nseed stamps it on every declared organization at boot, and no request sets or\nclears it. Only a SuperAdmin may delete an organization that carries it.",
},
})
zip.Describe("github.com/hanzoai/iam/internal/applications GET /v1/iam/applications/:owner/:name", zip.Doc{
Description: "Returns one application: its sign-in methods, its allowed\nredirect URIs and the client credentials your integration authenticates with.",
Fields: map[string]string{
"Application.clientId": "ClientId is the OAuth2/OIDC client identifier and the GLOBAL key every\nconfidential-client resolver authenticates against (store.GetApplicationByClientId,\nthe mint gates, Basic auth). It MUST be globally unique across ALL owners — a\ncollision would let one app shadow another at that key. This store persists each\nentity as a JSON document in a shared table, so there is no per-field column to\ncarry a DB UNIQUE index; uniqueness is enforced at the write in\napplications.Create/Update (ensureClientIdUnique), exactly as the (owner,name)\nnatural key is, and store.GetApplicationByClientId resolves admin-preferring as\ndefense-in-depth.",
"Application.platform": "Platform marks an application the platform itself declares (init_data.json):\nits own consoles and apps, never one a tenant registered. The seed stamps it on\nevery declared application at boot, and only a SuperAdmin may change it over\nthe API. It is what lets a signed-in person act through IAM with a bearer on\nthe platform's behalf — sending an invitation from the platform's own email\naccount, joining an org — which a tenant's application may not do with the\ntokens its users hand it.",
"Model[github.com/hanzoai/iam/pkg/schema.Application].id": "Persisted fields",
"Model[github.com/hanzoai/iam/pkg/schema.Cert].id": "Persisted fields",
"Model[github.com/hanzoai/iam/pkg/schema.Organization].id": "Persisted fields",
"Model[github.com/hanzoai/iam/pkg/schema.Provider].id": "Persisted fields",
"Organization.avatar": "How the organization appears across Hanzo — the square mark beside its\nname — as an image or as one emoji, never both. It is the pair a person\ncarries (User.Avatar) under the same names, resolved the same way, so a\nscreen draws a subject without asking which kind of subject it has. Both\nhalves live on the row: a mark that appears everywhere cannot be kept on\none device. Written through schema.MarkOf; Logo and LogoDark above are a\ndifferent thing, the wordmark a login screen draws.",
"Organization.failedSigninLimit": "Per-organization signin throttle. Zero means \"inherit the application\ndefault\"; a non-zero value overrides it. Safe bounds are clamped by the\nresource service before persistence.",
"Organization.founder": "Founder is the stable storage id of the identity that provisioned this org\n(self-service onboarding). It is the resume token that makes provisioning\nconverge on a backend where each write autocommits independently (no\ntransaction rollback): after a partial failure that created the org but did\nnot move the founder in, a retry recognises the org as the founder's own and\ncompletes it, instead of refusing it as \"already taken\". It also fences the\norg to ONE tenant — a different identity can never complete or join it.",
"Organization.orgBalance": "Balance fields are read-only mirrors; authoritative balances live in\nCommerce (billing.hanzo.ai). Carried for field-complete v1 parity.",
"Organization.platform": "Platform marks an organization the platform itself declares (init_data.json):\nthe brand orgs and the others the seed creates, never one a customer made. The\nseed stamps it on every declared organization at boot, and no request sets or\nclears it. Only a SuperAdmin may delete an organization that carries it.",
},
})
zip.Describe("github.com/hanzoai/iam/internal/applications POST /v1/iam/applications", zip.Doc{
Description: "Registers an application in your organization — one product or site\nyour people sign in to, with its own client credentials, sign-in methods and\nallowed redirect URIs. A name already used in the organization is refused\nrather than overwritten. An application that serves other organizations —\nisShared, or any orgChoiceMode but \"\" and \"None\" — is created by a SuperAdmin\nonly.\n\nExported so the legacy add-application alias reuses this exact path — one\ncreate, two spellings.",
Fields: map[string]string{
"Application.clientId": "ClientId is the OAuth2/OIDC client identifier and the GLOBAL key every\nconfidential-client resolver authenticates against (store.GetApplicationByClientId,\nthe mint gates, Basic auth). It MUST be globally unique across ALL owners — a\ncollision would let one app shadow another at that key. This store persists each\nentity as a JSON document in a shared table, so there is no per-field column to\ncarry a DB UNIQUE index; uniqueness is enforced at the write in\napplications.Create/Update (ensureClientIdUnique), exactly as the (owner,name)\nnatural key is, and store.GetApplicationByClientId resolves admin-preferring as\ndefense-in-depth.",
"Application.platform": "Platform marks an application the platform itself declares (init_data.json):\nits own consoles and apps, never one a tenant registered. The seed stamps it on\nevery declared application at boot, and only a SuperAdmin may change it over\nthe API. It is what lets a signed-in person act through IAM with a bearer on\nthe platform's behalf — sending an invitation from the platform's own email\naccount, joining an org — which a tenant's application may not do with the\ntokens its users hand it.",
"Model[github.com/hanzoai/iam/pkg/schema.Application].id": "Persisted fields",
"Model[github.com/hanzoai/iam/pkg/schema.Cert].id": "Persisted fields",
"Model[github.com/hanzoai/iam/pkg/schema.Organization].id": "Persisted fields",
"Model[github.com/hanzoai/iam/pkg/schema.Provider].id": "Persisted fields",
"Organization.avatar": "How the organization appears across Hanzo — the square mark beside its\nname — as an image or as one emoji, never both. It is the pair a person\ncarries (User.Avatar) under the same names, resolved the same way, so a\nscreen draws a subject without asking which kind of subject it has. Both\nhalves live on the row: a mark that appears everywhere cannot be kept on\none device. Written through schema.MarkOf; Logo and LogoDark above are a\ndifferent thing, the wordmark a login screen draws.",
"Organization.failedSigninLimit": "Per-organization signin throttle. Zero means \"inherit the application\ndefault\"; a non-zero value overrides it. Safe bounds are clamped by the\nresource service before persistence.",
"Organization.founder": "Founder is the stable storage id of the identity that provisioned this org\n(self-service onboarding). It is the resume token that makes provisioning\nconverge on a backend where each write autocommits independently (no\ntransaction rollback): after a partial failure that created the org but did\nnot move the founder in, a retry recognises the org as the founder's own and\ncompletes it, instead of refusing it as \"already taken\". It also fences the\norg to ONE tenant — a different identity can never complete or join it.",
"Organization.orgBalance": "Balance fields are read-only mirrors; authoritative balances live in\nCommerce (billing.hanzo.ai). Carried for field-complete v1 parity.",
"Organization.platform": "Platform marks an organization the platform itself declares (init_data.json):\nthe brand orgs and the others the seed creates, never one a customer made. The\nseed stamps it on every declared organization at boot, and no request sets or\nclears it. Only a SuperAdmin may delete an organization that carries it.",
},
})
zip.Describe("github.com/hanzoai/iam/internal/applications PUT /v1/iam/applications/:owner/:name", zip.Doc{
Description: "Changes an application's display, its sign-in methods and the redirect\nURIs it may return to — the call that makes login work from a new host. Which\norganization it belongs to and what it is named are fixed when it is created\nand are not editable here. An application that serves other organizations —\nisShared, or any orgChoiceMode but \"\" and \"None\" — is written by a SuperAdmin\nonly, before and after the change.\n\nExported so the legacy update-application alias reuses this exact path — one\nupdate, two spellings.",
Fields: map[string]string{
"Application.clientId": "ClientId is the OAuth2/OIDC client identifier and the GLOBAL key every\nconfidential-client resolver authenticates against (store.GetApplicationByClientId,\nthe mint gates, Basic auth). It MUST be globally unique across ALL owners — a\ncollision would let one app shadow another at that key. This store persists each\nentity as a JSON document in a shared table, so there is no per-field column to\ncarry a DB UNIQUE index; uniqueness is enforced at the write in\napplications.Create/Update (ensureClientIdUnique), exactly as the (owner,name)\nnatural key is, and store.GetApplicationByClientId resolves admin-preferring as\ndefense-in-depth.",
"Application.platform": "Platform marks an application the platform itself declares (init_data.json):\nits own consoles and apps, never one a tenant registered. The seed stamps it on\nevery declared application at boot, and only a SuperAdmin may change it over\nthe API. It is what lets a signed-in person act through IAM with a bearer on\nthe platform's behalf — sending an invitation from the platform's own email\naccount, joining an org — which a tenant's application may not do with the\ntokens its users hand it.",
"Model[github.com/hanzoai/iam/pkg/schema.Application].id": "Persisted fields",
"Model[github.com/hanzoai/iam/pkg/schema.Cert].id": "Persisted fields",
"Model[github.com/hanzoai/iam/pkg/schema.Organization].id": "Persisted fields",
"Model[github.com/hanzoai/iam/pkg/schema.Provider].id": "Persisted fields",
"Organization.avatar": "How the organization appears across Hanzo — the square mark beside its\nname — as an image or as one emoji, never both. It is the pair a person\ncarries (User.Avatar) under the same names, resolved the same way, so a\nscreen draws a subject without asking which kind of subject it has. Both\nhalves live on the row: a mark that appears everywhere cannot be kept on\none device. Written through schema.MarkOf; Logo and LogoDark above are a\ndifferent thing, the wordmark a login screen draws.",
"Organization.failedSigninLimit": "Per-organization signin throttle. Zero means \"inherit the application\ndefault\"; a non-zero value overrides it. Safe bounds are clamped by the\nresource service before persistence.",
"Organization.founder": "Founder is the stable storage id of the identity that provisioned this org\n(self-service onboarding). It is the resume token that makes provisioning\nconverge on a backend where each write autocommits independently (no\ntransaction rollback): after a partial failure that created the org but did\nnot move the founder in, a retry recognises the org as the founder's own and\ncompletes it, instead of refusing it as \"already taken\". It also fences the\norg to ONE tenant — a different identity can never complete or join it.",
"Organization.orgBalance": "Balance fields are read-only mirrors; authoritative balances live in\nCommerce (billing.hanzo.ai). Carried for field-complete v1 parity.",
"Organization.platform": "Platform marks an organization the platform itself declares (init_data.json):\nthe brand orgs and the others the seed creates, never one a customer made. The\nseed stamps it on every declared organization at boot, and no request sets or\nclears it. Only a SuperAdmin may delete an organization that carries it.",
},
})
}