Skip to content

D51b — People sign in with GitHub, and the token is the identity

  • Status: Accepted — verifies D47b's declared owner on a hosted peer
  • Date: 2026-09-24
  • Origin: slice 28 build
  • Area: surfaces

Decision

  • The peer is its own OAuth authorization server.
  • Clients register dynamically, as claude.ai and kg peer login do.
  • The peer hands the one question it cannot answer, who the person is, to GitHub.
  • GitHub's login is looked up in contributors.yaml (a new github: field per person). An unlisted login is refused with a page that says what to ask for.
  • Access tokens (an hour) and refresh tokens (30 days, rotated) are opaque, stored hashed and revocable.
  • Removing a person from contributors.yaml stops their tokens on the next call.
  • The token's subject is the kg handle, and it is who writes.
  • whoami returns it whatever the call declares.
  • who may name only an agent under it (/scout), and naming another person is refused.
  • With no agent named, it is <handle>/claude: a person on claude.ai writes through Claude, so the agent's scope and probation apply as for any agent (D47k).
  • Changesets and reviews record the verified handle.
  • kg peer login | status | logout: the command line signs in through the same flow (a browser, and a localhost callback). It keeps the token in ~/.kg/peer/<host>.json, readable only by its owner.

Why

Until now a handle was declared: who was a free-text parameter, and over MCP everyone was handle/mcp. A shared server makes that untenable, since anyone could claim anyone. GitHub is where the people who maintain a dataset already have accounts, and the dataset already lists who may contribute. The GitHub login proves who is at the keyboard; the dataset says who that is to kg. The bundle still carries the kg handle, not the GitHub account (D47g).

Alternatives

  • Maintainer-issued bearer tokens. Simpler, but claude.ai's connectors expect OAuth.
  • GitHub's token as ours. It would give the peer a person's GitHub powers on every call, and tie a session to GitHub's expiry. The peer asks GitHub once, at sign-in.