Pubky SDK 0.11 (Ring sign-in unchanged) - #100
Merged
Merged
Conversation
Pin @synonymdev/pubky 0.11.0 (and the pubky-shop override) and keep Ring on the cookie flow: startCookieAuthFlow, signinCookie, signupCookie. 0.11's Pubky.restoreSession parses exportLocalSecret() tokens, so the one-approval /session body, cookie reload and staging signup now hydrate with Session.restore. A staging signup whose restore attempts all fail after the invite is spent recovers through signinCookie before throwing. PkarrError from the SDK maps to a retryable network error.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Ring sign-in on @synonymdev/pubky 0.11 (PR 1 of the Bitkit grant-auth wave, #48 / #49)
Moves the Shop to
@synonymdev/pubky0.11.0, the version Bitkit's Paykit rc55 and upstream pubky-app use, and keeps Pubky Ring on the cookie flow with the same single approval. Nothing changes for Bitkit yet: PR 2 adds the Bitkit grant sign-in on top of this.Design:
/Volumes/t7/vibes-dev/.evidence/bitkit-signin-grant-48/REPORT.mdrev 2, rows R1.1–R1.9 (design review round 2: SHIP_DESIGN).Changes
@synonymdev/pubky0.8.0 → 0.11.0, pinned exactly, with the@bitcoinerrorlog/pubky-shopoverride set to 0.11.0. The lockfile has one copy.startAuthFlow→startCookieAuthFlow,signer.signin()→signinCookie(),signer.signup()→signupCookie(), including the probe scripts.Session.restore(base64(body), client)on the one-approval/sessionPOST, on its GET recovery, and on cookie reload. On 0.11,Pubky.restoreSessionparsesexportLocalSecret()tokens, so hydration through it fails after the user approved.Session.restore. If all three attempts fail after the invite is spent, it recovers throughsigninCookiebefore throwing a retryable error. This fixes the P1 recorded on the parkedsync/upstream-2026-09-20@288f417e.PkarrErrorfrom the SDK maps to a retryable network error (upstream chore(deps): bump @synonymdev/pubky to 0.11.0 pubky/pubky-app#2529).vendor/paykit-wasm, used by messaging) is untouched.Contract rows → tests
homeserver.ring-url.contract.test.ts›ring qr matches captured 0.8.0 host and params. Real SDK, fixture captured from 0.8.0 insrc/test/fixtures/auth/ring-signin-url.sdk-0.8.0.json.auth.single-approval-seams.test.ts›runs homeserver-then-marketplace exactly once, with identical body bytes on both POSTs(now also assertsSession.restore, neverPubky.restoreSession)/sessionhydrationhomeserver.test.ts›signInWithFullGrantAuthTokensuite (POST, standard base64 alphabet, GET recovery, restore failure), all onSession.restorehomeserver.test.ts›reload restores cookie session via Session.restore. Gatesdk-call-sites.gate.test.ts›no Pubky.restoreSession call site in srchomeserver.test.ts: the staging signup hydration assertsSession.restore; plusrecovers via signinCookie when every restore attempt fails after the invite is spentandthrows a retryable error only when both restore and signinCookie failno removed 0.8 cookie API names on the pubky SDKhomeserver.test.ts›pkarr error maps to retryable network errorauth.single-approval-seams.test.ts›step-up approved by a different identity mints no marketplace bearer and signs the session outone @synonymdev/pubky 0.11.0 in lockfile.git diff origin/release/shop-v0.6.8 -- src/core/services/paykit/paykit-messaging.ts vendor/paykit-wasmis empty.Both new gates were run once against a deliberate bad input and failed: the fixture host changed to
signin_grant, and apubkySdk.restoreSession(call site added. The log is inpr1/calibration.log.Proof
next devagainst the staging homeserver, relay andstaging-api.pubky.app; staging seller test seat7oboeqnf…): 10/10 on head7724b848.signin,caps,relay,secret).POST /session(200) and one marketplacePOST /v1/auth/sessions(201).hs,st, the Shop capabilities) takes one approval and hydrates the new identity.pr1/chromium-pr1.log, screenshotspr1/chromium/, scriptpr1/chromium-pr1.mjs.pr1/prepush.log,pr1/vrt-other-rerun.log,pr1/vrt-other-release-head-55a084c8.log.Evidence root:
/Volumes/t7/vibes-dev/.evidence/bitkit-signin-grant-48/.Notes for review
/sign-in); that behaviour is unchanged./signuprequest before any SDK call, which points at the ceremony's local-state guard, not the SDK. R1.5 is covered by the unit tests above.