oficina / home Public
Bumping connect past the smart door (Home spec 2026-11-19-smart-door.md, step 4)
What changed
- Removed:
Routes.Signin. Bumping is a compile break for every app that calls it (Docs, Sheets, Calendar, Slides, Memoria, Calls). That is on purpose: the old method sent a bare/signinto Home, and the new/signinnever does. If it had quietly changed instead, an app still on its old door would lose Oficina ID from/signinwith nothing to say so. - Added:
Routes.SigninDoor,Routes.SigninLocal,Routes.SigninOficina;SigninPath,SigninLocalPath,SigninOficinaPath;OficinaHref(r);MintedPerson(r);RoutesConfig.ForgetPath;PageData.ForgetAction. - Changed: -
PageDatais connect's own struct, no longer an alias of estilo'shomeconnect.PageData. It has the same fields plusForgetAction, so templates and embedding structs are unaffected. A conversion tohomeconnect.PageDatawould break; no app has one. - Linking's step-up (Routes.Accountwith a stale session) now redirects to/signin/local?reauth=1, not bare/signin/local. App tests that assert the old Location must change. - Versions: connect's go.mod requires rastrillo v0.38.0 and estilo 487cadb (since step 3). Bumping connect moves an app there by minimum version selection, whatever the app pinned. connect imports no
lastsigninorauth; that is all "free of lastsignin" means.
The interim: bump without moving to the new door
To bump connect before an app's step 6, replace routes.Signin with routes.SigninOficina inside the app's existing /signin wrapper. That keeps today's behaviour: the wrapper's admission check, then the hop to Home. SigninOficina no longer sends sent, err or force to the local form, so a wrapper that relied on that does it first:
if q := r.URL.Query(); q.Has("sent") || q.Has("err") || q.Has("force") {
localSignin(w, r)
return
}
routes.SigninOficina(w, r)Leave /signin/local on the app's own handler, and auth's SigninPath on /signin/local, until step 6.
| App (connect pin) | Interim change | |---|---| | Docs (e03a01a) | Drop-in: homeRoutes.signin already sends sent/err/force to handlers.signin first. h.routes.Signin(w, r) becomes h.routes.SigninOficina(w, r). | | Sheets (e03a01a) | /signin is mounted raw at a.homeRoutes.Signin: mount a small wrapper with the sent/err/force branch above (to a.handleSignin), then SigninOficina. | | Calendar (14c83d7) | In homeSignin and teamSignin, a.home.routes.Signin becomes SigninOficina, with the sent/err/force branch (to a.h.signin) before it. | | Slides (d82341c) | In homeSignin, a.homeRoutes.Signin becomes SigninOficina, with the sent/err/force branch (to a.signin). Slides has the oldest pin; its bump also brings every connect change since 11-01. | | Memoria (14c83d7) | In signin, the session middleware wraps SigninOficina instead, with the sent/err/force branch (to a.localSignin). | | Calls (14c83d7) | In signin, the session middleware wraps SigninOficina instead, with the sent/err/force branch (to a.localSignin); the join-cookie branch is unchanged. |
Equipo uses only DecodeCredentials and is unaffected.
Step 6: the smart door
Each app, with rastrillo's SigninScreen and SigninOneWay on and its door drawn by estilo's estilo-signin-screen:
- Routes. Mount
GET /signinatRoutes.SigninDoor,GET /signin/localatRoutes.SigninLocal(never the app's handler directly, or its door offers Oficina ID), andGET /signin/oficinaatRoutes.SigninOficina.RoutesConfig.LocalSigninstays the app's door handler; connect calls it for both door routes. - Admission first.
SigninDoorandSigninOficinatake any live session cookie as signed in. Wrap both in the check the app already runs before/signin(Docs'admittedpluswithoutCookie; Calendar'shomeSignin/teamSignin; Slides' and Memoria's offboard; Calls'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 withrequireSessionthencurrentUser. Without it, a removed member's session loops between/signinand the page that refuses it. Treat any 5xx from the guard as undecided (no refusal shown, nothing remembered, nothing forgotten), never as a refusal. - auth's SigninPath. Set rastrillo
auth.Config.SigninPathtoconnect.SigninPath. Calendar (newAuthPlugin, auth.go) sets it to/signin/localwhile 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. - The federated door. In the door handler, if
connect.OficinaHref(r)is not"", setst.Federated = &auth.FederatedDoor{Provider: lastsignin.ProviderOficina, Href: href, Label: "Oficina ID", Icon: chrome.OficinaGlyph}. Set none when it is"": on/signin/local, and on any step-up. - Remember Oficina ID in
Config.MintHomeSession, after the session is stored:p, _ := connect.MintedPerson(r), thenRememberJar().Remember(w, lastsignin.Record{Method: MethodFederated, Provider: ProviderOficina, Address: p.Label}). Never carry over an address from the jar. A failure to remember must not fail the sign-in. - Signed out. Set
RoutesConfig.ForgetPathto whereauth.Forgetis mounted, and drawchrome.SignInNotice{…}.SignedOut(p.Action).Forgetting(p.ForgetAction, "")fromconnect.PageFor(r, "signedout", …). Docs already drew it through connect'sSignedOut; Slides and Memoria draw the signed-out page from their own path today and must switch toPageFor, or pass their ForgetPath themselves. - Team mode needs
Config.Admit. Since connect's member choice page landed,connect.Newrefuses to boot a team-mode instance that setsHomeOnly/UnlinkedwithoutAdmit. An app jumping from an old connect (Slides was on d82341c) must add ateamAdmit(Sheets' and Docs' are the model) and mount the choose page (/account/home/choose). - 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 withoutreturn_to, stripped even on a parse error,/signed-outread as/, cleared by Forget and sign-out; an end-to-end step-up test; the widest states at 320px. - Tests that expect
/signinto answer303 /auth/startnow expect the door. Tests that expect the link step-up to land on/signin/localnow expect/signin/local?reauth=1.