Skip to content

A namespace admin invites a person by email with a single-use link - #2180

Open
zlareb1 wants to merge 23 commits into
mainfrom
feat/namespace-invites
Open

zlareb1 wants to merge 23 commits into
mainfrom
feat/namespace-invites

Conversation

@zlareb1

@zlareb1 zlareb1 commented Dec 4, 2026 •

Copy link
Copy Markdown
Member

Related: #2150

Changelog category (leave one):

  • New Feature

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 invite a person by email: an account that signs in under the handle or a verified email is granted at once, and any other email gets a single-use invitation link, emailed when the server has mail settings (LOOM_SMTP_URL, LOOM_MAIL_FROM). grants.invite, which the dashboard's add now calls, refuses a login handle no account holds instead of keeping a grant that reaches nobody.

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 only workaround was to make the namespace public and have the person join it.

An invitation solves this whatever the sign-in setup: password only, SSO, mail or no mail. 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):
    • An email verified for an account (an SSO account or an sso_links row) goes through grants.create at once (outcome: "granted"), under that account's handle. 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 or loom mint-token's, has no account row), under the spelling stored for it. Only a verified tie counts for an email: a row's owner_email and a grant's subject are whatever their writer typed, and namespace.register takes any owner.
    • Any other email, one plain address as sign-up checks it (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 a loom.namespace_invites row and the link /spaces#invite=<secret>&org=…&namespace=… (outcome: "invited", with link_path, url when public_base_url is set, expires_at and emailed).
    • Where sign-in is single sign-on only (oauth_login_provider = "oidc"), the identity provider verifies every account's email, so an email no account holds is granted as typed through grants.create (outcome: "granted") and reaches that person at their first sign-in: no link to forward. This keeps what an add by email did on such a server before this change.
    • A request with no token, which only a server with auth off serves, grants every person as typed: no one signs in there to accept a link.
    • A handle no account holds is refused with 404, so a typo is never kept as a grant for whoever signs up under it later. A service account, a group or everyone, in any case, is refused with a pointer to grants.create.
    • An invitation is made only on an active namespace, where its link can be accepted.
  • The secret is 256 bits from 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, stamped granted_by the inviter:
    • Only a person's token accepts: a service account, a grant principal or a token of another org is refused.
    • Under a lease per invitation (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.
    • One link never admits two people: after a failed grant the link opens again only when no grant at or above its role stands (read fail-closed) and the row is as the accept left it, so a failure after the grant row landed (a lost reply, a step after the write) leaves it used, and so does an erasure that took the maker off meanwhile.
    • An invitation never outlasts its maker's admin. The maker is the account the admin rests on: the caller, or a delegated token's creator, whose live grant holds the token to it. grants.invite and grants.accept_invite both 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, as sharing.roles does; 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, and revocation.is_revoked at the time the link was made); 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.
    • An invitation whose role this build does not know is left out of the list and admits nobody.
    • A higher role already held stands, as for an add.
    • skip_namespace_authz is set, since the caller has no role there yet. The handler checks the org, and every miss answers the same 404.
  • grants.list_invites and grants.cancel_invite (admin) list the open invitations and withdraw one.
  • Audit: grants.invite's row records the role, the outcome and the subject granted or the invitation's invite_id, never the address an invitation link is made for; grants.accept_invite's records the invite_id and the role, never the secret.
  • Erasure: a user's erasure takes their 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).
  • An open, unexpired invitation keeps its name in use (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.
  • Mail: plain text over smtps:// (465), or smtp:// (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), with a LOOM_SMTP_TIMEOUT_SECONDS timeout on each step of the exchange (10 by default); grants.invite answers after the send. It sends only when smtp_url, mail_from and public_base_url are all set. At most 20 invitations an hour per maker (a delegated token's creator, so minting tokens adds none) and 3 a day per address are emailed (server.auth.attempts), 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.
  • Dashboard:
    • The members dialog (a namespace's, and a collection's Share) and a repository's Access tab send a person's handle or email through grants.invite; a service account, a group, an agent or everyone still goes through grants.create.
    • An invitation by email shows its link to copy, and the members dialog and the Access tab list the open invitations with Cancel.
    • The link opens Namespaces in your org, which takes it out of the address into the tab's session storage and offers Accept. Accepting switches to the namespace, or opens a collection in the Library. The sign-in gate takes the link into session storage too, before a single sign-on, whose round trip drops the fragment; a password sign-in reloads with the fragment.
    • The add field's help says what an email that no account holds gets, on either kind of server.
    • The shell's index chunk stays at 118.8 kB (budget 120 kB): the invitation code loads with the members dialog, the Access tab and Namespaces in your org.
  • The agent-facing text of namespace.list_mine and namespace.mark_seen calls a namespace's new mark that, not an invitation, which now means a grants.invite link.

Alternatives not taken (also in docs/architecture/sharing.md):

  • A confirmation email for every password account: verified emails would let a grant by email bind at sign-in, but every server would need mail to sign anyone up.
  • A pending grant by email, bound at the first sign-in under it: a password sign-up names any email it likes, so whoever registered the address first would take the grant.
  • The secret in the query string: it would reach access logs and Referer headers.
  • Binding acceptance to the invited address: a password account has no verified email to compare, so only the link can prove the address was reached.
  • Cancelling a maker's invitations when their grant is revoked: a best-effort cascade would leave a link open when it fails; reading the grant at acceptance fails closed.

Scope and risk

  • Auth: grants.accept_invite is 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 404 for an unknown handle in grants.invite tells a namespace admin whether a handle has an account in their own org. This is the price of refusing typos; handles are already visible to members of shared namespaces.
  • Stored data: a new table holding identifiers only (an address, a role, who invited and who accepted), with a TTL. The erasure census lists it under the grants.revoke step that rewrites it, beside namespace_grants. The cell scan judges it as a table whose org the writing request checked.
  • Behaviour change: the dashboard's add of a person now goes through grants.invite. On a password server an email no account holds gets a link instead of a grant that reached nobody, and a login handle no account holds is refused instead of being stored. Where sign-in is single sign-on only, an email is granted as before.
  • Not changed: grants.create keeps storing a subject as typed (service accounts, principals, and scripts that name a subject on purpose).

Compatibility, rollout and rollback

  • Wire: new experimental ops grants.invite, grants.list_invites, grants.cancel_invite and grants.accept_invite. No changed field or default.
  • Operator steps: migration 123_namespace_invites (additive). To email invitations, set LOOM_SMTP_URL, LOOM_MAIL_FROM and LOOM_PUBLIC_BASE_URL. Without them, invitations work by copying the link. Optional: LOOM_INVITE_TTL_SECONDS, LOOM_SMTP_TIMEOUT_SECONDS.
  • Rolling upgrade (rule 78 in 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.
  • Rollback: the table stays, with rows expiring by TTL; grants made by accepted invitations are ordinary grants.

Tests

  • tests/unit/test_grants_invite.py (51): grant for a held handle (under its stored spelling), a handle only a grant names, or a verified email; 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; hash-only storage, single use with the inviter as issuer, a higher role standing, a failed grant reopening the link, expired and cancelled links, the accepter checks, the mail settings, header injection, the mail limits through server.auth.attempts (20 an hour per inviter, 3 a day per address), a failure after the grant landed leaving the link used, the maker's admin read at both ends (lowered, token-only refused, a delegated token's creator as maker and mail key, a failed read answering 503 at both ends with the link kept open), a link its maker was erased from during a failed grant staying closed, a link stopping with its maker's disabled account or revoked subject, an earlier failed read in the request not refusing the maker, a grant written under the accepter's handle (a verified email signed in) keeping the link used, an unknown role unlisted and admitting nobody, an erased maker's links closed and unnamed, the user erasure step calling it, no invitation on an inactive namespace, the single sign-on grant by email, an unknown state read as closed, the SMTP transport (both schemes, the timeout, nothing sent over smtp:// without STARTTLS, login or not), and every write carrying every column.
  • tests/unit/test_invites_store_sql.py on clickhouse-local: an invitation's newest state wins; open_on lists only the open, unexpired ones; made_by finds every invitation a maker made in the org; account_handle and granted_spelling answer 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_role reaches 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_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.
  • Focused unit gates (invite, store SQL, sharing, erasure, sign-up, settings, ops, census and in-use, cell scan, write paths, journal, audit subjects, test inventory, codegen, docs reference, migrations, public copy, doc links, agent instructions, snapshots): 3662 passed (on the tree merged with main). Each new guard was mutation-checked: removing it fails its test.
  • Mixed-version: the mixed-version CI job (make test-mixed-version) covers the cross-boot; rule 78 records what it does not check.
  • tests/integration/test_grants_invite.py (6) against a server from source and its own ClickHouse: invite by email → list → accept under another handle → grants.list shows the inviter → a second 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.
  • Frontend: the accept card keeping the link and Accept through a 5xx, keeping the link on Not now, and asking for a sign-in to another org's link instead of offering Accept (each fails without its change); the Access tab naming the handle the server granted (fails with the typed one), the sign-in gate stashing the link as a single sign-on starts (fails without the takeInviteLink() call), the link stash and the accept card (a namespace switches, a collection opens in the Library), the invitation result and open invitations, and the members dialog and Access tab routing. Full vitest run (LC_ALL=en_US.UTF-8 TZ=UTC): 3958 passed. Biome 2.5.14, tsc -b, the build and the bundle budget (index 118.8 kB) are clean. Playwright namespace-picker, a11y and focus-rings: 182 passed.
  • 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).
  • Gates: codegen for every SDK, 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

  • Local format, lint, type checks and focused tests pass. The full make test-unit and applicable integration results are reported by CI; a full local run is not required before pushing.
  • Generated files are regenerated in this PR, not by hand.
  • A new migration is additive and numbered after the latest on main; no merged migration is edited.
  • The frontend builds (npm --prefix frontend run build) and its tests pass, if frontend/ changed.
  • Docs under docs/ describe the system as it now is, and this description names any operator steps and wire changes.

🤖 Generated with Claude Code


Note

Medium Risk
Introduces a new auth path (grants.accept_invite) that grants access without an existing role, changes dashboard add behavior for unknown emails/handles, and touches erasure and namespace in-use checks during mixed-version rollout.

Overview
Adds namespace invitations so admins can add people by login handle or email without relying on SSO-verified grants.

Backend: New ops grants.invite, grants.list_invites, grants.cancel_invite, and grants.accept_invite, backed by loom.namespace_invites (hashed secret, TTL). Known handles or verified emails still grant immediately via grants.create; other emails get a fragment link (/spaces#invite=…). Optional SMTP (LOOM_SMTP_URL, LOOM_MAIL_FROM, LOOM_PUBLIC_BASE_URL) emails the link with rate limits. Open invitations block namespace name reuse; user erasure closes invitations the user created.

Dashboard: Members/Share/Access Invite routes people through grants.invite (service accounts and principals still use grants.create). Shows copyable links, Invited list with cancel, and preserves the invite through SSO sign-in via session storage.

Docs/codegen: Architecture, sharing, rolling-upgrade rule 78, config reference, and generated operations/schema tables updated (391 ops, 199 tables).

Reviewed by Cursor Bugbot for commit ffc3529. Bugbot is set up for automated code reviews on this repo. Configure here.

zlareb1 and others added 14 commits December 5, 2026 03:07
…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>
@vercel

vercel Bot commented Dec 4, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
loom-docs Ready Ready Preview Dec 5, 2026 1:04am UTC
loom-telemetry Ready Ready Preview Dec 5, 2026 1:04am UTC

Request Review

@cursor cursor Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stale Bugbot comment from a previous run.

setNewSubject("");
return;
}
toast(`Added ${subjectLabel(out.subject, org)} as ${newRole}`, "ok");

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Double Enter in MembersDialog sends duplicate invitations

Medium Severity

onAdd does not guard against an in-flight submission while busy is "__add__", and the TextField stays enabled with an Enter onKeyDown handler. Because invite (grants.invite) is non-idempotent and can wait on SMTP delivery, pressing Enter again while a request is in flight creates duplicate invitations and sends duplicate emails.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 8fc527d. Configure here.

// The invitation an add just made, with its link to copy; and how many it has made, which
// reads the open invitations again.
const [sent, setSent] = useState<{ email: string; result: InviteResult } | null>(null);
const [invited, setInvited] = useState(0);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stale invitation link persists in MembersDialog

Low Severity

sent is only cleared when the modal closes via onOpenChange or on a subsequent grant, not when org or namespace changes while mounted or when the add form's Cancel button is clicked. Reopening the add form or switching namespaces can display a stale InviteSent link from an earlier invitation or namespace.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 8fc527d. Configure here.

zlareb1 and others added 3 commits December 5, 2026 03:51
…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>

@cursor cursor Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stale Bugbot comment from a previous run.

Comment thread server/identity/app/invites.py Resolved
Comment thread server/identity/app/invites.py Resolved
zlareb1 and others added 2 commits December 5, 2026 05:02
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>

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.

There are 4 total unresolved issues (including 3 from previous reviews).

Fix All in Cursor

❌ 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 d913e99. Configure here.

org=input.org, namespace=input.namespace, subject=subject, role=input.role
)
)
return GrantsInviteOutput(outcome="granted", role=input.role, subject=subject)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Normalized subject misses existing grant

Medium Severity

grants.invite now writes the grant under account_handle or granted_spelling, while existing rows and the downgrade check are keyed by the exact subject string. A different case of the same person is a second grant, so a lower invite does not return GRANT_WOULD_DOWNGRADE. Revoking one spelling leaves the other in place.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit d913e99. Configure here.

zlareb1 and others added 4 commits December 5, 2026 05:39
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>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant