Repository navigation
Conversation
…gle-use link Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>
…ence and design docs Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>
… layout Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>
The members dialog and a repository's Access tab invite a person and show the invitation link; the sign-in gate keeps an invitation link through a single sign-on. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>
…the Library Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>
…y email does An email no account holds now gets an invitation, not a grant kept as typed; the refused add in the members dialog test is grants.invite's. The schema dump counts the namespace_invites table. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>
…pshot The accept path read the held role from the refusal's structured field, through str(), which the exception-text ratchet refuses; the SDK surface snapshot gains the four invitation methods. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>
Accepting an invitation grants its role on whatever the name then holds, so an open, unexpired one counts in the in-use check as a live grant does: a name retired with one outstanding is not registered as new by someone else. The cell scan judges the table as one whose org the writing request checked. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
…rt and the row columns grants.accept_invite records the invitation by the hash it is stored under, never the link's secret. A test drives the SMTP client through both schemes, its timeout and the refused login without STARTTLS; another holds every invitation write to the table's columns, which classifies loom.namespace_invites as a builder table. The journal test lists migration 123. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>
…second person Accepting spends the link under its lease and grants after leaving it, so the grant's claims and an admin grant's fan-out never nest under the invitation's; after a failed grant the link opens again only when no grant at or above its role stands. When the maker's admin came from their own grant (recheck_maker, a new column of migration 123), accepting reads that grant again and refuses unless it still reaches admin, failing closed. Where sign-in is single sign-on only, an email no account holds is granted as typed, as an add by email did before. An invitation is made only on an active namespace. grants.invite's audit row names who got the role or the invitation, never the address. The four ops carry descriptions; an unknown state reads as closed; a cancel records no accepter; the SMTP timeout is per step. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>
The sharing design, membership table, dashboard and agent guides name the single sign-on grant by email, the maker check, the spend-then-grant order and where self sign-up makes accounts; rolling-upgrade rule 76 covers the new ops and the in-use check; the open invitations show who made each; the add field's help covers both kinds of server. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>
The maker is the account the admin rests on: the caller, or a delegated token's creator. grants.invite and grants.accept_invite read its grants as the gate does (authz.subject_grant_role: a collection's groups, everyone and parents included), so an invitation never outlasts that admin, and an admin only a token's claim makes cannot make one. recheck_maker is dropped. A handle a live grant in the org is stored under counts as held, and a held person is granted under the stored spelling. Only one plain address gets a link, so it names one recipient and keys its own mail limit; the per-maker limit is keyed by the creator. A request with no token grants as typed. An unknown stored role is unlisted and admits nobody. A user's erasure takes them off the invitations they made and closes the open ones. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>
A row's owner_email and a grant's subject are whatever their writer typed, and namespace.register takes any owner, so neither makes an email an account: an invitation to it gets a link. A handle still counts through an account row or a live grant, under the spelling stored for it. The address is checked as sign-up checks it (valid_signup_email). A principal is refused in any case. A failed read of the maker's grants answers 503 at accept too, so the dashboard keeps the link. A link reopens after a failed grant only while its maker is unchanged, so an erasure that ran meanwhile keeps it closed. The Access tab names the handle the server granted. The store's reads run on clickhouse-local in a new test. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>
Accepting reads the maker as a delegated token's creator is read: an admin grant, an active account (creator_account_active) and no revocation of their subject or of tokens as old as the link (is_revoked). The decision resets the fail-closed flag first, so a read the gate survived does not answer 503 here. The put-back after a failed grant reads the grant under the subject create_grant wrote it under, and a failed put-back is logged. smtp:// needs STARTTLS for every send: the email carries the link. The email and the accept card say the role without an article. The card's Not now keeps the link for the next visit, and a link to another org asks for a sign-in there instead of offering Accept. namespace.list_mine and namespace.mark_seen no longer say invitation for a namespace's new mark. namespace_invites is listed under the grants.revoke step it is rewritten by, and rule 76 names the N-1 erasure gap. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>
Main took rolling-upgrade rule 76, so the invitations rule is 77; the Go and Rust wire models are regenerated from the merged server. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>
Main took rule 77 of the rolling-upgrade rules; the invitations rule is 78. The Go wire models and the analyzer corpus are regenerated on the merged tree. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>
…k through a non-refusal After a failed grant, the reopen reads the grant just written: on a pool spread across replicas, a replica that has not seen it would reopen a used link. The accept card drops the link only on the server's refusals of it (404, 422): an ended session or a rate limit keeps it for a retry. A failed send's log line names its error, not the address. The store test's expiry follows the clock. Shorter settings comments, and the long doc lines are rewrapped. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>
…hat admit someone The reopen after a failed accept runs to its end through a cancellation (anyio repeats one at every await) and also follows a lost reply to the write that spends the link. The mail limits are read before the invitation is stored, so one that cannot be read leaves no link listed that nobody was given. The open invitations leave out a link whose maker no longer stands. A tokenless request answers under the subject the grant is written under. The help, the sent notice and the docs say an email is granted at once only when it is verified for an account. The store test reads the row back field for field, and the two alternatives the body names are in the sharing page. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>
…egisters namespace.register takes any 1 to 128 characters, so an invitation to team_alpha is made and emailed; checking the link against the create dialog's pattern dropped it. A link is now dropped only when its namespace or org holds whitespace, which still refuses a sentence. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>
…hreads The server registers any 1 to 128 characters as a namespace, so a link check refused names it had invited to. Every link is kept; the card prints a link's namespace or org only when it holds no whitespace, so a made-up sentence is still not shown. A send past the timeout keeps its thread until each socket step times out, so sends run on a pool of their own, not the default executor that name resolution shares. The cancel toast names a cancel elsewhere too, and the mail limit's key is named for the maker it counts. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>
Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com> # Conflicts: # docs/architecture/rolling-upgrades.md
Any viewer can register a namespace under free text and invite to it, and the email goes out as the operator's address, so a sentence or a URL as the name read as the operator's own words. The email names the namespace only when validate_namespace_name takes it, else a namespace. An invitation's secret and the link fields that carry it stay out of repr, as the sign-in models' credentials do, and so out of the Rust SDK's Debug. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>
A person opening a link they spent was answered whatever grant they held, so a viewer whose writer grant failed, with the link not reopened, read the invitation as done. They are answered the role they hold only while it is at least the link's, else the link is used. The card sends one accept per link at a time: a second press landed before the first's grant and was answered as a used link, which dropped it. The invite reads the repository role ceiling as its active check does, past a namespace just registered, so a lagging read cannot store a writer link on a repository's namespace. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>
| else if (identity && identity.org === current.org) { | ||
| setIdentity({ ...identity, namespace: out.namespace }); | ||
| setSavedNamespace(out.namespace); | ||
| } |
There was a problem hiding this comment.
Accept navigates away from newer invite
Medium Severity
After a successful accept, setLink keeps a newer invitation that was pasted while the request was in flight, but navigate, setIdentity, and setSavedNamespace still run for the finished one. Accepting a collection then leaves Namespaces for the Library, so that newer link's Accept card is taken down even though its secret is still stored.
Reviewed by Cursor Bugbot for commit 09904af. Configure here.
… hold Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>
Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com> # Conflicts: # docs/architecture/storage-layout.md # docs/reference/operations.md # docs/reference/status.md # sdk/ruby/lib/clickhouse/loom/generated/ops.rb # sdk/typescript/src/generated/ops.ts # tests/unit/test_schema_baseline.py
… comment Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>
Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com> # Conflicts: # docs/architecture/rolling-upgrades.md
The merge that renumbered the invitations rule to 100 gave the line both rules ended with to rule 100 only. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>
Main's rolling-upgrade rule 100 goes first; the invitations rule follows it as 101. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>
A request with no token grants as typed only a person nothing holds, and on a server whose tokens come from outside Loom's sign-in only an admin through a grant makes a link: an admin by a token's claim alone is refused. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
There are 2 total unresolved issues (including 1 from previous review).
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit d6de396. Configure here.
| await createGrant({ org, namespace }, subj, newRole); | ||
| toast(`Added ${subjectLabel(subj, org)} as ${newRole}`, "ok"); | ||
| } | ||
| setSent(null); |
There was a problem hiding this comment.
Later add drops earlier invite link
Medium Severity
A later add replaces sent, so the previous invitation link leaves the screen. The add field stays open for the next person, and the open list has no secret. The server stores only the hash, so a link that was not emailed cannot be copied again.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit d6de396. Configure here.
…ite text A handle a live grant holds is granted like an account's, and a request with no token grants as typed, so the refusal is of a handle no account or live grant holds, made only with a token. The members dialog sends any principal other than a person to grants.create. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>
…stics The crash page copied the address's fragment, where an invitation link's secret rides from the moment it is opened until Namespaces in your org takes it; it now copies the route without it. The add field's help, the op descriptions and the docs also name what auth off does: a request with no token grants a person as typed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>
An auth-off server still verifies a token it is sent, and principals are refused whatever the token, so the API and MCP text names a request with no token and a handle or an email, not auth off and anyone. The dashboard page keeps auth off, where the dashboard sends none, beside the paragraph's other grant instead of a link. A test invites to and accepts on a collection. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>
Main's migration 137 and rolling-upgrade rule 101 go first: the invitations migration is renumbered 138_namespace_invites.sql and its rule 102, and schema.sql is dumped from a ClickHouse migrated from empty in the new order. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>
A request with no token still grants a held handle under its stored spelling and a verified email under its account's handle; only any other handle or email is granted as typed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>
A request with no token grants a handle no account or grant holds as typed and a held one under its stored spelling, before the unknown-handle refusal; the test fails with that refusal moved first. The auth-off help says an email moves onto an account's handle only when verified for it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>
Main's migration 138 and rolling-upgrade rule 102 go first: the invitations migration is renumbered 139_namespace_invites.sql and its rule 103, and schema.sql is checked against a ClickHouse migrated from empty in the new order. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>
…test by what it checks Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>
The corpus held only the link read and the open list; it now also renders the version read every invitation write takes and the maker read the user erasure's grant step takes. The consolidation guide lists open invitations among what an instance export leaves behind. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>


Related: #2150
Changelog category (leave one):
Changelog entry (one or two sentences a user of Loom can read without the diff; the release pull request collects these into the release notes):
A namespace admin can add a person by login handle or email with
grants.invite, which the dashboard's add of a person now calls: a handle an account or a live grant holds, or an email verified for an account, is granted at once; a login handle neither holds is refused instead of granted as typed, including a gateway orloom mint-tokenuser no grant names yet (grants.createstill grants any subject as typed); and any other email gets a single-use invitation link, made only by an admin through a grant (not by a role only a token gives, such as a platform admin's or an operator's) and emailed within per-org, per-inviter and per-mailbox limits whenLOOM_SMTP_URL,LOOM_MAIL_FROMandLOOM_PUBLIC_BASE_URLare set. Where sign-in is single sign-on only, such an email is granted as typed instead of linked, and a request with no token, which only auth off serves, grants every such handle or email as typed.Why
Adding a member by email did nothing on a server without single sign-on. A grant's subject is mapped from an email to a login handle only through a verified email (an SSO account or a linked one), and a password account's email is never verified. So the email was stored as typed, matched no one, and gave no error and sent no email. The workarounds were to learn the person's login handle, or to make the namespace public and have them join it.
An invitation solves this wherever a grant by email can miss the person, with mail or without; where sign-in is single sign-on only, the identity provider verifies every email, so an email is granted there and no invitation is made. The link is the credential. Whoever opens it signed in gets the role under the handle they sign in with, so the admin does not need to know that handle.
Design
grants.invite(org, namespace, to, role)(admin):sso_linksrow) goes throughgrants.createat once (outcome: "granted"), under that account's handle as stored, whatever case was typed. So does a login handle an account's row is owned under, or a live grant in the org is stored under (a person whose tokens Loom did not mint at sign-in, such as the gateway's orloom mint-token's, has no account row), under the spelling stored for it. The answer'ssubjectis the onegrants.createwrites: a handle that is itself another account's verified email moves onto that account's handle. Only a verified tie counts for an email: a row'sowner_emailand a grant's subject are whatever their writer typed, andnamespace.registertakes any owner.self_signup.valid_signup_email: a dot-atom local part and a domain IDNA encodes, so it names one recipient and keys its own mail limit), gets aloom.namespace_invitesrow and the link/spaces#invite=<secret>&org=…&namespace=…(outcome: "invited", withlink_path,urlwhenpublic_base_urlis set,expires_atandemailed).oauth_login_provider = "oidc"), the identity provider verifies every account's email, so an email no account holds is granted as typed throughgrants.create(outcome: "granted") and reaches that person at their first sign-in: no link to forward. That is what an add by email did on such a server before this change, but for one difference: the address is checked as for a link, so a list, a display name or a domain without a dot, which no identity provider signs anyone in as, is refused instead of stored.grants.create.namespaces.is_activereads with sequential consistency, so a namespace another replica just registered is found; its other caller, the bots' namespace checkloom botand the platform-admin API share, reads the same way.secrets.token_urlsafe. Only its SHA-256 is stored (invite_id), so a read of the table admits no one. The link works once, for seven days by default (LOOM_INVITE_TTL_SECONDS, one hour to thirty days), and the table's TTL drops each row a week after it expires.grants.accept_invite(org, namespace, secret)gives the role to the signed-in caller, stampedgranted_bythe inviter:grant_claims.invite_change) it checks that the link is open, the namespace active and the maker still an admin, and marks the invitation accepted. It grants after leaving the lease, so the grant's claims and an admin grant's fan-out to a repository's branches never nest under it; the lease is held alone.shielded.finish_cleanup).grants.inviteandgrants.accept_inviteboth read that account's grants as the gate reads them (authz.subject_grant_role): on a collection its own, its groups' and everyone's, there or on a collection above, assharing.rolesdoes; elsewhere its grant or an inheriting service account's creator's (_lookup_grant). The maker's account must also be active and their subject not revoked, as for a token they delegated (delegation.creator_account_active, andrevocation.is_revokedat the time the link was made, under<org>/user:<id>for an end user as the token check reads it); the decision resets the fail-closed flag first, so a read the gate survived does not count against it. Short of any of these the link is not made, or admits nobody. A failed read answers 503 at both ends, so the dashboard keeps a link through an outage. An admin whose token alone makes them one (a platform admin, an operator's token) holds no grant a later read could tell from a revoked one, so they cannot make a link: an admin through a grant invites the person. The open invitations list names each maker.skip_namespace_authzis set, since the caller has no role there yet. The handler checks the org, and every miss answers the same 404.grants.list_invitesandgrants.cancel_invite(admin) list the open invitations and withdraw one. A link whose maker does not stand now admits nobody and is listed markedstopped; it admits again if they come to stand again, as a delegated token does, unless a cutoff of the maker's tokens after it was made ended it, and holds the name until it is cancelled or expires, and the list is where an admin finds its id to cancel it. It reads the newest 200 open links and answerstruncatedpast them, which the dashboard shows as a line under the list. A cancel also closes a link an accept is spending, so a grant that then fails does not reopen it after the cancel.grants.invite's row records the role, the outcome and the subject granted or the invitation'sinvite_id, never the address an invitation link is made for;grants.accept_invite's records theinvite_idand the role, never the secret.user:<id>off every invitation they made and closes the open ones, under each invitation's lease, beside blanking them as the issuer of the grants they gave (forget_maker, in the user erasure's grant step).namespace_census.STATE_TABLES), as a live grant does: accepting it grants its role on whatever the name then holds, so a name retired with one outstanding is not registered as new by someone else.smtp_urltakes onlysmtps://orsmtp://with a host and, if given, a port from 1 to 65535 (the refusal never quotes the URL, whose userinfo is the mail login), andmail_fromonly one ASCII address (an international domain in itsxn--form), bare or asName <address>, that the email's From header and its SMTP envelope both read as that one address (a display name holding,or;is quoted), each refused at load otherwise. Plain text oversmtps://(465), orsmtp://(587) with STARTTLS, which every send requires since the email carries the link (a server that offers none gets nothing, and the link is shown to copy), withDateandMessage-IDset and the address's domain in IDNA's ASCII form, as a relay passes a client's message on as sent. It names the inviter when the maker is a person (a delegated token's creator, or the person a trusted caller acts for); a service account acting as itself, under any subject, or an end user'suser:<id>names nobody the reader knows, so that email reads "You are invited to …". The email names the namespace only when its name has the shape the server gives names (validate_namespace_name): any viewer can register one under free text, and the email goes out as the operator's address, so such a namespace is "a namespace" there.LOOM_SMTP_TIMEOUT_SECONDS(10 by default, at most 30) bounds the whole send, sincegrants.inviteanswers after it and the dashboard gives a request 60 s; a send past it is reported not sent and the link is shown to copy. Sends run on four threads of their own, so a stalled relay holds those and not the threads name resolution shares. It sends only whensmtp_url,mail_fromandpublic_base_urlare all set. The limits are read before the invitation is stored, so one that cannot be read fails the invitation and leaves no link listed that nobody was given. At most 100 invitations an hour per org (which more sign-ups do not multiply, as each one is an admin of its own namespace), 20 an hour per maker (a delegated token's creator, so minting tokens adds none) and 3 a day per mailbox (the address with its+tagand local-part dots dropped and its domain in IDNA's ASCII form, so two people whose addresses differ only so share one limit) are emailed (server.auth.attempts; a mailbox or org at its limit is refused before the inviter's attempt is counted), so the server's mail is no relay for a namespace admin, whom any sign-up can make. A refused or failed send still makes the invitation, and the dashboard shows its link to copy; the log line of a failed send names its error, not the address.grants.invite; a service account, a group, an agent or everyone still goes throughgrants.create.RESOURCE_NOT_FOUND,VALIDATION_FAILED) drops it: a replica that does not serve the op yet, an ended session or a rate limit keeps it for a retry.namespace.list_mineandnamespace.mark_seenno longer calls a namespace'sis_newmark an invitation, a word that now means agrants.invitelink:list_minesays newly shared,mark_seensays new mark.Alternatives not taken (in
docs/architecture/sharing.md: the retry answer in its Invitations section, the rest in its list of alternatives):Scope and risk
grants.accept_inviteis the one new op that admits a caller to a namespace it has no role on, so it carries the checks above and a single-use lease. The gate checks no namespace role for it, so a namespace-scoped token (one withns_roles) is answered 400IDENTITY_INCOMPLETE, as fornamespace.join: the person accepts signed in, or with a token that carries no namespace roles. The 404 for an unknown handle ingrants.invitetells a namespace admin whether a handle has an account in their own org, or a live grant on any namespace there, including ones they cannot read. This is the price of refusing typos; handles are already visible to members of shared namespaces.grants.revokestep that rewrites it, besidenamespace_grants. An accept or an invitation already past its maker check as that step runs can still write the user's id (a grant's issuer, an invitation's maker), as an in-flightgrants.createcan for an issuer; such a link admits nobody, since the step revokes the user's grants first. The cell scan judges it as a table whose org the writing request checked.grants.invite. On every server with sign-in, a login handle no account or live grant holds is refused instead of being stored. On a password server an email no account holds gets a link instead of a grant that reached nobody; where sign-in is single sign-on only, an email is granted as before. Where tokens come from outside Loom's sign-in (an upstream gateway,loom mint-token, a trusted caller acting on behalf of someone), a handle and an email were both granted as typed before. Now a handle Loom has not seen yet is refused, and an email gets a link only from an admin through a grant: an admin whose role there is only the token's claim is refused (422), and the dashboard offers no grant as typed instead.grants.createstill grants a subject the minter names as typed. Thegatewayidentity provider cannot select the old behaviour: it is also what a password server with sign-up off infers, where a grant by email reached nobody.grants.createkeeps storing a subject as typed (service accounts, principals, and scripts that name a subject on purpose).Compatibility, rollout and rollback
grants.invite,grants.list_invites,grants.cancel_inviteandgrants.accept_invite. No changed field or default.139_namespace_invites(additive). To email invitations, setLOOM_SMTP_URL,LOOM_MAIL_FROMandLOOM_PUBLIC_BASE_URL. Without them, invitations work by copying the link. Optional:LOOM_INVITE_TTL_SECONDS,LOOM_SMTP_TIMEOUT_SECONDS.docs/architecture/rolling-upgrades.md): build N-1 does not serve the new ops, so an add or an acceptance routed to it fails until a retry reaches N. N-1's in-use check does not count an open invitation, so cancel open invitations before retiring a name during the rollout. A user erasure an N-1 replica runs leaves the user's id as the maker of their invitations until the TTL drops them; those links admit nobody, since the grants are revoked.docs/operations/consolidation.md); an admin invites again on the target.Tests
tests/unit/test_grants_invite.py(97):grants.createwrites it under (fails naming an email-shaped handle another account verified); a verified email that is an account's login handle granted at once under the handle as stored (stored in mixed case, typed in lower), and so is that account's verified contact email, even where a namespace is registered naming that contact as its owner; a link for an email only a grant or a registered row's owner names, and for an international address sign-up takes; refusal of an unknown handle, of principals in any case and of a list, display name, comment, quoted or malformed dot-atom address; a tokenless request granting as typed (answered under the handle a verified email ties to); the single sign-on grant by email (an address the link check refuses refused there too); no invitation on an inactive namespace; a repository refusing a writer invitation and granting a viewer one (the real ceiling); a shared collection invited to as writer and its link granting on the collection, and a personal one refused before any link; the handle reads, the namespace's active check and the repository role ceiling reading with sequential consistency.<org>/user:<id>revocation; a maker's revocation cutoff judged by when the link was made (on the real revocation cache: a cutoff after it stops the link at accept and in the list, one before it does not); a stopped link admitting again once its maker is admin again.stopped; a list past its 200 markedtruncated; an unknown role unlisted and admitting nobody; an erased maker's links closed and unnamed; the user erasure step leaving the user's invitation cancelled and unnamed.smtp_urlof another scheme, with no host or with a bad port (its password kept out of the error), and amail_fromwith no address, or one sent as two mailboxes or as another one (an unquoted,or;) or with a non-ASCII address, refused at load.Date,Message-IDand IDNA domain; naming a person who invited, a delegated token's creator, a trusted caller's person and a delegated trusted caller's creator, and no service account (prefixed or not) or end user; an email for a namespace registered under a sentence or a URL printing neither.server.auth.attempts: 100 an hour per org however many inviters sign up, 20 an hour per inviter, 3 a day per mailbox whatever+tagor dots it carries or however its domain is spelled; a mailbox or org at its limit spending none of an inviter's; each limit counted only once the one before it admits; nothing counted before the mail settings are set; a mail limit that cannot be read storing nothing.smtp://without STARTTLS, login or not); a send past the timeout reported not sent; a send running on the mail's own threads.tests/unit/test_aliases_verified_email_sql.py: the verified owner is the account's handle as stored, read only from a row whose email is verified, a handle that is no email first.tests/unit/test_invites_store_sql.pyon clickhouse-local: an invitation's newest state wins and reads back field for field;open_onlists only the open, unexpired ones, newest first;made_byfinds every invitation a maker made in the org;account_handleandgranted_spellinganswer the spelling as stored, and nothing for an inactive row, another org, a pending or a revoked grant.tests/unit/test_sharing.py:authz.subject_grant_rolereaches a collection through a group's grant on its parent, and not for another subject or a collection not in the tree.tests/unit/test_auth_models_hide_credentials.py: an invitation's secret, link path and URL stay out ofreprand in the payload.tests/unit/test_audit_subject_credentials.py: an invitation's audit row names who got the role or the invitation, never the address; an acceptance's names the invitation by its hash and never holds the secret.tests/unit/test_grants_create_stamps_granter.py: a grant written for an accepted invitation is stampedgranted_byits maker, whoever is signed in and whatever the body names;store_grantanswers the subject it wrote, a verified email's account handle, whilegrants.createanswers as typed.--checkand the analyzer corpus (12 tests, with ClickHouse) pass. Each new guard was mutation-checked: removing it fails its test.mixed-versionCI job (make test-mixed-version) covers the cross-boot; rule 103 records what it does not check.tests/analyzer: the invitation store's four statements are in the corpus (the link read and the open list through the handlers; the version read every invitation write takes and the maker read the user erasure takes through the store), and EXPLAIN QUERY TREE passes on a migrated ClickHouse (12 tests).tests/integration/test_grants_invite.py(6, minting throughmint_test_token, which now takesis_service_account) against a server from source and its own ClickHouse: invite by email → list → accept under another handle →grants.listshows the inviter → the accepter opening it again is answered the role → another person's accept is 404 → the list is empty; an unknown handle is 404 and writes no grant; a held handle is granted at once under its stored spelling; a handle a grant names is granted under that spelling, and an email a registered namespace's owner names gets a link; a cancelled link is unlisted and admits nobody; a link stops when its maker's admin grant is revoked, and another admin sees it listedstoppedand cancels it.team_alpha,data team), and one whose namespace or org holds whitespace opened without printing it; accepting switching to the namespace, or opening a collection in the Library.grants.inviteorgrants.create; one invitation for an Enter pressed again while one is in flight; the handle the server granted named (fails with the typed one); an invitation's link shown only on the namespace it was made for and not after Cancel; no other namespace's open invitations listed while its own are read (fails without the list keyed on the namespace); the link's card taken down once its invitation is cancelled from the open list (fails without the change).vitest run(LC_ALL=en_US.UTF-8 TZ=UTC): 4740 passed. Biome 2.5.14,tsc -b, the build and the bundle budget are clean.tests/unit/test_signup_name_in_use.py: an invitation counts as in use only while it is open and unexpired; each clause was mutation-checked on clickhouse-local. A probe against the test ClickHouse gave not in use → in use (open) → not in use (cancelled).docs_reference, the reach manifest, settings reference/schema/example,schema.sql, the erasure census, op budgets, public copy and doc links.AI assistance in the code (leave one; writing this description with AI is fine):
AI-generated (an agent wrote most of the diff): Claude Code. The owner reviews the design and the auth paths.
I can explain every line of this diff and how it interacts with the rest of Loom.
Checklist
make test-unitand applicable integration results are reported by CI; a full local run is not required before pushing.main; no merged migration is edited.npm --prefix frontend run build) and its tests pass, iffrontend/changed.docs/describe the system as it now is, and this description names any operator steps and wire changes.🤖 Generated with Claude Code
Note
High Risk
Introduces a new auth path (
grants.accept_invite) that grants namespace access without prior role, plus mixed-version invite/name-retirement edge cases during rollout.Overview
Adds namespace invitations so admins can add people by login handle or email without silent no-op grants on password-only servers.
API & storage: New experimental ops
grants.invite,grants.list_invites,grants.cancel_invite, andgrants.accept_invite, backed byloom.namespace_invites(migration136). Verified emails and known handles grant immediately viagrants.create; other emails get a one-time link (/spaces#invite=…) with only the secret’s hash stored, default 7-day TTL, and optional SMTP delivery (LOOM_SMTP_URL,LOOM_MAIL_FROM,LOOM_PUBLIC_BASE_URL, rate limits on mail).Behaviour: Acceptance requires a signed-in person (not service tokens or
ns_roles-scoped tokens), re-checks that the inviter still has admin, and uses per-invite leases for single use. Open invitations block namespace name reuse like live grants; user erasure clears invitations the user created. SSO-only servers still grant unknown emails directly (with stricter email validation). Rolling upgrades document N-1 unknown-op failures and the invitation gap in in-use checks.Dashboard & docs: Members/Share flows route people through
grants.invite, show copy/email links and an Invited list with cancel; the SPA stashes the fragment for accept. Reference docs, operations catalog (+4 ops, 204 tables), rolling-upgrade rule 100, and frontendapi/invites+InvitationsUI/tests are updated.Reviewed by Cursor Bugbot for commit d6a81fd. Bugbot is set up for automated code reviews on this repo. Configure here.