Files
iam/internal/invitations/zipdoc_gen.go
zeekay e48704c976 users: rule who makes an org admin, and make a revoke take effect now
POST /v1/iam/users and PUT /v1/iam/users/{owner}/{name} answered 200 and
dropped user.isAdmin: the field was read from the calling code only, so a
SuperAdmin could not make hanzo/denis an admin and nothing said so.

One rule, users.Admin, now decides every change to an org-admin role: the
user create and update, SCIM, an admin membership, and an invitation that
carries the role. A SuperAdmin moves it anywhere; an org's admin moves it on
the others of a customer org; only a SuperAdmin makes an admin of a brand
(policy.IsPlatformOrg) or touches the admin org; nobody raises their own; the
last admin stays (409) unless a SuperAdmin takes them; applications, machines
and members are refused (403). The request is read for presence, so leaving
isAdmin out keeps it and a full-row write cannot demote by omission.

A revoke, a removed membership, an upsert lowering and a deleted account call
store.Void: User.Epoch moves to now, the account's token rows and sessions
are deleted, and verifyBearer refuses a token with iat <= epoch.

Invitations carry a role (member or admin), written only by who may grant it
and applied on signup and accept. GET /v1/iam/users takes isAdmin=true. Every
grant, revoke, role invitation, removal and void is an audit row under the
org, with actor, target, from, to, reason and request id.

Claude-Session: https://claude.ai/code/session_016DKtyuzxU43Gsc6Pm9vKTF
2026-11-02 12:07:57 -08:00

55 lines
6.5 KiB
Go

// Code generated by zipdoc; DO NOT EDIT.
package invitations
import (
"github.com/zap-proto/zip"
)
func init() {
zip.Describe("github.com/hanzoai/iam/internal/invitations DELETE /v1/iam/invitations/:owner/:name", zip.Doc{
Description: "Withdraws an invitation. It stops being redeemable at once; anyone who\nalready joined through it keeps their account.",
})
zip.Describe("github.com/hanzoai/iam/internal/invitations GET /v1/iam/invitations", zip.Doc{
Description: "Returns your organization's invitations, newest first — who has\nbeen asked to join, on what terms, and how many seats each invitation still\nhas left.\n\nYou see the invitations of the organization your credentials run, and no one\nelse's: your own, or one you own or administer.",
Fields: map[string]string{
"Invitation.generated": "Generated reports that IAM minted Code itself, from crypto/rand, when the\ninvitation was created. Only such a code is compared without limit; any code\na caller wrote is compared only while the org is not being guessed at, however\nit looks, because a code that looks random need not be.",
"Invitation.role": "Role is the role a redeemer arrives holding in Owner: \"member\" (or empty)\nor \"admin\". An admin role is written only by a caller users.Admin lets\ngrant org-admin there, and redeeming applies it: an account that signs up\nthrough it is its org's admin, and one that accepts it holds an admin\nmembership.",
"Invitation.sentTime": "SentTime is when an email about this invitation last went to its pinned\naddress (RFC 3339), \"\" when none has. It paces resends, so the send\nendpoint cannot be used to mail one address over and over.",
"Model[github.com/hanzoai/iam/pkg/schema.Invitation].id": "Persisted fields",
},
})
zip.Describe("github.com/hanzoai/iam/internal/invitations GET /v1/iam/invitations/:owner/:name", zip.Doc{
Description: "Returns one invitation: who it is for, what it grants on acceptance, and\nwhen it expires.",
Fields: map[string]string{
"Invitation.generated": "Generated reports that IAM minted Code itself, from crypto/rand, when the\ninvitation was created. Only such a code is compared without limit; any code\na caller wrote is compared only while the org is not being guessed at, however\nit looks, because a code that looks random need not be.",
"Invitation.role": "Role is the role a redeemer arrives holding in Owner: \"member\" (or empty)\nor \"admin\". An admin role is written only by a caller users.Admin lets\ngrant org-admin there, and redeeming applies it: an account that signs up\nthrough it is its org's admin, and one that accepts it holds an admin\nmembership.",
"Invitation.sentTime": "SentTime is when an email about this invitation last went to its pinned\naddress (RFC 3339), \"\" when none has. It paces resends, so the send\nendpoint cannot be used to mail one address over and over.",
"Model[github.com/hanzoai/iam/pkg/schema.Invitation].id": "Persisted fields",
},
})
zip.Describe("github.com/hanzoai/iam/internal/invitations POST /v1/iam/invitations", zip.Doc{
Description: "Issues an invitation to join your organization — the code or link a new\nmember redeems, with the role they arrive holding and the date it stops\nworking. A name already used in the organization is refused.",
Fields: map[string]string{
"Input.role": "Role is the role a redeemer arrives holding: \"member\" (the default) or\n\"admin\". An invitation carries admin only when its writer may make an admin\nof the org (users.Admin), and every edit of one asks again.",
"Invitation.generated": "Generated reports that IAM minted Code itself, from crypto/rand, when the\ninvitation was created. Only such a code is compared without limit; any code\na caller wrote is compared only while the org is not being guessed at, however\nit looks, because a code that looks random need not be.",
"Invitation.role": "Role is the role a redeemer arrives holding in Owner: \"member\" (or empty)\nor \"admin\". An admin role is written only by a caller users.Admin lets\ngrant org-admin there, and redeeming applies it: an account that signs up\nthrough it is its org's admin, and one that accepts it holds an admin\nmembership.",
"Invitation.sentTime": "SentTime is when an email about this invitation last went to its pinned\naddress (RFC 3339), \"\" when none has. It paces resends, so the send\nendpoint cannot be used to mail one address over and over.",
"Model[github.com/hanzoai/iam/pkg/schema.Invitation].id": "Persisted fields",
},
})
zip.Describe("github.com/hanzoai/iam/internal/invitations POST /v1/iam/invitations/:owner/:name/send", zip.Doc{
Description: "Emails an invitation to the address it is pinned to: who invited them, to\nwhich organization, and the link that joins them.\n\nThe caller chooses nothing about how it goes out. It is sent through the\nplatform application the caller's access token was issued to, from that\napplication's org's email account, with a link on the identity host that issued\nthe token — the way the inviter came in. Only the pinned address receives it.",
})
zip.Describe("github.com/hanzoai/iam/internal/invitations PUT /v1/iam/invitations/:owner/:name", zip.Doc{
Description: "Changes an invitation's terms — the role it grants, how many may redeem\nit, or when it expires. What it is called does not change.",
Fields: map[string]string{
"Input.role": "Role is the role a redeemer arrives holding: \"member\" (the default) or\n\"admin\". An invitation carries admin only when its writer may make an admin\nof the org (users.Admin), and every edit of one asks again.",
"Invitation.generated": "Generated reports that IAM minted Code itself, from crypto/rand, when the\ninvitation was created. Only such a code is compared without limit; any code\na caller wrote is compared only while the org is not being guessed at, however\nit looks, because a code that looks random need not be.",
"Invitation.role": "Role is the role a redeemer arrives holding in Owner: \"member\" (or empty)\nor \"admin\". An admin role is written only by a caller users.Admin lets\ngrant org-admin there, and redeeming applies it: an account that signs up\nthrough it is its org's admin, and one that accepts it holds an admin\nmembership.",
"Invitation.sentTime": "SentTime is when an email about this invitation last went to its pinned\naddress (RFC 3339), \"\" when none has. It paces resends, so the send\nendpoint cannot be used to mail one address over and over.",
"Model[github.com/hanzoai/iam/pkg/schema.Invitation].id": "Persisted fields",
},
})
}