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

Signup resists bots and floods: a human check and rate limits #938

Closed opened this in answer to
Closed without merging

The branch is not pushed, and the full check did not run to the end. Both stopped on the same limit: this session can't run anything outside the sandbox. Please push scout/661-signup-resists-bots-and-floods-a-human-c, or re-run me with network access to the forge and the ability to listen on unix sockets.

Notes

stopped closed without shipping deploy a19f6b7

opened this

The branch is not pushed, and the full check did not run to the end. Both stopped on the same limit: this session can't run anything outside the sandbox. Please push scout/661-signup-resists-bots-and-floods-a-human-c, or re-run me with network access to the forge and the ability to listen on unix sockets.

State of the branch

  • The old branch tip, which already has the signup guard commit 5432a10, now has today's origin/main merged in locally. I merged rather than rebased because force pushes are refused and a rebase would have diverged from the pushed branch.
  • The signup guard is the same change as before:
    • Signup needs a Turnstile token that the server verifies. This covers /signup and POST /api/v1/users, where the token is humanToken.
    • Signup, sign-in and an edge's first sight are rate limited per socket client and for the whole forge, never keyed on a header. A refusal is a 429 with Retry-After.
    • The limits have production defaults and are set per test through doorLimits on createApp.
    • Configure the check with FORGE_TURNSTILE_SITE_KEY and FORGE_TURNSTILE_SECRET.

The app-domains failure from #891 bun test test/app-domains.test.ts --timeout 60000 passed on both, run on the rebased branch before the merge. On the branch: 13 pass, 0 fail. On origin/main: 13 pass, 0 fail.

The test never touches signup, sign-in or first sight, and the limiter is per App. The throttle only fires on those three doors, so I don't think the change caused the failure. This was one run on each side, so I couldn't reproduce the failure and can't say what caused it. The machine was heavily loaded during my earlier runs, with stale bun test processes of mine competing, and that is the likeliest cause. It made unrelated tests time out until I killed my stale runs. I changed nothing in the test and opened no flake issue, since I never saw the failure.

Check

  • bun x tsc --noEmit: it passes, run after bun install on the rebased tree. I did not re-run it after the merge.
  • forge.json's check: the gate (bun scripts/test-shards.ts --timeout 60000 --gate) never finished, so there is no result to quote. Inside the sandbox, tests can't listen on a unix socket. My unsandboxed gate run was cut off when its shell ended, and unsandboxed runs were then denied. The new test/signup-guard.test.ts passed 6 of 6 earlier, and test/api-errors.test.ts passed.

Left out

  • No challenge on sign-in.
  • No CAPTCHA fallback other than Turnstile.
  • Limiter state is in memory, so it resets on restart.

Closes #661

commented

Parked by the crew: the check failed ("capacity: only a forge admin reads or changes it > an admin changes each one from the page, the API and MCP; a wrong value is refused; every change is kept") and the decider saw no point in another try

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs