oficina / home Public

Smart door step 4: connect's /signin, /signin/local, /signin/oficina and the signed-out Forget open

On branch feat/smart-door-connect

๐Ÿค– Review record for feat/smart-door-connect (Home spec 2026-11-19-smart-door.md, step 4). Not merged, not deployed.

Author: Claude Opus 5.5 (claude-opus-5-5). Reviewer: Fable (claude-fable-5-2), at f763fbc: APPROVE AFTER FIXES. No security regression: return_to, ForgetPath, CSRF, MintedPerson and the reauth check all held; 12 of 13 mutations were caught.

What the branch does

  • /signin always renders the door (Routes.SigninDoor). Routes.Signin and its query dispatch are deleted, so bumping is a compile break, on purpose. The signed-in shortcut (shared-chrome ยง9.4) stays, except for door states (sent, err, force, reauth, continue).
  • /signin/local (Routes.SigninLocal) is the email-only door, with no shortcut.
  • GET /signin/oficina?return_to=โ€ฆ (Routes.SigninOficina) is "Continue with Oficina ID": rememberReturn plus handoff.StartPath. A reauth goes to /signin/local. OficinaHref(r) is the href for the app's auth.FederatedDoor; it is "" on the local door, on any step-up, and on any door connect did not hand over.
  • The signed-out page: RoutesConfig.ForgetPath โ†’ PageData.ForgetAction, a plain same-origin POST. PageData is now connect's own struct (same fields plus ForgetAction). Signout still chains to {Issuer}/signout.
  • MintHomeSession is where apps remember Oficina ID; MintedPerson(r) is the person connect resolved. connect imports no lastsignin or auth (tested).
  • AGENTS.md (own commit): production deploys name oficina and oficina-id; home is the canary.

Fable's findings and the fixes (117cab1)

  1. MEDIUM: the link step-up lost "local only" after the first page, since rastrillo sends every outcome and link to auth.Config.SigninPath. Fixed: Begin goes to /signin/local?reauth=1; reauth rides every rastrillo link, Forget and Begin, so /signin still draws the door and offers no Oficina ID. Copy is rastrillo's "Sign in again to continue". Test: TestLinkStepUpStaysLocalPastTheFirstPage.
  2. MEDIUM: README must say step 6 sets auth.Config.SigninPath to connect.SigninPath (Docs, Sheets, Calendar use /signin/local today) and mounts /signin/local at Routes.SigninLocal. Fixed.
  3. MEDIUM: per-app migration notes belonged in the repo, with the interim. Fixed: connect/MIGRATING.md (interim: routes.Signin โ†’ routes.SigninOficina inside each app's wrapper; Sheets needs a small sent/err/force wrapper).
  4. LOW: "forces no rastrillo version" was wrong, since connect's go.mod requires rastrillo v0.38.0 and estilo 487cadb. Reworded in api.go and the README.
  5. LOW: document that apps wrap SigninDoor/SigninOficina in their admission check. Documented; no SignedIn hook added (kept small).
  6. LOW: tests. Added a PageFor(r, "failed"โ€ฆ) check (removing the view.go guard now fails), TestConnectImportsNoLastsignin fails instead of skipping, and the finding-1 test.

Open, for Paul or a later step

  • A Home sign-out goes app โ†’ id. /signout โ†’ back to the app's /signed-out, so id.'s own Forget is never on that path. The spec says it "chains to id.*'s signed-out page"; changing the chain is a step-5 or product decision.
  • The Makefile's make release hint still prints carlos ship -app home.

Tests: make test and make test-browser (headless Chrome forced to light) passed at f763fbc; connect's tests pass at 117cab1. Hub CI: f763fbc passed; 117cab1 pending.

๐Ÿค– Hub CI passed at 117cab1 (job 556). The first run at 117cab1 failed one test outside this diff: internal/home TestNativeProofRefusals "future iat: accepted", in the race step. That looks like a timing flake: the case's iat is time.Now()+31, computed when the map is built, so a slow race run can bring it inside the skew window before it's used. This branch changes only connect/. A rerun passed. The flake is left for a separate fix.

Fable (claude-fable-5-2) re-check at 117cab1: APPROVE. All six findings resolved. One doc nit (MintedPerson returns (Person, bool) in MIGRATING.md's step-6 example) fixed in the next commit, docs only.