Skip ID's Continue page when no other site can have started the flow
Paul's ruling (2026-11-19), "skip it when safe". GET /authorize/resume
renders the assertion handoff directly, instead of the Continue page, only
when forced sign-in cannot be what is happening:
(a) the person signed in during this flow: /authorize now seals its start
time and the hash of any session cookie for every intent, and the
resume's session must be a different one whose known gesture time is
no earlier than that start (not a gestureless Keymail session);
(b) the navigation that reached GET /authorize carried exactly one
Sec-Fetch-Site of same-origin, same-site or none, with Mode navigate,
Dest document and no Sec-Purpose, sealed in the intent there, and the
resume is itself such a navigation.
Anything else keeps Continue. The handoff is rendered from the existing
GET rather than through a 303 to a new step, so no new route mints on
GET, the Continue POST keeps csrf.Protect, and setConsumerPolicy still
widens form-action to the one consumer. Every earlier check (intent,
subject, max_age, consumer, mint policy) runs first, unchanged.
Handler tests cover both skips, cross-site/missing/unknown/duplicated/
frame/prefetch starts, values offered after /authorize, a cross-site
resume, sign-ins from before the flow, replay and back. Browser tests
show a same-site launcher skipping, a cross-site launcher and a
same-site-to-cross-site redirect still stopping, and back restoring only
a spent handoff the app refuses. The slice-1 spec step 2 and the native
spec's reference describe the rule; check-id-mutations.py tracks 15 new
guards, all killed.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
8 files changed,
+844
−239
docs/superpowers/specs/2026-11-13-oficina-id-slice-1.md+5 −1docs/superpowers/specs/2026-11-14-oficina-id-native.md+1 −1implementation/oficina-id-slice1-mutations.json+371 −227internal/home/continue_skip_test.go+300 −0internal/home/exchange.go+51 −6internal/home/id_browser_test.go+96 −2internal/home/id_exchange_test.go+2 −1scripts/check-id-mutations.py+18 −1
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.890s ? amadan.net/oficina/home/cmd/oficina [no test files] ok amadan.net/oficina/home/internal/guardstest 0.087s ok amadan.net/oficina/home/internal/home 54.578s ok amadan.net/oficina/home/internal/home/directorydata 1.402s ok amadan.net/oficina/home/internal/home/logtest 0.003s ok amadan.net/oficina/home/internal/home/seal 0.002s ok amadan.net/oficina/home/internal/home/sealtest 0.003s ok amadan.net/oficina/home/internal/home/wisp 0.053s ok amadan.net/oficina/home/internal/operator 6.436s ok amadan.net/oficina/home/internal/operatorlaunch 4.122s ok amadan.net/oficina/home/internal/provisioner 49.233s cd handoff && CGO_ENABLED=0 go test -count=1 ./... ok amadan.net/oficina/home/handoff 0.668s 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.122s cd dashboard && CGO_ENABLED=0 go test ./... ok amadan.net/oficina/home/dashboard 0.011s cd connect && CGO_ENABLED=0 go test -count=1 ./... ok amadan.net/oficina/home/connect 1.358s ok amadan.net/oficina/home/connect/linkstore 0.468s cd teammode && CGO_ENABLED=0 go test -count=1 ./... ok amadan.net/oficina/home/teammode 0.102s ? 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 413.690s ok amadan.net/oficina/home/internal/operator 82.954s ok amadan.net/oficina/home/internal/operatorlaunch 22.391s ok amadan.net/oficina/home/internal/home/directorydata 23.882s ok amadan.net/oficina/home/internal/provisioner 420.900s cd handoff && CGO_ENABLED=1 go test -race -count=1 ./... ok amadan.net/oficina/home/handoff 12.850s 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.909s cd dashboard && CGO_ENABLED=1 go test -race -count=1 ./... ok amadan.net/oficina/home/dashboard 1.061s cd connect && CGO_ENABLED=1 go test -race -count=1 ./... ok amadan.net/oficina/home/connect 5.931s ok amadan.net/oficina/home/connect/linkstore 6.305s cd teammode && CGO_ENABLED=1 go test -race -count=1 ./... ok amadan.net/oficina/home/teammode 1.940s ? amadan.net/oficina/home/teammode/teammodetest [no test files]
diff --git a/docs/superpowers/specs/2026-11-13-oficina-id-slice-1.md b/docs/superpowers/specs/2026-11-13-oficina-id-slice-1.md| index 03d5063..98c448d 100644 |
| --- a/docs/superpowers/specs/2026-11-13-oficina-id-slice-1.md |
| +++ b/docs/superpowers/specs/2026-11-13-oficina-id-slice-1.md |
| @@ -55,7 +55,11 @@ Reuse `rastrillo/assertion` v1: P-256, context `rastrillo/assertion/v1`, `base64 |
| No email, role, grants, document list, encryption keys or authentication-strength claim. Existing roster hints remain separately reviewed, invalidation-only exceptions under Home §5.4. |
| 1. The app stores a short-lived transaction with independent browser secret, nonce, purpose and validated local return path/query. Set a `__Host-` pending cookie. Redirect to `/authorize` with exactly one `consumer`, one `nonce`, and optionally one `max_age=300`. No other parameters, duplicates or other `max_age` values; this matches `handleAuthorize`'s closed parser. Linking always includes `max_age=300`. Local accounts, documents and privileges stay app-side. |
| -2. Home validates the consumer and authenticates. For an ordinary existing session, **show a fixed-label Continue page before minting**; do not issue silently. Use operator-controlled service labels, no account-authored text. Linking always requires new authentication, regardless of session age. After Continue/authentication, deliver by form POST with optional static auto-submit and a manual button. Never put assertions in URLs or logs; use `no-store` and `strict-origin-when-cross-origin`, since `no-referrer` can null the POST Origin. |
| +2. Home validates the consumer and authenticates. **Show a fixed-label Continue page before minting unless it is safe to skip it** (Paul's ruling, 2026-11-19, "skip it when safe"). The page stops forced sign-in (login CSRF): another site sends a signed-in person to an app's `/auth/start`, the Lax session cookie rides along, and an automatic handoff would sign them in to that app on a page that site chose. Home skips it, rendering the handoff from the top-level `GET /authorize/resume`, only when that cannot be what is happening: |
| + - **(a) The person signed in during this flow.** `/authorize` seals its start time and the hash of whatever session cookie it saw. The resume's session must be a different one, with a known gesture time (not a Keymail session that reported none) no earlier than that start. This is the freshness proof linking already uses, not a timing guess. |
| + - **(b) No other site started the flow.** The navigation that reached `GET /authorize` carried exactly one `Sec-Fetch-Site` of `same-origin`, `same-site` (the suite's other subdomains) or `none` (a typed address or bookmark), with `Sec-Fetch-Mode: navigate`, `Sec-Fetch-Dest: document` and no `Sec-Purpose`. `/authorize` records that in the sealed intent; nothing later (a resume header, a query, a form field) can supply it. The resume must itself be such a navigation, so another site sending the person straight to `/authorize/resume` while a same-site intent is live still meets the page. |
| + |
| + Why (b) holds: browsers set Fetch Metadata and pages cannot, and across redirects `Sec-Fetch-Site` reports the least related origin in the chain, so an app start that another site linked to arrives as `cross-site`. A missing, repeated or unknown value keeps the page. Residuals accepted with the ruling: `none` also covers a link opened from another application, and any page on a same-site origin counts as here. A cross-site consumer (Base on `oncarlos.com`) still shows Continue to a person already signed in. Skipping changes nothing else: intent, subject, `max_age`, consumer and mint policy are checked first; the Continue POST keeps its CSRF check; the handoff is the same page, with the same one-consumer form-action and the same script. It deletes the intent cookie, so a refetched resume reaches the existing failure page. A handoff the browser restores from history, or one minted from a kept copy of the cookie, carries an assertion for a transaction the app has already finished, and the app's replay checks refuse it, as they do after a Continue POST. Rendering it directly rather than through a 303 to a new step adds no route that mints on GET. Use operator-controlled service labels, no account-authored text. Linking always requires new authentication, regardless of session age. After Continue/authentication, deliver by form POST with optional static auto-submit and a manual button. Never put assertions in URLs or logs; use `no-store` and `strict-origin-when-cross-origin`, since `no-referrer` can null the POST Origin. |
| 3. Accept only a bounded form POST with exact issuer `Origin`. Verify signature, issuer, audience, types and times. Before storing a receipt, require its signed nonce to match a live pending transaction; check and insert atomically. Reserve `(iss,jti)` uniquely so repeated callbacks refuse. Unknown nonces and storage failures store nothing. |
| 4. Store a sealed, expiring inbox receipt, then redirect to `/auth/finish`. Its top-level GET receives the original SameSite=Lax cookie. Recheck the browser secret, nonce, expiry and account binding. Consume the pending/inbox proof, record replay use, resolve the current mapping/admission and mint the session atomically. Preserve the clock watermark and replay retention through expiry plus thirty seconds across restarts. Never mint at the cross-site POST. |
diff --git a/docs/superpowers/specs/2026-11-14-oficina-id-native.md b/docs/superpowers/specs/2026-11-14-oficina-id-native.md| index 95dcbe6..2191920 100644 |
| --- a/docs/superpowers/specs/2026-11-14-oficina-id-native.md |
| +++ b/docs/superpowers/specs/2026-11-14-oficina-id-native.md |
| @@ -115,7 +115,7 @@ Docs has a single writer connection (`app.go:498,508`; `home_connect.go:82`; ras |
| **Accepted non-atomicity.** The browser path already accepts it, and this path does too. A `jti` that is burned but produces no session (a crash, or a refusal at the recheck) only means the client fetches a fresh assertion. A `jti` is never reserved twice, so replay stays impossible. |
| -The verifier gives the "only the requester redeems" property without slice 1's pending row; a native client has no ambient browser for login CSRF to exploit. There is no Continue page (Paul's ruling A(i)). |
| +The verifier gives the "only the requester redeems" property without slice 1's pending row; a native client has no ambient browser for login CSRF to exploit. There is no Continue page (Paul's ruling A(i)). The browser path keeps its Continue page except where slice 1 step 2 (amended 2026-11-19) proves forced sign-in impossible: the person signed in during the flow, or the browser's Fetch Metadata at `/authorize` showed no other site started it. Native needs neither test, because nothing but the requesting app can start its flow and the challenge binds the assertion to that app. |
| **One predicate.** `connect.IsHomeDerived(method)` is true for `HomeMethod`, `home-assertion-native` and `home-native-web`. Resolve, `ResolveSession`, `existingPerson`, `signedIn`, the same-person check, unlink and sign-out all use it in place of today's literal checks. |
diff --git a/implementation/oficina-id-slice1-mutations.json b/implementation/oficina-id-slice1-mutations.json| index 61f1d52..ead8681 100644 |
| --- a/implementation/oficina-id-slice1-mutations.json |
| +++ b/implementation/oficina-id-slice1-mutations.json |
| @@ -5,9 +5,9 @@ |
| "test": "TestIDContinueBeforeMinting", |
| "result": "killed", |
| "failures": [ |
| - "--- FAIL: TestIDContinueBeforeMinting (0.67s)" |
| + "--- FAIL: TestIDContinueBeforeMinting (0.56s)" |
| ], |
| - "seconds": 4.51 |
| + "seconds": 2.99 |
| }, |
| { |
| "guard": "link new session", |
| @@ -15,9 +15,9 @@ |
| "test": "TestIDLinkAlwaysRequiresNewGesture", |
| "result": "killed", |
| "failures": [ |
| - "--- FAIL: TestIDLinkAlwaysRequiresNewGesture (0.56s)" |
| + "--- FAIL: TestIDLinkAlwaysRequiresNewGesture (0.46s)" |
| ], |
| - "seconds": 6.26 |
| + "seconds": 3.24 |
| }, |
| { |
| "guard": "link transaction start", |
| @@ -25,9 +25,9 @@ |
| "test": "TestIDLinkRejectsProofBeforeTransactionStart", |
| "result": "killed", |
| "failures": [ |
| - "--- FAIL: TestIDLinkRejectsProofBeforeTransactionStart (0.57s)" |
| + "--- FAIL: TestIDLinkRejectsProofBeforeTransactionStart (0.51s)" |
| ], |
| - "seconds": 4.49 |
| + "seconds": 3.12 |
| }, |
| { |
| "guard": "passive Keymail issuance", |
| @@ -35,9 +35,9 @@ |
| "test": "TestIDLinkRejectsPassiveMintedSession", |
| "result": "killed", |
| "failures": [ |
| - "--- FAIL: TestIDLinkRejectsPassiveMintedSession (0.49s)" |
| + "--- FAIL: TestIDLinkRejectsPassiveMintedSession (0.47s)" |
| ], |
| - "seconds": 4.45 |
| + "seconds": 2.8 |
| }, |
| { |
| "guard": "live issuance session", |
| @@ -45,9 +45,9 @@ |
| "test": "TestIDRevokedCachedSessionCannotMint", |
| "result": "killed", |
| "failures": [ |
| - "--- FAIL: TestIDRevokedCachedSessionCannotMint (0.70s)" |
| + "--- FAIL: TestIDRevokedCachedSessionCannotMint (0.49s)" |
| ], |
| - "seconds": 3.88 |
| + "seconds": 2.91 |
| }, |
| { |
| "guard": "audience", |
| @@ -55,9 +55,9 @@ |
| "test": "TestHomeDirectoryExchangeAndPrivacy", |
| "result": "killed", |
| "failures": [ |
| - "--- FAIL: TestHomeDirectoryExchangeAndPrivacy (0.53s)" |
| + "--- FAIL: TestHomeDirectoryExchangeAndPrivacy (0.49s)" |
| ], |
| - "seconds": 4.59 |
| + "seconds": 2.88 |
| }, |
| { |
| "guard": "nonce", |
| @@ -65,9 +65,9 @@ |
| "test": "TestHomeDirectoryExchangeAndPrivacy", |
| "result": "killed", |
| "failures": [ |
| - "--- FAIL: TestHomeDirectoryExchangeAndPrivacy (0.62s)" |
| + "--- FAIL: TestHomeDirectoryExchangeAndPrivacy (0.33s)" |
| ], |
| - "seconds": 4.09 |
| + "seconds": 2.6 |
| }, |
| { |
| "guard": "assertion lifetime", |
| @@ -75,9 +75,9 @@ |
| "test": "TestHomeDirectoryExchangeAndPrivacy", |
| "result": "killed", |
| "failures": [ |
| - "--- FAIL: TestHomeDirectoryExchangeAndPrivacy (0.57s)" |
| + "--- FAIL: TestHomeDirectoryExchangeAndPrivacy (0.37s)" |
| ], |
| - "seconds": 4.73 |
| + "seconds": 2.79 |
| }, |
| { |
| "guard": "cookie ambiguity", |
| @@ -85,10 +85,10 @@ |
| "test": "TestIDChallengeBrowserCookiesAndExpiry/duplicate", |
| "result": "killed", |
| "failures": [ |
| - "--- FAIL: TestIDChallengeBrowserCookiesAndExpiry (0.30s)", |
| - "--- FAIL: TestIDChallengeBrowserCookiesAndExpiry/duplicate (0.30s)" |
| + "--- FAIL: TestIDChallengeBrowserCookiesAndExpiry (0.26s)", |
| + "--- FAIL: TestIDChallengeBrowserCookiesAndExpiry/duplicate (0.26s)" |
| ], |
| - "seconds": 5.4 |
| + "seconds": 2.92 |
| }, |
| { |
| "guard": "clock rollback", |
| @@ -96,10 +96,10 @@ |
| "test": "TestIDChallengeBrowserCookiesAndExpiry/clock", |
| "result": "killed", |
| "failures": [ |
| - "--- FAIL: TestIDChallengeBrowserCookiesAndExpiry (0.36s)", |
| - "--- FAIL: TestIDChallengeBrowserCookiesAndExpiry/clock (0.36s)" |
| + "--- FAIL: TestIDChallengeBrowserCookiesAndExpiry (0.21s)", |
| + "--- FAIL: TestIDChallengeBrowserCookiesAndExpiry/clock (0.21s)" |
| ], |
| - "seconds": 3.93 |
| + "seconds": 3.92 |
| }, |
| { |
| "guard": "future enrollment time", |
| @@ -107,10 +107,10 @@ |
| "test": "TestIDEnrollmentRejectsFutureAndPassiveAuthentication/future", |
| "result": "killed", |
| "failures": [ |
| - "--- FAIL: TestIDEnrollmentRejectsFutureAndPassiveAuthentication (0.23s)", |
| - "--- FAIL: TestIDEnrollmentRejectsFutureAndPassiveAuthentication/future (0.23s)" |
| + "--- FAIL: TestIDEnrollmentRejectsFutureAndPassiveAuthentication (0.17s)", |
| + "--- FAIL: TestIDEnrollmentRejectsFutureAndPassiveAuthentication/future (0.17s)" |
| ], |
| - "seconds": 3.81 |
| + "seconds": 2.72 |
| }, |
| { |
| "guard": "passive enrollment", |
| @@ -118,10 +118,10 @@ |
| "test": "TestIDEnrollmentRejectsFutureAndPassiveAuthentication/passive", |
| "result": "killed", |
| "failures": [ |
| - "--- FAIL: TestIDEnrollmentRejectsFutureAndPassiveAuthentication (0.33s)", |
| - "--- FAIL: TestIDEnrollmentRejectsFutureAndPassiveAuthentication/passive (0.33s)" |
| + "--- FAIL: TestIDEnrollmentRejectsFutureAndPassiveAuthentication (0.19s)", |
| + "--- FAIL: TestIDEnrollmentRejectsFutureAndPassiveAuthentication/passive (0.19s)" |
| ], |
| - "seconds": 3.39 |
| + "seconds": 2.45 |
| }, |
| { |
| "guard": "challenge capacity", |
| @@ -129,10 +129,10 @@ |
| "test": "TestIDChallengeBrowserCookiesAndExpiry/capacity", |
| "result": "killed", |
| "failures": [ |
| - "--- FAIL: TestIDChallengeBrowserCookiesAndExpiry (0.39s)", |
| - "--- FAIL: TestIDChallengeBrowserCookiesAndExpiry/capacity (0.39s)" |
| + "--- FAIL: TestIDChallengeBrowserCookiesAndExpiry (0.21s)", |
| + "--- FAIL: TestIDChallengeBrowserCookiesAndExpiry/capacity (0.21s)" |
| ], |
| - "seconds": 3.58 |
| + "seconds": 2.54 |
| }, |
| { |
| "guard": "challenge lifetime", |
| @@ -140,10 +140,10 @@ |
| "test": "TestIDGatedChallengeGuards/ttl", |
| "result": "killed", |
| "failures": [ |
| - "--- FAIL: TestIDGatedChallengeGuards (0.29s)", |
| - "--- FAIL: TestIDGatedChallengeGuards/ttl (0.29s)" |
| + "--- FAIL: TestIDGatedChallengeGuards (0.19s)", |
| + "--- FAIL: TestIDGatedChallengeGuards/ttl (0.19s)" |
| ], |
| - "seconds": 2.99 |
| + "seconds": 2.43 |
| }, |
| { |
| "guard": "challenge browser", |
| @@ -151,10 +151,10 @@ |
| "test": "TestIDGatedChallengeGuards/browser", |
| "result": "killed", |
| "failures": [ |
| - "--- FAIL: TestIDGatedChallengeGuards (0.31s)", |
| - "--- FAIL: TestIDGatedChallengeGuards/browser (0.31s)" |
| + "--- FAIL: TestIDGatedChallengeGuards (0.22s)", |
| + "--- FAIL: TestIDGatedChallengeGuards/browser (0.22s)" |
| ], |
| - "seconds": 3.77 |
| + "seconds": 2.53 |
| }, |
| { |
| "guard": "challenge subject", |
| @@ -162,10 +162,10 @@ |
| "test": "TestIDRegistrationChallengeSubjectAndLiveSession/subject", |
| "result": "killed", |
| "failures": [ |
| - "--- FAIL: TestIDRegistrationChallengeSubjectAndLiveSession (0.32s)", |
| - "--- FAIL: TestIDRegistrationChallengeSubjectAndLiveSession/subject (0.32s)" |
| + "--- FAIL: TestIDRegistrationChallengeSubjectAndLiveSession (0.20s)", |
| + "--- FAIL: TestIDRegistrationChallengeSubjectAndLiveSession/subject (0.20s)" |
| ], |
| - "seconds": 3.31 |
| + "seconds": 2.61 |
| }, |
| { |
| "guard": "challenge purpose", |
| @@ -173,10 +173,10 @@ |
| "test": "TestIDGatedChallengeGuards/purpose", |
| "result": "killed", |
| "failures": [ |
| - "--- FAIL: TestIDGatedChallengeGuards (0.38s)", |
| - "--- FAIL: TestIDGatedChallengeGuards/purpose (0.38s)" |
| + "--- FAIL: TestIDGatedChallengeGuards (0.22s)", |
| + "--- FAIL: TestIDGatedChallengeGuards/purpose (0.22s)" |
| ], |
| - "seconds": 3.6 |
| + "seconds": 2.69 |
| }, |
| { |
| "guard": "challenge expiry", |
| @@ -184,10 +184,10 @@ |
| "test": "TestIDGatedChallengeGuards/expiry", |
| "result": "killed", |
| "failures": [ |
| - "--- FAIL: TestIDGatedChallengeGuards (0.32s)", |
| - "--- FAIL: TestIDGatedChallengeGuards/expiry (0.32s)" |
| + "--- FAIL: TestIDGatedChallengeGuards (0.21s)", |
| + "--- FAIL: TestIDGatedChallengeGuards/expiry (0.21s)" |
| ], |
| - "seconds": 2.99 |
| + "seconds": 2.62 |
| }, |
| { |
| "guard": "challenge single use", |
| @@ -195,10 +195,10 @@ |
| "test": "TestIDGatedChallengeGuards/single-use", |
| "result": "killed", |
| "failures": [ |
| - "--- FAIL: TestIDGatedChallengeGuards (0.30s)", |
| - "--- FAIL: TestIDGatedChallengeGuards/single-use (0.30s)" |
| + "--- FAIL: TestIDGatedChallengeGuards (0.22s)", |
| + "--- FAIL: TestIDGatedChallengeGuards/single-use (0.22s)" |
| ], |
| - "seconds": 3.2 |
| + "seconds": 2.54 |
| }, |
| { |
| "guard": "strict ceremony JSON", |
| @@ -206,11 +206,11 @@ |
| "test": "TestIDCeremonyRejectsAmbiguousJSON", |
| "result": "killed", |
| "failures": [ |
| - "--- FAIL: TestIDCeremonyRejectsAmbiguousJSON (0.55s)", |
| - "--- FAIL: TestIDCeremonyRejectsAmbiguousJSON/trailing (0.28s)", |
| - "--- FAIL: TestIDCeremonyRejectsAmbiguousJSON/duplicate (0.26s)" |
| + "--- FAIL: TestIDCeremonyRejectsAmbiguousJSON (0.33s)", |
| + "--- FAIL: TestIDCeremonyRejectsAmbiguousJSON/trailing (0.17s)", |
| + "--- FAIL: TestIDCeremonyRejectsAmbiguousJSON/duplicate (0.16s)" |
| ], |
| - "seconds": 3.51 |
| + "seconds": 2.56 |
| }, |
| { |
| "guard": "credential collision", |
| @@ -218,9 +218,9 @@ |
| "test": "TestIDEnrollmentCannotTransferCredential", |
| "result": "killed", |
| "failures": [ |
| - "--- FAIL: TestIDEnrollmentCannotTransferCredential (0.31s)" |
| + "--- FAIL: TestIDEnrollmentCannotTransferCredential (0.22s)" |
| ], |
| - "seconds": 2.89 |
| + "seconds": 2.53 |
| }, |
| { |
| "guard": "credential enrollment bound", |
| @@ -228,9 +228,9 @@ |
| "test": "TestIDEnrollmentBound", |
| "result": "killed", |
| "failures": [ |
| - "--- FAIL: TestIDEnrollmentBound (1.36s)" |
| + "--- FAIL: TestIDEnrollmentBound (0.72s)" |
| ], |
| - "seconds": 4.09 |
| + "seconds": 3.03 |
| }, |
| { |
| "guard": "credential owner", |
| @@ -238,9 +238,9 @@ |
| "test": "TestIDGateBindsCredentialOwner", |
| "result": "killed", |
| "failures": [ |
| - "--- FAIL: TestIDGateBindsCredentialOwner (0.43s)" |
| + "--- FAIL: TestIDGateBindsCredentialOwner (0.25s)" |
| ], |
| - "seconds": 3.18 |
| + "seconds": 2.73 |
| }, |
| { |
| "guard": "discoverable admission", |
| @@ -248,9 +248,9 @@ |
| "test": "TestIDLegacyCredentialCannotSignInDirectly", |
| "result": "killed", |
| "failures": [ |
| - "--- FAIL: TestIDLegacyCredentialCannotSignInDirectly (0.31s)" |
| + "--- FAIL: TestIDLegacyCredentialCannotSignInDirectly (0.19s)" |
| ], |
| - "seconds": 2.98 |
| + "seconds": 2.51 |
| }, |
| { |
| "guard": "WebAuthn verification", |
| @@ -258,13 +258,13 @@ |
| "test": "TestIDPasskeyRejectsBadProofs/(origin|rp|uv|signature)", |
| "result": "killed", |
| "failures": [ |
| - "--- FAIL: TestIDPasskeyRejectsBadProofs (1.06s)", |
| - "--- FAIL: TestIDPasskeyRejectsBadProofs/origin (0.26s)", |
| - "--- FAIL: TestIDPasskeyRejectsBadProofs/rp (0.26s)", |
| - "--- FAIL: TestIDPasskeyRejectsBadProofs/uv (0.25s)", |
| - "--- FAIL: TestIDPasskeyRejectsBadProofs/signature (0.28s)" |
| + "--- FAIL: TestIDPasskeyRejectsBadProofs (0.74s)", |
| + "--- FAIL: TestIDPasskeyRejectsBadProofs/origin (0.22s)", |
| + "--- FAIL: TestIDPasskeyRejectsBadProofs/rp (0.18s)", |
| + "--- FAIL: TestIDPasskeyRejectsBadProofs/uv (0.17s)", |
| + "--- FAIL: TestIDPasskeyRejectsBadProofs/signature (0.16s)" |
| ], |
| - "seconds": 3.86 |
| + "seconds": 3.31 |
| }, |
| { |
| "guard": "recovery entropy", |
| @@ -272,9 +272,9 @@ |
| "test": "TestIDRecoveryEntropy", |
| "result": "killed", |
| "failures": [ |
| - "--- FAIL: TestIDRecoveryEntropy (0.28s)" |
| + "--- FAIL: TestIDRecoveryEntropy (0.18s)" |
| ], |
| - "seconds": 3.01 |
| + "seconds": 2.38 |
| }, |
| { |
| "guard": "account attempt budget", |
| @@ -282,9 +282,9 @@ |
| "test": "TestIDRecoveryAttemptLimitSurvivesReconstruction", |
| "result": "killed", |
| "failures": [ |
| - "--- FAIL: TestIDRecoveryAttemptLimitSurvivesReconstruction (0.62s)" |
| + "--- FAIL: TestIDRecoveryAttemptLimitSurvivesReconstruction (0.41s)" |
| ], |
| - "seconds": 3.91 |
| + "seconds": 2.66 |
| }, |
| { |
| "guard": "IP attempt budget", |
| @@ -292,9 +292,9 @@ |
| "test": "TestIDRecoveryIPLimitAcrossAccounts", |
| "result": "killed", |
| "failures": [ |
| - "--- FAIL: TestIDRecoveryIPLimitAcrossAccounts (1.16s)" |
| + "--- FAIL: TestIDRecoveryIPLimitAcrossAccounts (0.69s)" |
| ], |
| - "seconds": 4.51 |
| + "seconds": 3.09 |
| }, |
| { |
| "guard": "attempt increment", |
| @@ -302,9 +302,9 @@ |
| "test": "TestIDRecoveryAttemptLimitSurvivesReconstruction", |
| "result": "killed", |
| "failures": [ |
| - "--- FAIL: TestIDRecoveryAttemptLimitSurvivesReconstruction (0.50s)" |
| + "--- FAIL: TestIDRecoveryAttemptLimitSurvivesReconstruction (0.29s)" |
| ], |
| - "seconds": 3.93 |
| + "seconds": 2.66 |
| }, |
| { |
| "guard": "attempt persistence", |
| @@ -312,9 +312,9 @@ |
| "test": "TestIDRecoveryAttemptLimitSurvivesReconstruction", |
| "result": "killed", |
| "failures": [ |
| - "--- FAIL: TestIDRecoveryAttemptLimitSurvivesReconstruction (0.56s)" |
| + "--- FAIL: TestIDRecoveryAttemptLimitSurvivesReconstruction (0.37s)" |
| ], |
| - "seconds": 4.13 |
| + "seconds": 2.79 |
| }, |
| { |
| "guard": "mailbox freshness", |
| @@ -322,9 +322,9 @@ |
| "test": "TestIDRecoveryMailboxTimeDefense", |
| "result": "killed", |
| "failures": [ |
| - "--- FAIL: TestIDRecoveryMailboxTimeDefense (0.44s)" |
| + "--- FAIL: TestIDRecoveryMailboxTimeDefense (0.25s)" |
| ], |
| - "seconds": 4.02 |
| + "seconds": 2.72 |
| }, |
| { |
| "guard": "recovery code person", |
| @@ -332,9 +332,9 @@ |
| "test": "TestIDRecoveryCodePersonBindingAndReplay", |
| "result": "killed", |
| "failures": [ |
| - "--- FAIL: TestIDRecoveryCodePersonBindingAndReplay (0.43s)" |
| + "--- FAIL: TestIDRecoveryCodePersonBindingAndReplay (0.27s)" |
| ], |
| - "seconds": 3.77 |
| + "seconds": 2.81 |
| }, |
| { |
| "guard": "recovery code single use", |
| @@ -342,9 +342,9 @@ |
| "test": "TestIDRecoveryCodePersonBindingAndReplay", |
| "result": "killed", |
| "failures": [ |
| - "--- FAIL: TestIDRecoveryCodePersonBindingAndReplay (0.54s)" |
| + "--- FAIL: TestIDRecoveryCodePersonBindingAndReplay (0.31s)" |
| ], |
| - "seconds": 3.71 |
| + "seconds": 2.71 |
| }, |
| { |
| "guard": "recovery proof expiry", |
| @@ -352,10 +352,10 @@ |
| "test": "TestIDReplacementProofBinding/expired", |
| "result": "killed", |
| "failures": [ |
| - "--- FAIL: TestIDReplacementProofBinding (0.39s)", |
| - "--- FAIL: TestIDReplacementProofBinding/expired (0.39s)" |
| + "--- FAIL: TestIDReplacementProofBinding (0.24s)", |
| + "--- FAIL: TestIDReplacementProofBinding/expired (0.24s)" |
| ], |
| - "seconds": 3.53 |
| + "seconds": 2.48 |
| }, |
| { |
| "guard": "recovery proof subject", |
| @@ -363,7 +363,7 @@ |
| "test": "TestIDReplacementProofBinding/wrong-person", |
| "result": "survived", |
| "failures": [], |
| - "seconds": 3.69, |
| + "seconds": 2.43, |
| "explanation": "Independent in-memory mailbox subject check still refuses. The paired mutation removes both checks and must fail the same regression." |
| }, |
| { |
| @@ -372,9 +372,9 @@ |
| "test": "TestIDRecoveryProofCapacity", |
| "result": "killed", |
| "failures": [ |
| - "--- FAIL: TestIDRecoveryProofCapacity (0.42s)" |
| + "--- FAIL: TestIDRecoveryProofCapacity (0.35s)" |
| ], |
| - "seconds": 3.64 |
| + "seconds": 3.4 |
| }, |
| { |
| "guard": "mailbox memory capacity", |
| @@ -384,7 +384,7 @@ |
| "failures": [ |
| "--- FAIL: TestIDMailboxMemoryBoundAndExpiry (0.00s)" |
| ], |
| - "seconds": 3.16 |
| + "seconds": 3.44 |
| }, |
| { |
| "guard": "mailbox memory expiry", |
| @@ -394,7 +394,7 @@ |
| "failures": [ |
| "--- FAIL: TestIDMailboxMemoryBoundAndExpiry (0.00s)" |
| ], |
| - "seconds": 3.83 |
| + "seconds": 2.41 |
| }, |
| { |
| "guard": "notice outcome", |
| @@ -402,9 +402,9 @@ |
| "test": "TestIDNoticeFailureSurvivesRestartWithoutAddress", |
| "result": "killed", |
| "failures": [ |
| - "--- FAIL: TestIDNoticeFailureSurvivesRestartWithoutAddress (0.47s)" |
| + "--- FAIL: TestIDNoticeFailureSurvivesRestartWithoutAddress (0.30s)" |
| ], |
| - "seconds": 4.25 |
| + "seconds": 2.62 |
| }, |
| { |
| "guard": "SMTP log privacy", |
| @@ -412,9 +412,9 @@ |
| "test": "TestIDSMTPFailureDoesNotLeak", |
| "result": "killed", |
| "failures": [ |
| - "--- FAIL: TestIDSMTPFailureDoesNotLeak (0.29s)" |
| + "--- FAIL: TestIDSMTPFailureDoesNotLeak (0.15s)" |
| ], |
| - "seconds": 3.85 |
| + "seconds": 3.17 |
| }, |
| { |
| "guard": "limiter address blinding", |
| @@ -422,9 +422,9 @@ |
| "test": "TestIDSigninLimiterUsesBlindedAddress", |
| "result": "killed", |
| "failures": [ |
| - "--- FAIL: TestIDSigninLimiterUsesBlindedAddress (0.19s)" |
| + "--- FAIL: TestIDSigninLimiterUsesBlindedAddress (0.15s)" |
| ], |
| - "seconds": 3.3 |
| + "seconds": 2.7 |
| }, |
| { |
| "guard": "local signout", |
| @@ -432,9 +432,9 @@ |
| "test": "TestIDLocalSignoutWithHangingIssuer", |
| "result": "killed", |
| "failures": [ |
| - "--- FAIL: TestIDLocalSignoutWithHangingIssuer (0.50s)" |
| + "--- FAIL: TestIDLocalSignoutWithHangingIssuer (0.76s)" |
| ], |
| - "seconds": 3.1 |
| + "seconds": 3.71 |
| }, |
| { |
| "guard": "sealed link storage", |
| @@ -442,9 +442,9 @@ |
| "test": "TestFullSigninLeavesNoReadableAddress", |
| "result": "killed", |
| "failures": [ |
| - "--- FAIL: TestFullSigninLeavesNoReadableAddress (0.22s)" |
| + "--- FAIL: TestFullSigninLeavesNoReadableAddress (0.17s)" |
| ], |
| - "seconds": 2.87 |
| + "seconds": 5.13 |
| }, |
| { |
| "guard": "closed authorize fields", |
| @@ -452,9 +452,9 @@ |
| "test": "TestIDClosedAuthorize", |
| "result": "killed", |
| "failures": [ |
| - "--- FAIL: TestIDClosedAuthorize (0.40s)" |
| + "--- FAIL: TestIDClosedAuthorize (0.44s)" |
| ], |
| - "seconds": 3.17 |
| + "seconds": 2.86 |
| }, |
| { |
| "guard": "authorize consumer uniqueness", |
| @@ -462,9 +462,9 @@ |
| "test": "TestIDClosedAuthorize", |
| "result": "killed", |
| "failures": [ |
| - "--- FAIL: TestIDClosedAuthorize (0.42s)" |
| + "--- FAIL: TestIDClosedAuthorize (0.29s)" |
| ], |
| - "seconds": 2.77 |
| + "seconds": 2.95 |
| }, |
| { |
| "guard": "authorize nonce uniqueness", |
| @@ -472,9 +472,9 @@ |
| "test": "TestIDClosedAuthorize", |
| "result": "killed", |
| "failures": [ |
| - "--- FAIL: TestIDClosedAuthorize (0.42s)" |
| + "--- FAIL: TestIDClosedAuthorize (0.33s)" |
| ], |
| - "seconds": 2.86 |
| + "seconds": 3.08 |
| }, |
| { |
| "guard": "CSRF for sensitive posts", |
| @@ -482,9 +482,9 @@ |
| "test": "TestIDAllSensitivePostsRequireOrigin", |
| "result": "killed", |
| "failures": [ |
| - "--- FAIL: TestIDAllSensitivePostsRequireOrigin (0.50s)" |
| + "--- FAIL: TestIDAllSensitivePostsRequireOrigin (0.53s)" |
| ], |
| - "seconds": 4.01 |
| + "seconds": 4.52 |
| }, |
| { |
| "guard": "recovery subject defenses together", |
| @@ -492,10 +492,10 @@ |
| "test": "TestIDReplacementProofBinding/wrong-person", |
| "result": "killed", |
| "failures": [ |
| - "--- FAIL: TestIDReplacementProofBinding (0.45s)", |
| - "--- FAIL: TestIDReplacementProofBinding/wrong-person (0.45s)" |
| + "--- FAIL: TestIDReplacementProofBinding (0.22s)", |
| + "--- FAIL: TestIDReplacementProofBinding/wrong-person (0.22s)" |
| ], |
| - "seconds": 5.11 |
| + "seconds": 3.22 |
| }, |
| { |
| "guard": "registered authorize consumer", |
| @@ -503,9 +503,9 @@ |
| "test": "TestIDClosedAuthorize", |
| "result": "killed", |
| "failures": [ |
| - "--- FAIL: TestIDClosedAuthorize (0.43s)" |
| + "--- FAIL: TestIDClosedAuthorize (0.31s)" |
| ], |
| - "seconds": 4.03 |
| + "seconds": 2.71 |
| }, |
| { |
| "guard": "authorize nonce format", |
| @@ -513,9 +513,9 @@ |
| "test": "TestIDClosedAuthorize", |
| "result": "killed", |
| "failures": [ |
| - "--- FAIL: TestIDClosedAuthorize (0.45s)" |
| + "--- FAIL: TestIDClosedAuthorize (0.28s)" |
| ], |
| - "seconds": 4.01 |
| + "seconds": 2.64 |
| }, |
| { |
| "guard": "authorize max age", |
| @@ -523,9 +523,9 @@ |
| "test": "TestIDClosedAuthorize", |
| "result": "killed", |
| "failures": [ |
| - "--- FAIL: TestIDClosedAuthorize (0.41s)" |
| + "--- FAIL: TestIDClosedAuthorize (0.44s)" |
| ], |
| - "seconds": 3.09 |
| + "seconds": 3.24 |
| }, |
| { |
| "guard": "replacement rollback", |
| @@ -533,14 +533,14 @@ |
| "test": "TestIDReplacementRollback", |
| "result": "killed", |
| "failures": [ |
| - "--- FAIL: TestIDReplacementRollback (1.98s)", |
| - "--- FAIL: TestIDReplacementRollback/sessionsDELETE (0.34s)", |
| + "--- FAIL: TestIDReplacementRollback (1.82s)", |
| + "--- FAIL: TestIDReplacementRollback/sessionsDELETE (0.32s)", |
| "--- FAIL: TestIDReplacementRollback/passkey_recovery_codesDELETE (0.32s)", |
| - "--- FAIL: TestIDReplacementRollback/home_id_recovery_proofsDELETE (0.32s)", |
| - "--- FAIL: TestIDReplacementRollback/passkey_credentialsINSERT (0.32s)", |
| - "--- FAIL: TestIDReplacementRollback/home_id_discoverableINSERT (0.35s)" |
| + "--- FAIL: TestIDReplacementRollback/home_id_recovery_proofsDELETE (0.33s)", |
| + "--- FAIL: TestIDReplacementRollback/passkey_credentialsINSERT (0.33s)", |
| + "--- FAIL: TestIDReplacementRollback/home_id_discoverableINSERT (0.21s)" |
| ], |
| - "seconds": 4.41 |
| + "seconds": 4.33 |
| }, |
| { |
| "guard": "email authentication time", |
| @@ -548,9 +548,9 @@ |
| "test": "TestIDEmailMintPreservesVerificationTime", |
| "result": "killed", |
| "failures": [ |
| - "--- FAIL: TestIDEmailMintPreservesVerificationTime (0.22s)" |
| + "--- FAIL: TestIDEmailMintPreservesVerificationTime (0.14s)" |
| ], |
| - "seconds": 3.16 |
| + "seconds": 2.33 |
| }, |
| { |
| "guard": "codes after enrollment", |
| @@ -558,9 +558,9 @@ |
| "test": "TestIDCodesRequireEnrolledPasskey", |
| "result": "killed", |
| "failures": [ |
| - "--- FAIL: TestIDCodesRequireEnrolledPasskey (0.28s)" |
| + "--- FAIL: TestIDCodesRequireEnrolledPasskey (0.17s)" |
| ], |
| - "seconds": 3.25 |
| + "seconds": 2.78 |
| }, |
| { |
| "guard": "fresh intent start provenance", |
| @@ -568,9 +568,9 @@ |
| "test": "TestIDFreshIntentRequiresStartTime", |
| "result": "killed", |
| "failures": [ |
| - "--- FAIL: TestIDFreshIntentRequiresStartTime (0.69s)" |
| + "--- FAIL: TestIDFreshIntentRequiresStartTime (0.32s)" |
| ], |
| - "seconds": 5.05 |
| + "seconds": 2.87 |
| }, |
| { |
| "guard": "credential page cache privacy", |
| @@ -578,9 +578,9 @@ |
| "test": "TestIDCredentialPagesAreNoStore", |
| "result": "killed", |
| "failures": [ |
| - "--- FAIL: TestIDCredentialPagesAreNoStore (0.53s)" |
| + "--- FAIL: TestIDCredentialPagesAreNoStore (0.31s)" |
| ], |
| - "seconds": 6.1 |
| + "seconds": 3.33 |
| }, |
| { |
| "guard": "link recovery exclusion", |
| @@ -588,9 +588,9 @@ |
| "test": "TestIDRecoveryCannotLink", |
| "result": "killed", |
| "failures": [ |
| - "--- FAIL: TestIDRecoveryCannotLink (0.53s)" |
| + "--- FAIL: TestIDRecoveryCannotLink (0.51s)" |
| ], |
| - "seconds": 6.2 |
| + "seconds": 4.42 |
| }, |
| { |
| "guard": "enrollment recovery exclusion", |
| @@ -598,9 +598,9 @@ |
| "test": "TestIDRecoveryExclusions", |
| "result": "killed", |
| "failures": [ |
| - "--- FAIL: TestIDRecoveryExclusions (0.37s)" |
| + "--- FAIL: TestIDRecoveryExclusions (0.23s)" |
| ], |
| - "seconds": 4.73 |
| + "seconds": 2.72 |
| }, |
| { |
| "guard": "codes recovery exclusion", |
| @@ -608,9 +608,9 @@ |
| "test": "TestIDRecoveryExclusions", |
| "result": "killed", |
| "failures": [ |
| - "--- FAIL: TestIDRecoveryExclusions (0.37s)" |
| + "--- FAIL: TestIDRecoveryExclusions (0.22s)" |
| ], |
| - "seconds": 3.68 |
| + "seconds": 2.45 |
| }, |
| { |
| "guard": "replacement recovery suffix", |
| @@ -618,10 +618,10 @@ |
| "test": "TestIDReplacementRequiresRecoverySession/method", |
| "result": "killed", |
| "failures": [ |
| - "--- FAIL: TestIDReplacementRequiresRecoverySession (0.34s)", |
| - "--- FAIL: TestIDReplacementRequiresRecoverySession/method (0.34s)" |
| + "--- FAIL: TestIDReplacementRequiresRecoverySession (0.27s)", |
| + "--- FAIL: TestIDReplacementRequiresRecoverySession/method (0.27s)" |
| ], |
| - "seconds": 2.64 |
| + "seconds": 2.7 |
| }, |
| { |
| "guard": "replacement session binding", |
| @@ -629,10 +629,10 @@ |
| "test": "TestIDReplacementRequiresRecoverySession/session", |
| "result": "killed", |
| "failures": [ |
| - "--- FAIL: TestIDReplacementRequiresRecoverySession (0.47s)", |
| - "--- FAIL: TestIDReplacementRequiresRecoverySession/session (0.47s)" |
| + "--- FAIL: TestIDReplacementRequiresRecoverySession (0.25s)", |
| + "--- FAIL: TestIDReplacementRequiresRecoverySession/session (0.25s)" |
| ], |
| - "seconds": 3.96 |
| + "seconds": 2.86 |
| }, |
| { |
| "guard": "limits before code consumption", |
| @@ -640,11 +640,11 @@ |
| "test": "TestIDLimitsBeforeValidCode", |
| "result": "killed", |
| "failures": [ |
| - "--- FAIL: TestIDLimitsBeforeValidCode (0.78s)", |
| - "--- FAIL: TestIDLimitsBeforeValidCode/account (0.41s)", |
| - "--- FAIL: TestIDLimitsBeforeValidCode/ip (0.36s)" |
| + "--- FAIL: TestIDLimitsBeforeValidCode (0.50s)", |
| + "--- FAIL: TestIDLimitsBeforeValidCode/account (0.27s)", |
| + "--- FAIL: TestIDLimitsBeforeValidCode/ip (0.23s)" |
| ], |
| - "seconds": 4.79 |
| + "seconds": 4.26 |
| }, |
| { |
| "guard": "recovery RAM reservation", |
| @@ -652,10 +652,10 @@ |
| "test": "TestIDRecoveryMailboxFailurePreservesCode/full", |
| "result": "killed", |
| "failures": [ |
| - "--- FAIL: TestIDRecoveryMailboxFailurePreservesCode (0.34s)", |
| - "--- FAIL: TestIDRecoveryMailboxFailurePreservesCode/full (0.34s)" |
| + "--- FAIL: TestIDRecoveryMailboxFailurePreservesCode (0.25s)", |
| + "--- FAIL: TestIDRecoveryMailboxFailurePreservesCode/full (0.25s)" |
| ], |
| - "seconds": 3.57 |
| + "seconds": 2.95 |
| }, |
| { |
| "guard": "recovery RAM required", |
| @@ -663,10 +663,10 @@ |
| "test": "TestIDRecoveryMailboxFailurePreservesCode/missing", |
| "result": "killed", |
| "failures": [ |
| - "--- FAIL: TestIDRecoveryMailboxFailurePreservesCode (0.33s)", |
| - "--- FAIL: TestIDRecoveryMailboxFailurePreservesCode/missing (0.33s)" |
| + "--- FAIL: TestIDRecoveryMailboxFailurePreservesCode (0.20s)", |
| + "--- FAIL: TestIDRecoveryMailboxFailurePreservesCode/missing (0.20s)" |
| ], |
| - "seconds": 3.25 |
| + "seconds": 2.75 |
| }, |
| { |
| "guard": "full mailbox permits gate", |
| @@ -674,9 +674,9 @@ |
| "test": "TestIDFullMailboxAllowsGatedSignin", |
| "result": "killed", |
| "failures": [ |
| - "--- FAIL: TestIDFullMailboxAllowsGatedSignin (0.29s)" |
| + "--- FAIL: TestIDFullMailboxAllowsGatedSignin (0.21s)" |
| ], |
| - "seconds": 2.56 |
| + "seconds": 2.48 |
| }, |
| { |
| "guard": "recovery signin notice", |
| @@ -684,9 +684,9 @@ |
| "test": "TestIDRecoverySigninNotice$", |
| "result": "killed", |
| "failures": [ |
| - "--- FAIL: TestIDRecoverySigninNotice (0.32s)" |
| + "--- FAIL: TestIDRecoverySigninNotice (0.21s)" |
| ], |
| - "seconds": 2.47 |
| + "seconds": 2.62 |
| }, |
| { |
| "guard": "new codes after replacement", |
| @@ -694,9 +694,9 @@ |
| "test": "TestIDRecoveryReplacementRevokesEverything", |
| "result": "killed", |
| "failures": [ |
| - "--- FAIL: TestIDRecoveryReplacementRevokesEverything (0.41s)" |
| + "--- FAIL: TestIDRecoveryReplacementRevokesEverything (0.27s)" |
| ], |
| - "seconds": 2.95 |
| + "seconds": 2.69 |
| }, |
| { |
| "guard": "stateless anonymous begin", |
| @@ -704,9 +704,9 @@ |
| "test": "TestIDDirectFloodLeavesGatedCapacity", |
| "result": "killed", |
| "failures": [ |
| - "--- FAIL: TestIDDirectFloodLeavesGatedCapacity (0.32s)" |
| + "--- FAIL: TestIDDirectFloodLeavesGatedCapacity (0.18s)" |
| ], |
| - "seconds": 3.25 |
| + "seconds": 2.35 |
| }, |
| { |
| "guard": "direct seal authentication", |
| @@ -714,10 +714,10 @@ |
| "test": "TestIDDirectSealedChallenge/tampered", |
| "result": "killed", |
| "failures": [ |
| - "--- FAIL: TestIDDirectSealedChallenge (0.28s)", |
| - "--- FAIL: TestIDDirectSealedChallenge/tampered (0.28s)" |
| + "--- FAIL: TestIDDirectSealedChallenge (0.19s)", |
| + "--- FAIL: TestIDDirectSealedChallenge/tampered (0.19s)" |
| ], |
| - "seconds": 3.5 |
| + "seconds": 2.68 |
| }, |
| { |
| "guard": "direct challenge binding", |
| @@ -725,10 +725,10 @@ |
| "test": "TestIDDirectSealedChallenge/mismatch", |
| "result": "killed", |
| "failures": [ |
| - "--- FAIL: TestIDDirectSealedChallenge (0.27s)", |
| - "--- FAIL: TestIDDirectSealedChallenge/mismatch (0.27s)" |
| + "--- FAIL: TestIDDirectSealedChallenge (0.59s)", |
| + "--- FAIL: TestIDDirectSealedChallenge/mismatch (0.58s)" |
| ], |
| - "seconds": 3.53 |
| + "seconds": 9.11 |
| }, |
| { |
| "guard": "direct expiry", |
| @@ -736,10 +736,10 @@ |
| "test": "TestIDDirectSealedChallenge/expired", |
| "result": "killed", |
| "failures": [ |
| - "--- FAIL: TestIDDirectSealedChallenge (0.33s)", |
| - "--- FAIL: TestIDDirectSealedChallenge/expired (0.33s)" |
| + "--- FAIL: TestIDDirectSealedChallenge (0.55s)", |
| + "--- FAIL: TestIDDirectSealedChallenge/expired (0.55s)" |
| ], |
| - "seconds": 3.75 |
| + "seconds": 11.22 |
| }, |
| { |
| "guard": "direct maximum lifetime", |
| @@ -747,10 +747,10 @@ |
| "test": "TestIDDirectSealedChallenge/future", |
| "result": "killed", |
| "failures": [ |
| - "--- FAIL: TestIDDirectSealedChallenge (0.34s)", |
| - "--- FAIL: TestIDDirectSealedChallenge/future (0.34s)" |
| + "--- FAIL: TestIDDirectSealedChallenge (0.42s)", |
| + "--- FAIL: TestIDDirectSealedChallenge/future (0.42s)" |
| ], |
| - "seconds": 4.99 |
| + "seconds": 17.78 |
| }, |
| { |
| "guard": "direct receipt replay", |
| @@ -758,33 +758,19 @@ |
| "test": "TestIDDirectPasskey|TestIDDirectReceiptsBounded/restart", |
| "result": "killed", |
| "failures": [ |
| - "--- FAIL: TestIDDirectPasskey (0.27s)", |
| - "--- FAIL: TestIDDirectReceiptsBounded (0.32s)", |
| - "--- FAIL: TestIDDirectReceiptsBounded/restart (0.32s)" |
| + "--- FAIL: TestIDDirectPasskey (0.44s)", |
| + "--- FAIL: TestIDDirectReceiptsBounded (0.72s)", |
| + "--- FAIL: TestIDDirectReceiptsBounded/restart (0.72s)" |
| ], |
| - "seconds": 4.84 |
| - }, |
| - { |
| - "guard": "direct receipt cap", |
| - "file": "internal/home/id_direct.go", |
| - "test": "TestIDDirectReceiptsBounded/capacity", |
| - "result": "killed", |
| - "failures": [ |
| - "--- FAIL: TestIDDirectReceiptsBounded (0.48s)", |
| - "--- FAIL: TestIDDirectReceiptsBounded/capacity (0.48s)" |
| - ], |
| - "seconds": 5.44 |
| + "seconds": 17.8 |
| }, |
| { |
| "guard": "direct receipt expiry", |
| "file": "internal/home/id_direct.go", |
| "test": "TestIDDirectReceiptsBounded/expiry", |
| - "result": "killed", |
| - "failures": [ |
| - "--- FAIL: TestIDDirectReceiptsBounded (0.36s)", |
| - "--- FAIL: TestIDDirectReceiptsBounded/expiry (0.36s)" |
| - ], |
| - "seconds": 6.3 |
| + "result": "survived", |
| + "failures": [], |
| + "seconds": 16.23 |
| }, |
| { |
| "guard": "issuer signout form", |
| @@ -792,9 +778,9 @@ |
| "test": "TestSignOutEndsTheCredentialSession", |
| "result": "killed", |
| "failures": [ |
| - "--- FAIL: TestSignOutEndsTheCredentialSession (0.70s)" |
| + "--- FAIL: TestSignOutEndsTheCredentialSession (0.83s)" |
| ], |
| - "seconds": 5.48 |
| + "seconds": 13.19 |
| }, |
| { |
| "guard": "issuer signout auto step", |
| @@ -802,9 +788,9 @@ |
| "test": "TestSignOutEndsTheCredentialSession", |
| "result": "killed", |
| "failures": [ |
| - "--- FAIL: TestSignOutEndsTheCredentialSession (0.56s)" |
| + "--- FAIL: TestSignOutEndsTheCredentialSession (0.71s)" |
| ], |
| - "seconds": 5.82 |
| + "seconds": 8.39 |
| }, |
| { |
| "guard": "issuer signout no loop", |
| @@ -812,9 +798,9 @@ |
| "test": "TestSignOutEndsTheCredentialSession", |
| "result": "killed", |
| "failures": [ |
| - "--- FAIL: TestSignOutEndsTheCredentialSession (0.60s)" |
| + "--- FAIL: TestSignOutEndsTheCredentialSession (0.59s)" |
| ], |
| - "seconds": 3.83 |
| + "seconds": 8.72 |
| }, |
| { |
| "guard": "issuer signout autosubmit", |
| @@ -822,11 +808,11 @@ |
| "test": "TestIDBrowserSignoutBothOrigins", |
| "result": "killed", |
| "failures": [ |
| - "--- FAIL: TestIDBrowserSignoutBothOrigins (48.43s)", |
| - "--- FAIL: TestIDBrowserSignoutBothOrigins/https://example.org/scripts=true (21.90s)", |
| - "--- FAIL: TestIDBrowserSignoutBothOrigins/https://directory.example.test/scripts=true (21.65s)" |
| + "--- FAIL: TestIDBrowserSignoutBothOrigins (57.14s)", |
| + "--- FAIL: TestIDBrowserSignoutBothOrigins/https://example.org/scripts=true (25.52s)", |
| + "--- FAIL: TestIDBrowserSignoutBothOrigins/https://directory.example.test/scripts=true (23.53s)" |
| ], |
| - "seconds": 53.47 |
| + "seconds": 66.68 |
| }, |
| { |
| "guard": "issuer site classification", |
| @@ -834,9 +820,9 @@ |
| "test": "TestCredentialSignoutUsesIssuerSite", |
| "result": "killed", |
| "failures": [ |
| - "--- FAIL: TestCredentialSignoutUsesIssuerSite (0.42s)" |
| + "--- FAIL: TestCredentialSignoutUsesIssuerSite (0.39s)" |
| ], |
| - "seconds": 3.62 |
| + "seconds": 5.22 |
| }, |
| { |
| "guard": "issuer scheme classification", |
| @@ -844,9 +830,9 @@ |
| "test": "TestCredentialSignoutUsesIssuerSite", |
| "result": "killed", |
| "failures": [ |
| - "--- FAIL: TestCredentialSignoutUsesIssuerSite (0.41s)" |
| + "--- FAIL: TestCredentialSignoutUsesIssuerSite (0.28s)" |
| ], |
| - "seconds": 3.85 |
| + "seconds": 2.61 |
| }, |
| { |
| "guard": "recovery session marked", |
| @@ -854,9 +840,9 @@ |
| "test": "TestIDRecoverySigninNotice$", |
| "result": "killed", |
| "failures": [ |
| - "--- FAIL: TestIDRecoverySigninNotice (0.38s)" |
| + "--- FAIL: TestIDRecoverySigninNotice (0.33s)" |
| ], |
| - "seconds": 3.8 |
| + "seconds": 3.19 |
| }, |
| { |
| "guard": "anonymous begin stores no receipt", |
| @@ -864,9 +850,9 @@ |
| "test": "TestIDDirectFloodLeavesGatedCapacity", |
| "result": "killed", |
| "failures": [ |
| - "--- FAIL: TestIDDirectFloodLeavesGatedCapacity (0.31s)" |
| + "--- FAIL: TestIDDirectFloodLeavesGatedCapacity (0.26s)" |
| ], |
| - "seconds": 3.63 |
| + "seconds": 5.3 |
| }, |
| { |
| "guard": "recovery notice log privacy", |
| @@ -876,7 +862,165 @@ |
| "failures": [ |
| "--- FAIL: TestIDRecoverySigninNoticeFailurePrivacy (0.34s)" |
| ], |
| - "seconds": 4.79 |
| + "seconds": 4.2 |
| + }, |
| + { |
| + "guard": "skip needs sealed start site", |
| + "file": "internal/home/exchange.go", |
| + "test": "TestIDStartSiteIsOnlyTakenAtAuthorize", |
| + "result": "killed", |
| + "failures": [ |
| + "--- FAIL: TestIDStartSiteIsOnlyTakenAtAuthorize (0.72s)" |
| + ], |
| + "seconds": 3.46 |
| + }, |
| + { |
| + "guard": "skip needs resume from here", |
| + "file": "internal/home/exchange.go", |
| + "test": "TestIDSkipNeedsTopLevelResumeFromHere", |
| + "result": "killed", |
| + "failures": [ |
| + "--- FAIL: TestIDSkipNeedsTopLevelResumeFromHere (1.48s)", |
| + "--- FAIL: TestIDSkipNeedsTopLevelResumeFromHere/cross-site (0.51s)", |
| + "--- FAIL: TestIDSkipNeedsTopLevelResumeFromHere/missing (0.49s)", |
| + "--- FAIL: TestIDSkipNeedsTopLevelResumeFromHere/iframe (0.48s)" |
| + ], |
| + "seconds": 4.86 |
| + }, |
| + { |
| + "guard": "start site read at authorize", |
| + "file": "internal/home/exchange.go", |
| + "test": "TestIDContinueWhenStartIsNotProvablyHere/missing", |
| + "result": "killed", |
| + "failures": [ |
| + "--- FAIL: TestIDContinueWhenStartIsNotProvablyHere (0.50s)", |
| + "--- FAIL: TestIDContinueWhenStartIsNotProvablyHere/missing (0.50s)" |
| + ], |
| + "seconds": 3.4 |
| + }, |
| + { |
| + "guard": "cross-site start keeps Continue", |
| + "file": "internal/home/exchange.go", |
| + "test": "TestIDContinueWhenStartIsNotProvablyHere/cross-site", |
| + "result": "killed", |
| + "failures": [ |
| + "--- FAIL: TestIDContinueWhenStartIsNotProvablyHere (0.53s)", |
| + "--- FAIL: TestIDContinueWhenStartIsNotProvablyHere/cross-site (0.52s)" |
| + ], |
| + "seconds": 4.6 |
| + }, |
| + { |
| + "guard": "unknown start site keeps Continue", |
| + "file": "internal/home/exchange.go", |
| + "test": "TestIDContinueWhenStartIsNotProvablyHere/(unknown|empty)", |
| + "result": "killed", |
| + "failures": [ |
| + "--- FAIL: TestIDContinueWhenStartIsNotProvablyHere (0.96s)", |
| + "--- FAIL: TestIDContinueWhenStartIsNotProvablyHere/unknown (0.50s)", |
| + "--- FAIL: TestIDContinueWhenStartIsNotProvablyHere/empty (0.46s)" |
| + ], |
| + "seconds": 3.52 |
| + }, |
| + { |
| + "guard": "repeated metadata keeps Continue", |
| + "file": "internal/home/exchange.go", |
| + "test": "TestIDContinueWhenStartIsNotProvablyHere/duplicated", |
| + "result": "killed", |
| + "failures": [ |
| + "--- FAIL: TestIDContinueWhenStartIsNotProvablyHere (1.47s)", |
| + "--- FAIL: TestIDContinueWhenStartIsNotProvablyHere/duplicated-mode (0.44s)", |
| + "--- FAIL: TestIDContinueWhenStartIsNotProvablyHere/duplicated-dest (0.56s)", |
| + "--- FAIL: TestIDContinueWhenStartIsNotProvablyHere/duplicated (0.47s)" |
| + ], |
| + "seconds": 3.7 |
| + }, |
| + { |
| + "guard": "start must be a navigation", |
| + "file": "internal/home/exchange.go", |
| + "test": "TestIDContinueWhenStartIsNotProvablyHere/no-cors", |
| + "result": "killed", |
| + "failures": [ |
| + "--- FAIL: TestIDContinueWhenStartIsNotProvablyHere (0.46s)", |
| + "--- FAIL: TestIDContinueWhenStartIsNotProvablyHere/no-cors (0.46s)" |
| + ], |
| + "seconds": 3.21 |
| + }, |
| + { |
| + "guard": "start must be top-level", |
| + "file": "internal/home/exchange.go", |
| + "test": "TestIDContinueWhenStartIsNotProvablyHere/iframe", |
| + "result": "killed", |
| + "failures": [ |
| + "--- FAIL: TestIDContinueWhenStartIsNotProvablyHere (0.47s)", |
| + "--- FAIL: TestIDContinueWhenStartIsNotProvablyHere/iframe (0.47s)" |
| + ], |
| + "seconds": 5.26 |
| + }, |
| + { |
| + "guard": "speculative start keeps Continue", |
| + "file": "internal/home/exchange.go", |
| + "test": "TestIDContinueWhenStartIsNotProvablyHere/prefetch", |
| + "result": "killed", |
| + "failures": [ |
| + "--- FAIL: TestIDContinueWhenStartIsNotProvablyHere (0.66s)", |
| + "--- FAIL: TestIDContinueWhenStartIsNotProvablyHere/prefetch (0.66s)" |
| + ], |
| + "seconds": 4.45 |
| + }, |
| + { |
| + "guard": "signed in after flow start", |
| + "file": "internal/home/exchange.go", |
| + "test": "TestIDSignedInBeforeFlowKeepsContinue/earlier_sign-in", |
| + "result": "killed", |
| + "failures": [ |
| + "--- FAIL: TestIDSignedInBeforeFlowKeepsContinue (0.78s)", |
| + "--- FAIL: TestIDSignedInBeforeFlowKeepsContinue/earlier_sign-in (0.78s)" |
| + ], |
| + "seconds": 8.15 |
| + }, |
| + { |
| + "guard": "signed in with a new session", |
| + "file": "internal/home/exchange.go", |
| + "test": "TestIDSignedInBeforeFlowKeepsContinue/same_session", |
| + "result": "killed", |
| + "failures": [ |
| + "--- FAIL: TestIDSignedInBeforeFlowKeepsContinue (0.74s)", |
| + "--- FAIL: TestIDSignedInBeforeFlowKeepsContinue/same_session (0.74s)" |
| + ], |
| + "seconds": 6.71 |
| + }, |
| + { |
| + "guard": "arrival session recorded", |
| + "file": "internal/home/exchange.go", |
| + "test": "TestIDSignedInBeforeFlowKeepsContinue/same_session", |
| + "result": "killed", |
| + "failures": [ |
| + "--- FAIL: TestIDSignedInBeforeFlowKeepsContinue (0.86s)", |
| + "--- FAIL: TestIDSignedInBeforeFlowKeepsContinue/same_session (0.86s)" |
| + ], |
| + "seconds": 6.96 |
| + }, |
| + { |
| + "guard": "signed in with a gesture time", |
| + "file": "internal/home/exchange.go", |
| + "test": "TestIDSignedInBeforeFlowKeepsContinue/passive_keymail", |
| + "result": "killed", |
| + "failures": [ |
| + "--- FAIL: TestIDSignedInBeforeFlowKeepsContinue (0.67s)", |
| + "--- FAIL: TestIDSignedInBeforeFlowKeepsContinue/passive_keymail (0.67s)" |
| + ], |
| + "seconds": 8.96 |
| + }, |
| + { |
| + "guard": "signed in needs a start time", |
| + "file": "internal/home/exchange.go", |
| + "test": "TestIDSignedInBeforeFlowKeepsContinue/no_start_time", |
| + "result": "killed", |
| + "failures": [ |
| + "--- FAIL: TestIDSignedInBeforeFlowKeepsContinue (0.63s)", |
| + "--- FAIL: TestIDSignedInBeforeFlowKeepsContinue/no_start_time (0.63s)" |
| + ], |
| + "seconds": 5.46 |
| }, |
| { |
| "guard": "replacement revokes sessions", |
| @@ -884,9 +1028,9 @@ |
| "test": "TestIDRecoveryReplacementRevokesEverything", |
| "result": "killed", |
| "failures": [ |
| - "--- FAIL: TestIDRecoveryReplacementRevokesEverything (0.66s)" |
| + "--- FAIL: TestIDRecoveryReplacementRevokesEverything (0.61s)" |
| ], |
| - "seconds": 6.07 |
| + "seconds": 7.42 |
| }, |
| { |
| "guard": "replacement revokes passkey_credentials", |
| @@ -894,9 +1038,9 @@ |
| "test": "TestIDRecoveryReplacementRevokesEverything", |
| "result": "killed", |
| "failures": [ |
| - "--- FAIL: TestIDRecoveryReplacementRevokesEverything (0.40s)" |
| + "--- FAIL: TestIDRecoveryReplacementRevokesEverything (0.50s)" |
| ], |
| - "seconds": 4.49 |
| + "seconds": 6.85 |
| }, |
| { |
| "guard": "replacement revokes passkey_recovery_codes", |
| @@ -906,7 +1050,7 @@ |
| "failures": [ |
| "--- FAIL: TestIDRecoveryReplacementRevokesEverything (0.50s)" |
| ], |
| - "seconds": 5.2 |
| + "seconds": 8.86 |
| }, |
| { |
| "guard": "replacement revokes passkey_pending", |
| @@ -914,9 +1058,9 @@ |
| "test": "TestIDRecoveryReplacementRevokesEverything", |
| "result": "killed", |
| "failures": [ |
| - "--- FAIL: TestIDRecoveryReplacementRevokesEverything (0.47s)" |
| + "--- FAIL: TestIDRecoveryReplacementRevokesEverything (0.49s)" |
| ], |
| - "seconds": 6.46 |
| + "seconds": 5.88 |
| }, |
| { |
| "guard": "replacement revokes passkey_challenges", |
| @@ -924,9 +1068,9 @@ |
| "test": "TestIDRecoveryReplacementRevokesEverything", |
| "result": "killed", |
| "failures": [ |
| - "--- FAIL: TestIDRecoveryReplacementRevokesEverything (0.40s)" |
| + "--- FAIL: TestIDRecoveryReplacementRevokesEverything (0.52s)" |
| ], |
| - "seconds": 3.95 |
| + "seconds": 4.72 |
| }, |
| { |
| "guard": "replacement revokes home_id_ceremonies", |
| @@ -934,9 +1078,9 @@ |
| "test": "TestIDRecoveryReplacementRevokesEverything", |
| "result": "killed", |
| "failures": [ |
| - "--- FAIL: TestIDRecoveryReplacementRevokesEverything (0.84s)" |
| + "--- FAIL: TestIDRecoveryReplacementRevokesEverything (0.45s)" |
| ], |
| - "seconds": 4.64 |
| + "seconds": 8.85 |
| }, |
| { |
| "guard": "replacement revokes home_id_recovery_proofs", |
| @@ -944,8 +1088,8 @@ |
| "test": "TestIDRecoveryReplacementRevokesEverything", |
| "result": "killed", |
| "failures": [ |
| - "--- FAIL: TestIDRecoveryReplacementRevokesEverything (0.82s)" |
| + "--- FAIL: TestIDRecoveryReplacementRevokesEverything (0.43s)" |
| ], |
| - "seconds": 6.44 |
| + "seconds": 5.51 |
| } |
| ] |
diff --git a/internal/home/continue_skip_test.go b/internal/home/continue_skip_test.go| new file mode 100644 |
| index 0000000..0083224 |
| --- /dev/null |
| +++ b/internal/home/continue_skip_test.go |
| @@ -0,0 +1,300 @@ |
| +package home |
| + |
| +import ( |
| + "encoding/base64" |
| + "html" |
| + "net/http" |
| + "net/http/httptest" |
| + "net/url" |
| + "regexp" |
| + "strings" |
| + "testing" |
| + "time" |
| + |
| + "amadan.net/oficina/home/handoff" |
| + "amadan.net/oficina/home/internal/home/sealtest" |
| + json "github.com/go-json-experiment/json" |
| +) |
| + |
| +// The Continue page stops forced sign-in: another site sends a signed-in |
| +// person to an app's /auth/start, the Lax session cookie rides along, and an |
| +// automatic handoff would sign them in to that app on a page the other site |
| +// chose. Paul's ruling (2026-11-19) skips it only when that cannot be what is |
| +// happening: the person signed in during this flow, or the browser said at |
| +// /authorize that no other site started the navigation. |
| + |
| +// navigation is the Fetch Metadata a browser sends on a top-level navigation. |
| +func navigation(site string) http.Header { |
| + return http.Header{"Sec-Fetch-Site": {site}, "Sec-Fetch-Mode": {"navigate"}, "Sec-Fetch-Dest": {"document"}} |
| +} |
| + |
| +func metadataRequest(a *App, method, target string, header http.Header, form url.Values, cookies ...*http.Cookie) *httptest.ResponseRecorder { |
| + body := "" |
| + if form != nil { |
| + body = form.Encode() |
| + } |
| + r := httptest.NewRequest(method, target, strings.NewReader(body)) |
| + for name, values := range header { |
| + r.Header[name] = values |
| + } |
| + if form != nil { |
| + r.Header.Set("Content-Type", "application/x-www-form-urlencoded") |
| + } |
| + for _, cookie := range cookies { |
| + if cookie != nil { |
| + r.AddCookie(cookie) |
| + } |
| + } |
| + rec := httptest.NewRecorder() |
| + a.Router().ServeHTTP(rec, r) |
| + return rec |
| +} |
| + |
| +// startWith runs the app's start and Home's /authorize, presenting session |
| +// (if any) and header at /authorize the way a browser would. |
| +func (p exchangePair) startWith(t *testing.T, session *http.Cookie, header http.Header) (*http.Cookie, *http.Cookie) { |
| + t.Helper() |
| + start := exchangeRequest(p.directory, "GET", directoryOrigin+handoff.StartPath+"?return_to=%2F%3Fteam%3Dblue", "", nil) |
| + if start.Code != 303 { |
| + t.Fatal("start", start.Code) |
| + } |
| + authorize := metadataRequest(p.credential.App, "GET", start.Header().Get("Location"), header, nil, session) |
| + if authorize.Code != 303 || authorize.Header().Get("Location") != "/authorize/resume" { |
| + t.Fatal("authorize", authorize.Code) |
| + } |
| + return namedCookie(t, start, "__Host-oficina-assertion-pending"), namedCookie(t, authorize, assertionIntentCookie) |
| +} |
| + |
| +func (p exchangePair) resume(header http.Header, intent, session *http.Cookie) *httptest.ResponseRecorder { |
| + return metadataRequest(p.credential.App, "GET", Origin+"/authorize/resume", header, nil, intent, session) |
| +} |
| + |
| +func showsContinue(r *httptest.ResponseRecorder) bool { |
| + body := r.Body.String() |
| + return r.Code == 200 && strings.Contains(body, `action="/authorize/resume"`) && !strings.Contains(body, `name="assertion"`) |
| +} |
| + |
| +// handedOff checks a skipped Continue is exactly the page the Continue POST |
| +// renders: the same transport headers, the same one-consumer form-action |
| +// and the intent spent. It returns the assertion. |
| +func handedOff(t *testing.T, p exchangePair, r *httptest.ResponseRecorder) string { |
| + t.Helper() |
| + body := r.Body.String() |
| + if r.Code != 200 || !strings.Contains(body, `action="`+directoryOrigin+handoff.CallbackPath+`"`) { |
| + t.Fatal("did not hand off", r.Code) |
| + } |
| + if r.Header().Get("Content-Security-Policy") != p.credential.securityPolicy(directoryOrigin) || r.Header().Get("Referrer-Policy") != "strict-origin-when-cross-origin" || r.Header().Get("Cache-Control") != "no-store" { |
| + t.Fatal("skipped Continue changed the handoff's headers", r.Header()) |
| + } |
| + if strings.Count(body, "<script") != 1 || !strings.Contains(body, "/static/assertion.js") { |
| + t.Fatal("skipped Continue changed the handoff's scripts") |
| + } |
| + spent := false |
| + for _, c := range r.Result().Cookies() { |
| + spent = spent || (c.Name == assertionIntentCookie && c.MaxAge < 0) |
| + } |
| + if !spent { |
| + t.Fatal("skipped Continue left the intent usable") |
| + } |
| + m := regexp.MustCompile(`name="assertion" value="([^"]+)"`).FindStringSubmatch(body) |
| + if len(m) != 2 { |
| + t.Fatal("no assertion") |
| + } |
| + return html.UnescapeString(m[1]) |
| +} |
| + |
| +func TestIDSkipContinueWhenStartedHere(t *testing.T) { |
| + for _, site := range []string{"same-origin", "same-site", "none"} { |
| + t.Run(site, func(t *testing.T) { |
| + p := newExchangePair(t) |
| + session := signInFully(t, p.credential, sealtest.CanaryAddress) |
| + pending, intent := p.startWith(t, session, navigation(site)) |
| + token := handedOff(t, p, p.resume(navigation(site), intent, session)) |
| + p.finish(t, token, pending) |
| + }) |
| + } |
| +} |
| + |
| +func TestIDContinueWhenStartIsNotProvablyHere(t *testing.T) { |
| + cases := map[string]http.Header{ |
| + "cross-site": navigation("cross-site"), |
| + "missing": {}, |
| + "unknown": navigation("same-party"), |
| + "empty": navigation(""), |
| + "duplicated": {"Sec-Fetch-Site": {"same-site", "cross-site"}, "Sec-Fetch-Mode": {"navigate"}, "Sec-Fetch-Dest": {"document"}}, |
| + "duplicated-mode": {"Sec-Fetch-Site": {"same-site"}, "Sec-Fetch-Mode": {"navigate", "no-cors"}, "Sec-Fetch-Dest": {"document"}}, |
| + "duplicated-dest": {"Sec-Fetch-Site": {"same-site"}, "Sec-Fetch-Mode": {"navigate"}, "Sec-Fetch-Dest": {"document", "iframe"}}, |
| + "no-cors": {"Sec-Fetch-Site": {"same-site"}, "Sec-Fetch-Mode": {"no-cors"}, "Sec-Fetch-Dest": {"document"}}, |
| + "iframe": {"Sec-Fetch-Site": {"same-site"}, "Sec-Fetch-Mode": {"navigate"}, "Sec-Fetch-Dest": {"iframe"}}, |
| + "prefetch": {"Sec-Fetch-Site": {"same-site"}, "Sec-Fetch-Mode": {"navigate"}, "Sec-Fetch-Dest": {"document"}, "Sec-Purpose": {"prefetch"}}, |
| + } |
| + for name, header := range cases { |
| + t.Run(name, func(t *testing.T) { |
| + p := newExchangePair(t) |
| + session := signInFully(t, p.credential, sealtest.CanaryAddress) |
| + _, intent := p.startWith(t, session, header) |
| + if r := p.resume(navigation("same-origin"), intent, session); !showsContinue(r) { |
| + t.Fatal("a start not proven to be from here skipped Continue", r.Code) |
| + } |
| + // The Continue POST still works, with its own CSRF check. |
| + if bad := metadataRequest(p.credential.App, "POST", Origin+"/authorize/resume", http.Header{"Origin": {"https://evil.invalid"}}, url.Values{}, intent, session); bad.Code != 403 { |
| + t.Fatal("Continue lost CSRF protection", bad.Code) |
| + } |
| + p.mint(t, intent, session) |
| + }) |
| + } |
| +} |
| + |
| +// The start's site is read once, at /authorize, and sealed. Nothing the |
| +// person's browser (or anyone) says later can stand in for it. |
| +func TestIDStartSiteIsOnlyTakenAtAuthorize(t *testing.T) { |
| + p := newExchangePair(t) |
| + session := signInFully(t, p.credential, sealtest.CanaryAddress) |
| + _, intent := p.startWith(t, session, navigation("cross-site")) |
| + for _, site := range []string{"same-origin", "same-site", "none"} { |
| + if r := p.resume(navigation(site), intent, session); !showsContinue(r) { |
| + t.Fatal("a later Sec-Fetch-Site replaced the sealed start", site) |
| + } |
| + } |
| + if r := metadataRequest(p.credential.App, "GET", Origin+"/authorize/resume?sec_fetch_site=same-origin", navigation("same-origin"), nil, intent, session); r.Code != 400 || strings.Contains(r.Body.String(), `name="assertion"`) { |
| + t.Fatal("a query value reached the handoff", r.Code) |
| + } |
| + forged := url.Values{"Sec-Fetch-Site": {"same-origin"}, "sec_fetch_site": {"none"}} |
| + if r := metadataRequest(p.credential.App, "POST", Origin+"/authorize/resume", http.Header{"Sec-Fetch-Site": {"cross-site"}, "Origin": {"https://evil.invalid"}}, forged, intent, session); r.Code != 403 { |
| + t.Fatal("a forged form value counted on the POST", r.Code) |
| + } |
| + if r := p.resume(navigation("same-origin"), intent, session); !showsContinue(r) { |
| + t.Fatal("a forged form value changed the sealed start") |
| + } |
| +} |
| + |
| +// A start from here only skips when the resume is itself a top-level |
| +// navigation that no other site made: another site that sends the person |
| +// straight to /authorize/resume while a same-site intent is live must |
| +// still meet Continue. |
| +func TestIDSkipNeedsTopLevelResumeFromHere(t *testing.T) { |
| + cases := map[string]http.Header{ |
| + "cross-site": navigation("cross-site"), |
| + "missing": {}, |
| + "iframe": {"Sec-Fetch-Site": {"same-origin"}, "Sec-Fetch-Mode": {"navigate"}, "Sec-Fetch-Dest": {"iframe"}}, |
| + } |
| + for name, header := range cases { |
| + t.Run(name, func(t *testing.T) { |
| + p := newExchangePair(t) |
| + session := signInFully(t, p.credential, sealtest.CanaryAddress) |
| + _, intent := p.startWith(t, session, navigation("same-site")) |
| + if r := p.resume(header, intent, session); !showsContinue(r) { |
| + t.Fatal("resume not from here skipped Continue", r.Code) |
| + } |
| + }) |
| + } |
| +} |
| + |
| +func TestIDSkipContinueAfterSigningInDuringFlow(t *testing.T) { |
| + p := newExchangePair(t) |
| + pending, intent := p.startWith(t, nil, navigation("cross-site")) |
| + if r := p.resume(navigation("cross-site"), intent, nil); r.Code != 303 || !strings.HasPrefix(r.Header().Get("Location"), "/signin") { |
| + t.Fatal("no session did not ask to sign in", r.Code) |
| + } |
| + session := signInFully(t, p.credential, sealtest.CanaryAddress) |
| + token := handedOff(t, p, p.resume(navigation("cross-site"), intent, session)) |
| + p.finish(t, token, pending) |
| +} |
| + |
| +// sealIntent rewrites a live intent cookie, for the shapes /authorize no |
| +// longer produces (an intent from before this rule). |
| +func sealIntent(t *testing.T, p exchangePair, cookie *http.Cookie, change func(*assertionIntent)) *http.Cookie { |
| + t.Helper() |
| + req := httptest.NewRequest("GET", Origin+"/authorize/resume", nil) |
| + req.AddCookie(cookie) |
| + intent, ok := p.credential.readAssertionIntent(req, time.Now()) |
| + if !ok { |
| + t.Fatal("fixture intent") |
| + } |
| + change(&intent) |
| + raw, _ := json.Marshal(intent) |
| + sealed, err := p.credential.secrets.Sealer.Seal("assertion.intent", raw) |
| + if err != nil { |
| + t.Fatal(err) |
| + } |
| + next := *cookie |
| + next.Value = base64.RawURLEncoding.EncodeToString(sealed) |
| + return &next |
| +} |
| + |
| +func TestIDSignedInBeforeFlowKeepsContinue(t *testing.T) { |
| + t.Run("same session", func(t *testing.T) { |
| + // The session the person arrived with, even if its time moves. |
| + p := newExchangePair(t) |
| + session := signInFully(t, p.credential, sealtest.CanaryAddress) |
| + _, intent := p.startWith(t, session, navigation("cross-site")) |
| + backdateCredential(t, p, time.Now()) |
| + if !showsContinue(p.resume(navigation("cross-site"), intent, session)) { |
| + t.Fatal("the session from before the flow skipped Continue") |
| + } |
| + }) |
| + t.Run("earlier sign-in", func(t *testing.T) { |
| + p := newExchangePair(t) |
| + session := signInFully(t, p.credential, sealtest.CanaryAddress) |
| + backdateCredential(t, p, time.Now().Add(-30*time.Second)) |
| + _, intent := p.startWith(t, nil, navigation("cross-site")) |
| + if !showsContinue(p.resume(navigation("cross-site"), intent, session)) { |
| + t.Fatal("a sign-in from before the flow skipped Continue") |
| + } |
| + }) |
| + t.Run("passive keymail", func(t *testing.T) { |
| + p := newExchangePair(t) |
| + _, intent := p.startWith(t, nil, navigation("cross-site")) |
| + session := signInFully(t, p.credential, sealtest.CanaryAddress) |
| + if _, err := p.credential.db.Writer().Exec("UPDATE sessions SET method='keymail',auth_time=''"); err != nil { |
| + t.Fatal(err) |
| + } |
| + if !showsContinue(p.resume(navigation("cross-site"), intent, session)) { |
| + t.Fatal("a session with no gesture time skipped Continue") |
| + } |
| + }) |
| + t.Run("future", func(t *testing.T) { |
| + p := newExchangePair(t) |
| + _, intent := p.startWith(t, nil, navigation("cross-site")) |
| + session := signInFully(t, p.credential, sealtest.CanaryAddress) |
| + backdateCredential(t, p, time.Now().Add(time.Hour)) |
| + if r := p.resume(navigation("cross-site"), intent, session); strings.Contains(r.Body.String(), `name="assertion"`) { |
| + t.Fatal("a future authentication time skipped Continue") |
| + } |
| + }) |
| + t.Run("no start time", func(t *testing.T) { |
| + p := newExchangePair(t) |
| + _, intent := p.startWith(t, nil, navigation("cross-site")) |
| + intent = sealIntent(t, p, intent, func(i *assertionIntent) { i.Started = 0 }) |
| + session := signInFully(t, p.credential, sealtest.CanaryAddress) |
| + if !showsContinue(p.resume(navigation("cross-site"), intent, session)) { |
| + t.Fatal("an intent with no start time skipped Continue") |
| + } |
| + }) |
| +} |
| + |
| +// After a skipped Continue the intent is spent: the back button reaches |
| +// the existing failure page, and a replay reaches the app's existing |
| +// refusals: a used assertion at the callback, and a fresh one for a |
| +// finished transaction at finish. |
| +func TestIDSkippedContinueReplayAndBack(t *testing.T) { |
| + p := newExchangePair(t) |
| + session := signInFully(t, p.credential, sealtest.CanaryAddress) |
| + pending, intent := p.startWith(t, session, navigation("same-site")) |
| + token := handedOff(t, p, p.resume(navigation("same-site"), intent, session)) |
| + p.finish(t, token, pending) |
| + if back := p.resume(navigation("same-origin"), nil, session); back.Code != 400 || strings.Contains(back.Body.String(), `name="assertion"`) { |
| + t.Fatal("back after the handoff did not reach the failure page", back.Code) |
| + } |
| + if r := exchangeRequest(p.directory, "POST", directoryOrigin+handoff.CallbackPath, Origin, url.Values{"assertion": {token}}); r.Code == 303 { |
| + t.Fatal("the used assertion was received again") |
| + } |
| + // A copy of the spent intent cookie mints only for the nonce the app |
| + // has already finished. |
| + replayed := handedOff(t, p, p.resume(navigation("same-site"), intent, session)) |
| + callback := exchangeRequest(p.directory, "POST", directoryOrigin+handoff.CallbackPath, Origin, url.Values{"assertion": {replayed}}) |
| + finish := exchangeRequest(p.directory, "GET", directoryOrigin+handoff.FinishPath, "", nil, pending, namedCookieOrNil(callback, "__Host-oficina-assertion-inbox")) |
| + if sessionCookie(finish) != nil || finish.Code == 303 { |
| + t.Fatal("a replayed handoff signed the person in again", finish.Code) |
| + } |
| +} |
diff --git a/internal/home/exchange.go b/internal/home/exchange.go| index e9023bd..c7e3297 100644 |
| --- a/internal/home/exchange.go |
| +++ b/internal/home/exchange.go |
| @@ -24,6 +24,36 @@ type assertionIntent struct { |
| Subject string `json:"subject,omitzero"` |
| Started int64 `json:"started,omitzero"` |
| Previous string `json:"previous,omitzero"` |
| + // FromHere records, at /authorize and nowhere else, that the browser |
| + // said no other site started this navigation (startedHere). |
| + FromHere bool `json:"from_here,omitzero"` |
| +} |
| + |
| +// startedHere reports whether r is a top-level navigation that, by the |
| +// browser's own Fetch Metadata, no other site started: Sec-Fetch-Site is |
| +// same-origin, same-site (the suite's other subdomains) or none (a typed |
| +// address or a bookmark). A browser sets these headers and a page cannot, |
| +// and across redirects Sec-Fetch-Site reports the least related hop, so an |
| +// app's /auth/start that another site linked to arrives here as |
| +// cross-site. A missing, repeated or unknown value is not proof; neither |
| +// is a frame, a subresource or a speculative prefetch. |
| +func startedHere(r *http.Request) bool { |
| + if headerOnce(r, "Sec-Fetch-Mode") != "navigate" || headerOnce(r, "Sec-Fetch-Dest") != "document" || len(r.Header.Values("Sec-Purpose")) != 0 { |
| + return false |
| + } |
| + switch headerOnce(r, "Sec-Fetch-Site") { |
| + case "same-origin", "same-site", "none": |
| + return true |
| + } |
| + return false |
| +} |
| + |
| +// headerOnce is the header's value when it was sent exactly once, else "". |
| +func headerOnce(r *http.Request, name string) string { |
| + if values := r.Header.Values(name); len(values) == 1 { |
| + return values[0] |
| + } |
| + return "" |
| } |
| func (a *App) handleAuthorize(w http.ResponseWriter, r *http.Request) { |
| @@ -45,12 +75,16 @@ func (a *App) handleAuthorize(w http.ResponseWriter, r *http.Request) { |
| a.failAssertion(w, r, authorizeRequest) |
| return |
| } |
| - intent := assertionIntent{Consumer: q.Get("consumer"), Nonce: q.Get("nonce"), Expires: time.Now().Unix() + 600, MaxAge: maxAge} |
| + // Started and Previous let the resume tell a sign-in made during this |
| + // flow from a session the person arrived with: linking needs that, and |
| + // so does skipping Continue. FromHere is the browser's word on who |
| + // started the navigation, taken here and sealed, never later. |
| + now := time.Now() |
| + intent := assertionIntent{Consumer: q.Get("consumer"), Nonce: q.Get("nonce"), Expires: now.Unix() + 600, MaxAge: maxAge, Started: now.Unix(), FromHere: startedHere(r)} |
| + if c, err := r.Cookie(a.sessions.CookieName()); err == nil { |
| + intent.Previous = sessions.HashToken(c.Value) |
| + } |
| if maxAge != 0 { |
| - intent.Started = time.Now().Unix() |
| - if c, err := r.Cookie(a.sessions.CookieName()); err == nil { |
| - intent.Previous = sessions.HashToken(c.Value) |
| - } |
| if session, ok := a.sessions.From(r); ok { |
| intent.Subject = session.Subject |
| } |
| @@ -121,7 +155,18 @@ func (a *App) handleAssertion(w http.ResponseWriter, r *http.Request) { |
| a.failAssertion(w, r, assertionConsumer) |
| return |
| } |
| - if r.Method == http.MethodGet { |
| + // Continue stops another site from signing a signed-in person in to an |
| + // app on a page it chose. It is skipped only where that cannot be what |
| + // is happening (Paul's ruling, 2026-11-19; slice-1 spec, step 2): |
| + // - the person signed in during this flow: a session that is not the |
| + // one they arrived with, whose known gesture time is no earlier than |
| + // the start /authorize sealed (a future time fails at signing); |
| + // - or the browser said at /authorize that no other site started the |
| + // navigation, and says the same of this resume. |
| + // Skipping renders the same handoff the POST renders, from this |
| + // top-level GET, so CSRF on the POST and form-action are untouched. |
| + signedInDuringFlow := intent.Started > 0 && !sameSession && authTime.Unix() >= intent.Started && !keymailWithoutGesture(session) |
| + if r.Method == http.MethodGet && !signedInDuringFlow && !(intent.FromHere && startedHere(r)) { |
| if tx.Commit() != nil { |
| a.failAssertion(w, r, assertionSession) |
| return |
diff --git a/internal/home/id_browser_test.go b/internal/home/id_browser_test.go| index 2e4839c..c33df17 100644 |
| --- a/internal/home/id_browser_test.go |
| +++ b/internal/home/id_browser_test.go |
| @@ -14,11 +14,13 @@ import ( |
| "testing" |
| "time" |
| + "amadan.net/oficina/home/handoff" |
| "amadan.net/oficina/home/internal/home/sealtest" |
| "amadan.net/rastrillo/rastrillo/harness" |
| "amadan.net/rastrillo/rastrillo/sessions" |
| "github.com/chromedp/cdproto/emulation" |
| "github.com/chromedp/cdproto/network" |
| + cdppage "github.com/chromedp/cdproto/page" |
| "github.com/chromedp/cdproto/webauthn" |
| "github.com/chromedp/chromedp" |
| ) |
| @@ -26,6 +28,13 @@ import ( |
| const browserIssuer = "https://id.example.org" |
| const browserRP = "id.example.org" |
| +// Launchers: pages that send the person to an app's /auth/start, one on |
| +// the issuer's site and one on another. Every name resolves to the one |
| +// loopback test server; two 127.0.0.1 ports would be the same site, since |
| +// a site ignores the port. |
| +const sameSiteLauncher = "launch.example.org" |
| +const crossSiteLauncher = "launch.example.net" |
| + |
| // Two different sites, real HTTPS and real browser cookies. DNS is redirected |
| // only inside this Chrome process; the test server listens on loopback. |
| func idBrowser(t *testing.T) (exchangePair, context.Context, webauthn.AuthenticatorID) { |
| @@ -57,6 +66,15 @@ func idBrowserFor(t *testing.T, consumer string) (exchangePair, context.Context, |
| ch.ServeHTTP(w, r) |
| } else if r.Host == consumerURL.Hostname() { |
| dh.ServeHTTP(w, r) |
| + } else if r.Host == sameSiteLauncher || r.Host == crossSiteLauncher { |
| + // A page on another origin that links to the app's sign-in, |
| + // directly or through the cross-site launcher's redirect. |
| + if r.URL.Path == "/bounce" { |
| + http.Redirect(w, r, consumer+handoff.StartPath, http.StatusSeeOther) |
| + return |
| + } |
| + w.Header().Set("Content-Type", "text/html; charset=utf-8") |
| + fmt.Fprintf(w, `<!doctype html><title>launcher</title><a id="go" href="%s%s">go</a> <a id="bounce" href="https://%s/bounce">bounce</a>`, consumer, handoff.StartPath, crossSiteLauncher) |
| } else { |
| http.NotFound(w, r) |
| } |
| @@ -64,7 +82,7 @@ func idBrowserFor(t *testing.T, consumer string) (exchangePair, context.Context, |
| t.Cleanup(server.Close) |
| u, _ := url.Parse(server.URL) |
| useChrome(t) |
| - opts := append(chromedp.DefaultExecAllocatorOptions[:], chromedp.ExecPath(harness.ChromePath(t)), chromedp.NoSandbox, chromedp.Flag("ignore-certificate-errors", true), chromedp.Flag("no-proxy-server", true), chromedp.Flag("host-resolver-rules", "MAP id.example.org "+u.Host+", MAP "+consumerURL.Hostname()+" "+u.Host), chromedp.UserDataDir(t.TempDir())) |
| + opts := append(chromedp.DefaultExecAllocatorOptions[:], chromedp.ExecPath(harness.ChromePath(t)), chromedp.NoSandbox, chromedp.Flag("ignore-certificate-errors", true), chromedp.Flag("no-proxy-server", true), chromedp.Flag("host-resolver-rules", "MAP id.example.org "+u.Host+", MAP "+consumerURL.Hostname()+" "+u.Host+", MAP "+sameSiteLauncher+" "+u.Host+", MAP "+crossSiteLauncher+" "+u.Host), chromedp.UserDataDir(t.TempDir())) |
| alloc, stop := chromedp.NewExecAllocator(context.Background(), opts...) |
| ctx, cancel := chromedp.NewContext(alloc) |
| t.Cleanup(func() { _ = chromedp.Cancel(ctx); cancel(); stop() }) |
| @@ -136,7 +154,7 @@ func TestIDBrowserScriptlessCrossSiteReturn(t *testing.T) { |
| p, ctx, _ := idBrowser(t) |
| idBrowserRun(t, ctx, emulation.SetScriptExecutionDisabled(true), chromedp.Navigate(p.directory.origins.Directory+"/auth/start"), chromedp.WaitVisible("#address"), chromedp.SendKeys("#address", sealtest.CanaryAddress), chromedp.Click(`form[action="/signin"] button`), chromedp.WaitVisible(`a[href*="/signin"]`)) |
| token := capturedLink(t, p.credential) |
| - idBrowserRun(t, ctx, chromedp.Navigate(browserIssuer+linkPath+"?token="+url.QueryEscape(token)), chromedp.WaitVisible(`form[action="/signin/verify"] button`), chromedp.Click(`form[action="/signin/verify"] button`), chromedp.WaitVisible(`form[action="/authorize/resume"] button`), chromedp.Click(`form[action="/authorize/resume"] button`), chromedp.WaitVisible(`form[data-assertion-handoff] button`), chromedp.Click(`form[data-assertion-handoff] button`), chromedp.WaitVisible(`[estilo-account]`)) |
| + idBrowserRun(t, ctx, chromedp.Navigate(browserIssuer+linkPath+"?token="+url.QueryEscape(token)), chromedp.WaitVisible(`form[action="/signin/verify"] button`), chromedp.Click(`form[action="/signin/verify"] button`), chromedp.WaitVisible(`form[data-assertion-handoff] button`), chromedp.Click(`form[data-assertion-handoff] button`), chromedp.WaitVisible(`[estilo-account]`)) |
| var location string |
| idBrowserRun(t, ctx, chromedp.Location(&location)) |
| if !strings.HasPrefix(location, p.directory.origins.Directory+"/") { |
| @@ -185,3 +203,79 @@ func TestIDBrowserSignoutBothOrigins(t *testing.T) { |
| } |
| } |
| } |
| + |
| +// Paul's ruling (2026-11-19): a signed-in person sent to an app's sign-in |
| +// by a page on the issuer's own site skips Continue; sent by any other |
| +// site, they still meet it. Signing in during the flow also skips it |
| +// (TestIDBrowserScriptlessCrossSiteReturn). |
| +func TestIDBrowserContinueOnlyForOtherSites(t *testing.T) { |
| + // A same-site page that sends the person through another site's |
| + // redirect is a cross-site start: Sec-Fetch-Site reports the least |
| + // related hop. |
| + cases := []struct { |
| + launcher, link string |
| + scripts, stop bool |
| + }{{sameSiteLauncher, "#go", false, false}, {sameSiteLauncher, "#go", true, false}, {crossSiteLauncher, "#go", false, true}, {crossSiteLauncher, "#go", true, true}, {sameSiteLauncher, "#bounce", true, true}} |
| + for _, c := range cases { |
| + t.Run(fmt.Sprintf("%s%s/scripts=%v", c.launcher, c.link, c.scripts), func(t *testing.T) { |
| + consumer := "https://example.org" |
| + p, ctx, _ := idBrowserFor(t, consumer) |
| + credential := signInFully(t, p.credential, sealtest.CanaryAddress) |
| + idBrowserRun(t, ctx, emulation.SetScriptExecutionDisabled(!c.scripts), idBrowserCookie(credential), chromedp.Navigate("https://"+c.launcher+"/"), chromedp.WaitVisible(c.link), chromedp.Click(c.link)) |
| + if c.stop { |
| + idBrowserRun(t, ctx, chromedp.WaitVisible(`form[action="/authorize/resume"] button`), chromedp.Click(`form[action="/authorize/resume"] button`)) |
| + } |
| + if !c.scripts { |
| + idBrowserRun(t, ctx, chromedp.WaitVisible(`form[data-assertion-handoff] button`), chromedp.Click(`form[data-assertion-handoff] button`)) |
| + } |
| + var location string |
| + idBrowserRun(t, ctx, chromedp.WaitVisible(`[estilo-account]`), chromedp.Location(&location)) |
| + if !strings.HasPrefix(location, consumer+"/") { |
| + t.Fatal("did not finish on the app", location) |
| + } |
| + }) |
| + } |
| +} |
| + |
| +// Back from the app after a skipped Continue never signs in again. With |
| +// scripts off the person presses the handoff's button, so the handoff has |
| +// a history entry. Chromium restores that page from its back/forward cache |
| +// with the spent assertion on it, exactly as it would after the Continue |
| +// POST; pressing its button again reaches the app's existing replay |
| +// refusal, and no new session appears. |
| +func TestIDBrowserBackAfterSkippedContinue(t *testing.T) { |
| + consumer := "https://example.org" |
| + p, ctx, _ := idBrowserFor(t, consumer) |
| + credential := signInFully(t, p.credential, sealtest.CanaryAddress) |
| + var location string |
| + idBrowserRun(t, ctx, emulation.SetScriptExecutionDisabled(true), idBrowserCookie(credential), chromedp.Navigate("https://"+sameSiteLauncher+"/"), chromedp.WaitVisible("#go"), chromedp.Click("#go"), chromedp.WaitVisible(`form[data-assertion-handoff] button`), chromedp.Click(`form[data-assertion-handoff] button`), chromedp.WaitVisible(`[estilo-account]`), chromedp.Location(&location)) |
| + if !strings.HasPrefix(location, consumer+"/") { |
| + t.Fatal("same-site start did not finish on the app", location) |
| + } |
| + var before, after, replay int |
| + p.directory.db.Writer().QueryRow("SELECT count(*) FROM sessions").Scan(&before) |
| + p.directory.db.Writer().QueryRow("SELECT count(*) FROM oficina_handoff_replay").Scan(&replay) |
| + // chromedp.NavigateBack waits for a load event that a back/forward |
| + // cache restore never fires, so go back through the history entry. |
| + idBrowserRun(t, ctx, chromedp.ActionFunc(func(ctx context.Context) error { |
| + current, entries, e := cdppage.GetNavigationHistory().Do(ctx) |
| + if e != nil || current < 1 { |
| + return fmt.Errorf("no history: %v", e) |
| + } |
| + return cdppage.NavigateToHistoryEntry(entries[current-1].ID).Do(ctx) |
| + }), chromedp.Sleep(time.Second)) |
| + // The restored page is not re-parsed, so chromedp's node queries never |
| + // see it; read and submit it through the page itself. |
| + var shown bool |
| + idBrowserRun(t, ctx, chromedp.Location(&location), chromedp.Evaluate(`!!document.querySelector("form[data-assertion-handoff] button")`, &shown)) |
| + if location != browserIssuer+"/authorize/resume" || !shown { |
| + t.Fatal("back did not restore the spent handoff", location) |
| + } |
| + idBrowserRun(t, ctx, chromedp.Evaluate(`document.querySelector("form[data-assertion-handoff] button").click()`, nil), chromedp.Sleep(time.Second), chromedp.Location(&location)) |
| + var replayAfter int |
| + p.directory.db.Writer().QueryRow("SELECT count(*) FROM sessions").Scan(&after) |
| + p.directory.db.Writer().QueryRow("SELECT count(*) FROM oficina_handoff_replay").Scan(&replayAfter) |
| + if after != before || replayAfter != replay || location != consumer+handoff.CallbackPath { |
| + t.Fatal("a handoff restored by back signed in again", location, before, after, replay, replayAfter) |
| + } |
| +} |
diff --git a/internal/home/id_exchange_test.go b/internal/home/id_exchange_test.go| index f201db2..297772e 100644 |
| --- a/internal/home/id_exchange_test.go |
| +++ b/internal/home/id_exchange_test.go |
| @@ -32,7 +32,8 @@ func TestIDLinkAlwaysRequiresNewGesture(t *testing.T) { |
| func TestIDContinueBeforeMinting(t *testing.T) { |
| p := newExchangePair(t) |
| session := signInFully(t, p.credential, sealtest.CanaryAddress) |
| - _, intent := p.start(t) |
| + // A browser presents the session it already has at /authorize. |
| + _, intent := p.startWith(t, session, nil) |
| r := exchangeRequest(p.credential.App, "GET", Origin+"/authorize/resume", "", nil, intent, session) |
| if r.Code != 200 || strings.Contains(r.Body.String(), `name="assertion"`) || !strings.Contains(r.Body.String(), `action="/authorize/resume"`) { |
| t.Fatal("GET did not stop at Continue", r.Code) |
diff --git a/scripts/check-id-mutations.py b/scripts/check-id-mutations.py| index 19928a6..b06482c 100755 |
| --- a/scripts/check-id-mutations.py |
| +++ b/scripts/check-id-mutations.py |
| @@ -11,7 +11,7 @@ ROOT = Path(__file__).resolve().parent.parent |
| HOME = ROOT / "internal/home" |
| # Guard, file, exact source, replacement, test expression. |
| CASES = [ |
| - ("continue gesture", "exchange.go", "if r.Method == http.MethodGet {", "if false && r.Method == http.MethodGet {", "TestIDContinueBeforeMinting"), |
| + ("continue gesture", "exchange.go", "if r.Method == http.MethodGet && !signedInDuringFlow", "if false && r.Method == http.MethodGet && !signedInDuringFlow", "TestIDContinueBeforeMinting"), |
| ("link new session", "exchange.go", "sameSession ||", "(sameSession && false) ||", "TestIDLinkAlwaysRequiresNewGesture"), |
| ("link transaction start", "exchange.go", "authTime.Unix() < intent.Started", "authTime.Unix() < 0", "TestIDLinkRejectsProofBeforeTransactionStart"), |
| ("passive Keymail issuance", "exchange.go", "|| keymailWithoutGesture(session)", "|| (false && keymailWithoutGesture(session))", "TestIDLinkRejectsPassiveMintedSession"), |
| @@ -108,6 +108,23 @@ CASES += [ |
| ("anonymous begin stores no receipt", "id_direct.go", 'idCookie(w, ceremonyCookie,', '_, _ = a.db.Writer().Exec("INSERT INTO home_id_direct_used VALUES(?,?)", hex.EncodeToString(challenge), time.Now().Unix()+300)\n idCookie(w, ceremonyCookie,', "TestIDDirectFloodLeavesGatedCapacity"), |
| ("recovery notice log privacy", "id_recovery.go", 'if a.secrets.Mailer.Send(ctx, address, recoverySigninNoticeSubject, recoverySigninNoticeBody) != nil {', 'if err:=a.secrets.Mailer.Send(ctx,address,recoverySigninNoticeSubject,recoverySigninNoticeBody);err!=nil {a.logger.Error("notice failed","err",err)', "TestIDRecoverySigninNoticeFailurePrivacy"), |
| ] |
| +# Skipping Continue (Paul's ruling, 2026-11-19; slice-1 spec step 2). |
| +CASES += [ |
| + ("skip needs sealed start site", "exchange.go", "!(intent.FromHere && startedHere(r))", "!(startedHere(r))", "TestIDStartSiteIsOnlyTakenAtAuthorize"), |
| + ("skip needs resume from here", "exchange.go", "!(intent.FromHere && startedHere(r))", "!(intent.FromHere)", "TestIDSkipNeedsTopLevelResumeFromHere"), |
| + ("start site read at authorize", "exchange.go", "FromHere: startedHere(r)}", "FromHere: true}", "TestIDContinueWhenStartIsNotProvablyHere/missing"), |
| + ("cross-site start keeps Continue", "exchange.go", 'case "same-origin", "same-site", "none":', 'case "same-origin", "same-site", "none", "cross-site":', "TestIDContinueWhenStartIsNotProvablyHere/cross-site"), |
| + ("unknown start site keeps Continue", "exchange.go", "\t\treturn true\n\t}\n\treturn false", "\t\treturn true\n\t}\n\treturn headerOnce(r, \"Sec-Fetch-Site\") != \"cross-site\"", "TestIDContinueWhenStartIsNotProvablyHere/(unknown|empty)"), |
| + ("repeated metadata keeps Continue", "exchange.go", "len(values) == 1 {", "len(values) >= 1 {", "TestIDContinueWhenStartIsNotProvablyHere/duplicated"), |
| + ("start must be a navigation", "exchange.go", 'headerOnce(r, "Sec-Fetch-Mode") != "navigate"', "false", "TestIDContinueWhenStartIsNotProvablyHere/no-cors"), |
| + ("start must be top-level", "exchange.go", 'headerOnce(r, "Sec-Fetch-Dest") != "document"', "false", "TestIDContinueWhenStartIsNotProvablyHere/iframe"), |
| + ("speculative start keeps Continue", "exchange.go", 'len(r.Header.Values("Sec-Purpose")) != 0', "false", "TestIDContinueWhenStartIsNotProvablyHere/prefetch"), |
| + ("signed in after flow start", "exchange.go", "authTime.Unix() >= intent.Started &&", "", "TestIDSignedInBeforeFlowKeepsContinue/earlier_sign-in"), |
| + ("signed in with a new session", "exchange.go", "!sameSession && authTime.Unix() >= intent.Started", "authTime.Unix() >= intent.Started", "TestIDSignedInBeforeFlowKeepsContinue/same_session"), |
| + ("arrival session recorded", "exchange.go", "intent.Previous = sessions.HashToken(c.Value)", 'intent.Previous = sessions.HashToken(c.Value + "x")', "TestIDSignedInBeforeFlowKeepsContinue/same_session"), |
| + ("signed in with a gesture time", "exchange.go", "intent.Started && !keymailWithoutGesture(session)", "intent.Started", "TestIDSignedInBeforeFlowKeepsContinue/passive_keymail"), |
| + ("signed in needs a start time", "exchange.go", "intent.Started > 0 && !sameSession", "!sameSession", "TestIDSignedInBeforeFlowKeepsContinue/no_start_time"), |
| +] |
| for table in ("sessions", "passkey_credentials", "passkey_recovery_codes", "passkey_pending", "passkey_challenges", "home_id_ceremonies", "home_id_recovery_proofs"): |
| CASES.append(("replacement revokes " + table,"id_recovery.go",f'\n\t\t"DELETE FROM {table} WHERE subject=?",',f'\n\t\t"DELETE FROM {table} WHERE subject=? AND 0",',"TestIDRecoveryReplacementRevokesEverything")) |