ADR 0436: A pass from another system signs someone in to the editor
- Status: Proposed
- Date: 2026-12-01
Context#
The editor has one way in: a name and a password, kept in its own users file. That suits an owner who runs her own site. It does not suit a site looked after for someone else. A studio that builds sites for clients already has a place those clients sign in, its portal, and wants them to reach their editor from there in one step, with no second password to hand out, forget and reset. It also wants that portal to be the only door, so that taking someone off a client's account there is what ends their access here.
Nothing in the editor could accept a sign-in from anywhere else. admin.signInUrl only forwards a
static site's /admin/ to where the editor runs.
Decision#
- A pass signs someone in. Another system the owner trusts hands a person a pass and sends
their browser to
/admin/enter?pass=…. The editor checks it, starts a session and opens Studio. No password crosses between the two systems. - One shared key, in the environment. The editor and the other system each hold the same key.
The editor reads it from
OPENBLOG_PASS_KEY, never fromopenblog.json, which is committed. A key under 32 bytes is not used. With no key, passes are off and/admin/enteropens Studio like any other old address. - What a pass is.
v1.<claims>.<signature>: the claims are base64url JSON, the signature is HMAC-SHA256 ofv1.<claims>under the key, base64url. The claims areaud(the editor's host as visitors type it),exp(seconds since 1970),jti(a random id of 16 to 128 letters, digits,-and_) andsub(the account to sign in as). The signature is checked first, in constant time, before any claim is read. - Short, single, and for one editor. A pass is refused when it is for another host, past its time, made to last more than two minutes, or already taken. Taken ids are remembered until they would have expired. Ten seconds of clock difference are allowed.
- Every refusal reads the same. The person sees one page, "That link no longer works", with the way back when the site names one. The reason goes to the server's log. Tries from one address are limited as wrong passwords are.
- A pass account is its own kind. The first pass naming an account makes it, with kind
passand no password: nothing typed at the sign-in form ever matches it, andopenblog user passwdrefuses it. It reaches what an owner reaches.submust be a name a login could have (valid_username). A pass never opens an account that has its own sign-in: one naming an owner's or co-writer's account is refused. - Removing the account ends it, as for any account:
openblog user removeends its sessions at the next request. Until then a session lastsadmin.sessionHours, as any does. - A pass can be the only way in.
admin.passes.only: trueturns the name-and-password sign-in off:loginanswers 403 with codepasses-onlyand checks nothing.admin.passes.from(a plainhttps://address) andfromNamesay where people come in from. - Studio's sign-in screen follows. It asks
GET /admin/api/sign-in, a route answered with no session that says only{ password, from, fromName }. Wherepasswordis false it shows the way tofromin place of the form. Signed out in the middle of work, it opensfromin another tab and waits, so her words stay on the page. - The cookie stays
SameSite=Strict. The request that carries a pass comes from another site, so a redirect after it would be sent without the new cookie./admin/enteranswers with a page of the editor's own that moves on to Studio, which makes the next request a same-site one. The page carriesReferrer-Policy: no-referrerandno-store, so the address that held the pass is not passed on or kept.
Consequences#
- A site with no
OPENBLOG_PASS_KEYbehaves exactly as before, andopenblog.jsonwithoutadmin.passesbuilds byte for byte as before. - Whoever holds the key can sign in as any pass account, and make new ones. It is as sensitive as an owner's password and is kept where one would be: the host's secrets, on both sides.
- A pass is in the address for one request. It is single-use and short-lived for that reason, the same trade an authorization code makes.
- The record of taken passes is in memory. A restart forgets it, which could allow one pass a second use inside its two minutes.
- Pass accounts all reach what an owner reaches. Narrower kinds (writing only, no settings) are a later decision.
- The other system decides who gets a pass and for which name. The editor trusts it completely within what a pass can say.