test(e2e): pre-authenticated session harness to stay under the nonce rate limit - #104
Open
douglance wants to merge 1 commit into
Open
test(e2e): pre-authenticated session harness to stay under the nonce rate limit#104douglance wants to merge 1 commit into
douglance wants to merge 1 commit into
Conversation
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
douglance
force-pushed
the
siwe/e2e-harness
branch
from
August 17, 2026 17:28
a57d2b5 to
e4e4e0e
Compare
douglance
force-pushed
the
siwe/e2e-harness
branch
from
August 19, 2026 21:01
e4e4e0e to
9c4c0b1
Compare
douglance
force-pushed
the
siwe/e2e-harness
branch
from
August 20, 2026 16:45
9c4c0b1 to
9baa197
Compare
fionnachan
force-pushed
the
siwe/e2e-harness
branch
from
August 20, 2026 16:55
9baa197 to
f8ae441
Compare
douglance
force-pushed
the
siwe/e2e-harness
branch
from
August 24, 2026 16:26
f8ae441 to
6c2f0c4
Compare
…rate limit POST /api/auth/nonce is rate-limited to 10 per minute per IP, and every Playwright test shares one IP. Signing in per test does not scale: a six-test suite already failed on back-to-back runs (measured 7x 201 then sustained 429) while each test passed in isolation, so the ~30-test target was unreachable. Add a 'setup' project that signs each dev wallet in once through the real UI and saves its session cookie; specs replay that state via signedInPage(). Nonce spend is now bounded by the number of wallets (5) rather than the number of tests, so adding tests costs nothing. Also allocates a dev wallet per spec. The SIWE tables live in a single shared 'app' schema that is NOT namespaced by PONDER_SCHEMA, so two specs sharing a key would collide on the same owned_profile/draft rows. Key #9 is called out specifically: it has delegated all its ARB away, so it is the only key that can exercise the avatar gate's 403 not_delegate branch.
douglance
force-pushed
the
siwe/e2e-harness
branch
from
August 27, 2026 18:08
6c2f0c4 to
e31c979
Compare
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.
Stacked on #103. Third of four.
The problem this fixes is measured, not theoretical
POST /api/auth/nonceis rate-limited to 10/min per IP, and every Playwright test shares one IP. Signing in per test does not scale — a six-test suite already failed on back-to-back runs while every test passed in isolation:So the ~30-test target was unreachable before this.
Fix, in two parts
The first part alone was not enough, which is worth knowing:
setupproject signs each dev wallet in once through the real UI (still exercising nonce → verify → cookie) and saves its session cookie. Nonce spend becomes a function of wallet count, not test count — adding tests is now free.profile.spec= 6 nonces, so two runs inside a minute still tripped the limit. Sessions last 7 days, so setup now probes/api/meand re-authenticates only on 401. Repeat runs cost zero nonces.Result — three consecutive runs, no pause:
A useful side effect: the 401 probe makes the harness self-healing. When
reset:siwetruncated sessions out from under it, setup noticed and re-authenticated on its own.Also here
A dev-wallet allocation per spec. The SIWE tables live in one shared
appschema that is not namespaced byPONDER_SCHEMA, so two specs sharing a key collide on the sameowned_profile/draftrows. Key #9 is called out specifically: it has delegated all its ARB away, making it the only key that can exercise the avatar gate's 403not_delegatebranch.