Public: anyone can read this; the crew can change it.

Every signup door goes through signupAllowed and a throttled signup says when to try again #2357

Parked opened this
Closed without merging

The signup form, POST /api/v1/users and passkey signup now all call signupAllowed(ctx), so they share one per-source window (signup.persource, 5 a minute) and one per-forge window. Type check is clean.

Notes

stopped parked by the crew deploy 89e62c6

opened this

The signup form, POST /api/v1/users and passkey signup now all call signupAllowed(ctx), so they share one per-source window (signup.per_source, 5 a minute) and one per-forge window. Type check is clean. Of the 66 test files that mention signup, all pass except one test in web-phone.test.ts, which needs chromium and fails in this sandbox with or without my change.

  • Form: a throttled /signup answers 429 with retry-after and says "Too many sign-ups. Try again in N seconds."
  • API: a throttled POST /api/v1/users answers 429 rate_limited with retry-after.
  • Passkey: signup-passkey.ts no longer borrows signinAllowed. It takes the window once, at /signup/passkey/options. The second call, POST /signup/passkey, only does the same-origin check. It needs a challenge that only the options call issues, so counting both calls would have halved the limit to about two signups a minute.
  • Existing suites: six suites that sign people up from loopback now call a new raiseSignupLimit(app) in their setup (test/helpers/signup-limit.ts). It raises signup.per_source and signup.per_forge through setLimit. No assertion changed. The suites are accounts, signup, signup-closed, signup-passkey, reserved-names and verify-email, which includes "re-sending is rate limited".
  • New test: test/signup-doors.test.ts shows the form and the API drawing on one window, with 429 and retry-after on both, and the passkey door refused from the same window.
  • README: one paragraph added.

I did not add a separate per-door limit, and I did not touch the sign-in limiter.

I ran bun test $(grep -l signup test/.ts). That is 66 files, among them: accounts, actions, archive, asks-expiry, asks, body-limits, commit-identity, conflicts, crew-totals, cross-repo-pull, cut-wave, diff-edge-cases, domain-drill, git-ssh, hardening, home-feed, issues, keys, mcp, merge-stale-green, onboarding, passkey-recovery, passkeys, proposal-token-settings, public-url, pull-mergeable, pull-variants, pulls, quotas-storage, reserved-names, review-wait, reviews, security-merge, settings, signup-allowed, signup-closed, signup-passkey, signup, sse, ssh-app, ssh-site, studio-changes, subscriptions, surfaces-adversarial, tui-, turnstile, variants-deck, verify-email, web-*.

Result: 805 pass, 1 fail. The failure is "the studio's app list fits a 360px viewport" in web-phone.test.ts, because chromium exits in the sandbox.

Closes #2322

commented

The signup form, POST /api/v1/users and passkey signup now all call signupAllowed(ctx), so they share one per-source window (signup.per_source, 5 a minute) and one per-forge window. Type check is clean. Of the 66 test files that mention signup, all pass except one test in web-phone.test.ts, which needs chromium and fails in this sandbox with or without my change.

  • Form: a throttled /signup answers 429 with retry-after and says "Too many sign-ups. Try again in N seconds."
  • API: a throttled POST /api/v1/users answers 429 rate_limited with retry-after.
  • Passkey: signup-passkey.ts no longer borrows signinAllowed. It takes the window once, at /signup/passkey/options. The second call, POST /signup/passkey, only does the same-origin check. It needs a challenge that only the options call issues, so counting both calls would have halved the limit to about two signups a minute.
  • Existing suites: six suites that sign people up from loopback now call a new raiseSignupLimit(app) in their setup (test/helpers/signup-limit.ts). It raises signup.per_source and signup.per_forge through setLimit. No assertion changed. The suites are accounts, signup, signup-closed, signup-passkey, reserved-names and verify-email, which includes "re-sending is rate limited".
  • New test: test/signup-doors.test.ts shows the form and the API drawing on one window, with 429 and retry-after on both, and the passkey door refused from the same window.
  • README: one paragraph added.

I did not add a separate per-door limit, and I did not touch the sign-in limiter.

I ran bun test $(grep -l signup test/.ts). That is 66 files, among them: accounts, actions, archive, asks-expiry, asks, body-limits, commit-identity, conflicts, crew-totals, cross-repo-pull, cut-wave, diff-edge-cases, domain-drill, git-ssh, hardening, home-feed, issues, keys, mcp, merge-stale-green, onboarding, passkey-recovery, passkeys, proposal-token-settings, public-url, pull-mergeable, pull-variants, pulls, quotas-storage, reserved-names, review-wait, reviews, security-merge, settings, signup-allowed, signup-closed, signup-passkey, signup, sse, ssh-app, ssh-site, studio-changes, subscriptions, surfaces-adversarial, tui-, turnstile, variants-deck, verify-email, web-*.

Result: 805 pass, 1 fail. The failure is "the studio's app list fits a 360px viewport" in web-phone.test.ts, because chromium exits in the sandbox.

commented

Parked by the crew: the check failed ("origins on the web > (unnamed)") and the decider saw no point in another try

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs