Skip to content

Identity and access #19

Closed
Closed

Description

@allisonmahmood

Question

What does "log in once and reach everything you have access to" mean? Who a user is (a person at a company); how they sign in (the company's IdP, SSO, Patchy accounts); what access means for a patch (who can open it, who can edit and publish it); how sharing works, from "somebody shares a static page with you" through to a CRM; how a machine credential for uploading (CLI / npx, CI, an agent) binds to a person or a company; and the who's-who glossary (user / agent / operator / reader), resolving the "operator" collision between the two CONTEXT.md files.

Product-level; auth implementation stays out of scope. Output: glossary entries and the Identity section of docs/product.md. Input: Comparable platforms — companies, identity, and access.

Activity

  1. added
    wayfinder:grilling
    on Aug 26, 2026
  2. allisonmahmood commented on Sep 1, 2026

    @allisonmahmood
    OwnerAuthor

    Resolution

    Grilled across three rounds with two research passes in between (Clerk — organizations, SSO, domains, sessions, machine auth, CLI device login — how Claude Code, Codex, gh, Vercel, Fly, Stripe and gcloud do it); landing in #96 as the Identity and access section of docs/product.md plus glossary entries in the Auth, Publishing, Patches and Serving CONTEXT.mds.

    • Clerk is the identity provider; Patchy holds the company, access and machines. Sign-in is Google, Microsoft or an emailed code — no passwords. One session across everything; a link without a session shows the door and lands back on the patch. Company SSO (SAML/OIDC) is self-served by the admin once Patchy flips the flag, enforced on the verified domain, paid. Clerk facts that shaped this: sign-in methods are per instance, not per company; Clerk cannot cap a user at one org (our invariant); no last-admin rule (ours); the B2B add-on is effectively required (20-member cap without it).
    • Getting in: invite by default; a verified domain (never consumer domains, one domain one company) opts into auto-join; inviting always stays available. No person without a company — a fresh sign-in lands on create-or-join, and creating means full onboarding, card included. Exactly one company, hard: an invite to someone in another company is refused, they leave first; a company of one must be deleted or handed off. Merge is fog.
    • Roles: member and admin only; everyone builds. A "can't publish" setting is fog, not a role.
    • Access: scope decides who opens; the owner alone changes (publish, roll back, scope, retire, delete) — no editors, admins reassign when needed. Admins see everything. Inside the company or public — no guests. Wrong person: door / "ask the owner" + request access (same company) / "no such patch" (other company).
    • Machines: patchy login is a device login — URL + code (JSON for the agent), the person confirms the code in a signed-in browser (the anti-phishing measure that costs nothing) and names the machine on a fresh login. One machine token per machine, shared by every agent on it, Patchy's own rather than a Clerk API key (local verification, no Clerk on the publish path, inactivity expiry, revoke-on-deactivate — all columns on the existing token machinery), 90 days absolute / 30 idle, listed and revoked on Your machines; deactivation revokes all and ends open sessions including tier 1/2. CI uses an ordinary machine token via PATCHY_API_TOKEN. Self-service minting retires. Loopback fast path is fog.
    • Agent is not a principal: it acts with its user's token; the version-records-the-token line answers "which agent".
    • Who's who: person / user / agent / member, admin / owner / viewer (reader at tier 0) / operator. The collision is closed: the CLI's agent is its driver; operator is Patchy only.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

wayfinder:grilling

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions