connect/MIGRATING: correct the Docs and Sheets notes; add Admit and the lessons
The step-6 notes had Docs' and Sheets' SigninPath, Docs' signed-out page and Sheets' admission wrong, and missed that team mode needs Config.Admit (Slides failed to boot without it). Adds the admission-probe pattern, the rule that 5xx means undecided, and the three reviewed implementations to copy, with the bugs their reviews found. Docs only. CI passed. Discussion 146. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Squashed from docs/migrating-fixes into main.
1 file changed,
+33
−10
connect/MIGRATING.md+33 −10
CI passed — run details
CI log
amadan: .amadan/timeout: this job's budget is 20m0s (this runner allows up to 30m0s) === vet === CGO_ENABLED=0 go vet ./... CGO_ENABLED=0 go vet -tags browser ./internal/home/ cd handoff && CGO_ENABLED=0 go vet ./... cd roster && CGO_ENABLED=0 go vet ./... cd dashboard && CGO_ENABLED=0 go vet ./... cd connect && CGO_ENABLED=0 go vet ./... cd teammode && CGO_ENABLED=0 go vet ./... === fmt === === build === CGO_ENABLED=0 go build ./... CGO_ENABLED=0 GOOS=linux GOARCH=arm64 go build ./cmd/home ./cmd/oficina ./internal/operatorlaunch cd handoff && CGO_ENABLED=0 go build ./... cd roster && CGO_ENABLED=0 go build ./... cd dashboard && CGO_ENABLED=0 go build ./... cd connect && CGO_ENABLED=0 go build ./... cd teammode && CGO_ENABLED=0 go build ./... === go-test === CGO_ENABLED=0 go test -count=1 ./... ? amadan.net/oficina/home/cmd/home [no test files] ok amadan.net/oficina/home/cmd/home-placeholder 0.826s ? amadan.net/oficina/home/cmd/oficina [no test files] ok amadan.net/oficina/home/internal/guardstest 0.189s ok amadan.net/oficina/home/internal/home 56.583s ok amadan.net/oficina/home/internal/home/directorydata 1.441s ok amadan.net/oficina/home/internal/home/logtest 0.005s ok amadan.net/oficina/home/internal/home/seal 0.003s ok amadan.net/oficina/home/internal/home/sealtest 0.003s ok amadan.net/oficina/home/internal/home/wisp 0.054s ok amadan.net/oficina/home/internal/operator 6.437s ok amadan.net/oficina/home/internal/operatorlaunch 4.148s ok amadan.net/oficina/home/internal/provisioner 49.130s cd handoff && CGO_ENABLED=0 go test -count=1 ./... ok amadan.net/oficina/home/handoff 0.665s ok amadan.net/oficina/home/handoff/seal 0.002s cd roster && CGO_ENABLED=0 go test -count=1 ./... ok amadan.net/oficina/home/roster 5.119s cd dashboard && CGO_ENABLED=0 go test ./... ok amadan.net/oficina/home/dashboard (cached) cd connect && CGO_ENABLED=0 go test -count=1 ./... ok amadan.net/oficina/home/connect 1.408s ok amadan.net/oficina/home/connect/linkstore 0.456s cd teammode && CGO_ENABLED=0 go test -count=1 ./... ok amadan.net/oficina/home/teammode 0.101s ? amadan.net/oficina/home/teammode/teammodetest [no test files] === race === go test -race -count=1 ./internal/home/ ./internal/operator/ ./internal/operatorlaunch/ ./internal/home/directorydata/ ok amadan.net/oficina/home/internal/home 338.620s ok amadan.net/oficina/home/internal/operator 82.711s ok amadan.net/oficina/home/internal/operatorlaunch 22.398s ok amadan.net/oficina/home/internal/home/directorydata 23.662s ok amadan.net/oficina/home/internal/provisioner 400.575s cd handoff && CGO_ENABLED=1 go test -race -count=1 ./... ok amadan.net/oficina/home/handoff 12.849s ok amadan.net/oficina/home/handoff/seal 1.014s cd roster && CGO_ENABLED=1 go test -race -count=1 ./... ok amadan.net/oficina/home/roster 6.967s cd dashboard && CGO_ENABLED=1 go test -race -count=1 ./... ok amadan.net/oficina/home/dashboard 1.065s cd connect && CGO_ENABLED=1 go test -race -count=1 ./... ok amadan.net/oficina/home/connect 6.277s ok amadan.net/oficina/home/connect/linkstore 6.387s cd teammode && CGO_ENABLED=1 go test -race -count=1 ./... ok amadan.net/oficina/home/teammode 1.947s ? amadan.net/oficina/home/teammode/teammodetest [no test files]
diff --git a/connect/MIGRATING.md b/connect/MIGRATING.md| index 2f3585a..5513fba 100644 |
| --- a/connect/MIGRATING.md |
| +++ b/connect/MIGRATING.md |
| @@ -67,14 +67,21 @@ drawn by estilo's `estilo-signin-screen`: |
| cookie as signed in. Wrap both in the check the app already runs before |
| `/signin` (Docs' `admitted` plus `withoutCookie`; Calendar's |
| `homeSignin`/`teamSignin`; Slides' and Memoria's offboard; Calls' |
| - `lookupPerson`/`teamSignin`; Sheets has none yet). Without it, a removed |
| + `lookupPerson`/`teamSignin`). Sheets' guards sign a refused session out |
| + but ran nothing before `/signin`, so Sheets added an admission probe |
| + that runs its real signed-in guard on a throwaway request; Slides did |
| + the same with `requireSession` then `currentUser`. Without it, a removed |
| member's session loops between `/signin` and the page that refuses it. |
| + Treat any 5xx from the guard as undecided (no refusal shown, nothing |
| + remembered, nothing forgotten), never as a refusal. |
| 3. **auth's SigninPath.** Set rastrillo `auth.Config.SigninPath` to |
| - `connect.SigninPath`. Docs (`signinAgainPath`, auth.go), Sheets |
| - (`signinFormPath`, signin.go) and Calendar (`newAuthPlugin`, auth.go) set |
| - it to `/signin/local` while Home is on. Left there, every outcome, chooser |
| - link and Forget goes to the email-only door, and the chooser never has an |
| - Oficina ID row. Slides, Memoria and Calls already use `/signin`. |
| + `connect.SigninPath`. Calendar (`newAuthPlugin`, auth.go) sets it to |
| + `/signin/local` while Home is on; Docs' and Sheets' auth already used |
| + `/signin` (only their own "send another link" hrefs pointed at |
| + `/signin/local`, and those must follow too). Left at `/signin/local`, |
| + every outcome, chooser link and Forget goes to the email-only door, and |
| + the chooser never has an Oficina ID row. Slides, Memoria and Calls |
| + already use `/signin`. |
| 4. **The federated door.** In the door handler, if `connect.OficinaHref(r)` is |
| not `""`, set `st.Federated = &auth.FederatedDoor{Provider: |
| lastsignin.ProviderOficina, Href: href, Label: "Oficina ID", Icon: |
| @@ -87,9 +94,25 @@ drawn by estilo's `estilo-signin-screen`: |
| jar. A failure to remember must not fail the sign-in. |
| 6. **Signed out.** Set `RoutesConfig.ForgetPath` to where `auth.Forget` is |
| mounted, and draw `chrome.SignInNotice{…}.SignedOut(p.Action).Forgetting(p.ForgetAction, "")` |
| - from `connect.PageFor(r, "signedout", …)`. Docs, Slides and Memoria draw |
| - the signed-out page from their own path today and must switch to |
| - `PageFor`, or pass their ForgetPath themselves. |
| -7. **Tests** that expect `/signin` to answer `303 /auth/start` now expect the |
| + from `connect.PageFor(r, "signedout", …)`. Docs already drew it through |
| + connect's `SignedOut`; Slides and Memoria draw the signed-out page from |
| + their own path today and must switch to `PageFor`, or pass their |
| + ForgetPath themselves. |
| +7. **Team mode needs `Config.Admit`.** Since connect's member choice page |
| + landed, `connect.New` refuses to boot a team-mode instance that sets |
| + `HomeOnly`/`Unlinked` without `Admit`. An app jumping from an old |
| + connect (Slides was on d82341c) must add a `teamAdmit` (Sheets' and |
| + Docs' are the model) and mount the choose page (`/account/home/choose`). |
| +8. **Copy Docs, Sheets and Slides, not this list alone.** They are the |
| + reviewed implementations (docs 2e21630 / #139, sheets 66e5391 / #71, |
| + slides d2e830f / #49). Their review records list the bugs found the |
| + first time; build their fixes in up front: Oficina ID remembered only |
| + for an admitted session; the refusal only on the plain door, so |
| + Other ways still works; a refused session's cookie cleared on the |
| + door's own response; the return memory not overwritten by a plain |
| + `/signin/local`, reset by a post without `return_to`, stripped even on |
| + a parse error, `/signed-out` read as `/`, cleared by Forget and |
| + sign-out; an end-to-end step-up test; the widest states at 320px. |
| +9. **Tests** that expect `/signin` to answer `303 /auth/start` now expect the |
| door. Tests that expect the link step-up to land on `/signin/local` now |
| expect `/signin/local?reauth=1`. |