Skip to content

Keep the admin MFA rate-limit burst inside one limiter window - #2396

Merged
RhysSullivan merged 1 commit into
mainfrom
e2e-admin-mfa-rate-window
Oct 25, 2026
Merged

RhysSullivan merged 1 commit into
mainfrom
e2e-admin-mfa-rate-window

Conversation

@RhysSullivan

Copy link
Copy Markdown
Collaborator

Admin MFA API · restarting enrollment cannot reset the rate limit failed on main at bfc9152 with [200, 200, 200, 200, 200, 200] where it expects the sixth start to get 429.

ADMIN_MFA_RATE_LIMITER allows 5 per 60s. The local limiter (miniflare) counts in clock-aligned windows, Math.floor(Date.now() / 60_000), and clears every bucket when the window changes. The failing burst finished at 21:25:00.0, so it straddled a minute boundary and the sixth request was counted in a fresh window. The odds per run are about the burst's duration over 60s, roughly 1%.

The scenario now starts the burst with at least 10s of the current window left, waiting into the next window when needed. The assertion is unchanged.

The local rate limiter counts in clock-aligned 60s windows and clears its buckets at each boundary. The scenario's six-request burst fails when it straddles a minute boundary, because the sixth request lands in a fresh window. Start the burst with at least 10s of the window left.
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Oct 25, 2026 •

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Updated (UTC)
✅ Deployment successful!
View logs
executor-cloud 3e2883b Oct 25 2026, 09:38 PM

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Oct 25, 2026 •

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
executor-marketing 3e2883b Commit Preview URL

Branch Preview URL
Oct 25 2026, 09:38 PM

@github-actions

github-actions Bot commented Oct 25, 2026 •

Copy link
Copy Markdown
Contributor

Cloudflare preview

Torn down — the PR is closed.

@pkg-pr-new

pkg-pr-new Bot commented Oct 25, 2026

Copy link
Copy Markdown

Open in StackBlitz

@executor-js/cli

npm i https://pkg.pr.new/@executor-js/cli@2396

@executor-js/config

npm i https://pkg.pr.new/@executor-js/config@2396

@executor-js/execution

npm i https://pkg.pr.new/@executor-js/execution@2396

@executor-js/sdk

npm i https://pkg.pr.new/@executor-js/sdk@2396

@executor-js/codemode-core

npm i https://pkg.pr.new/@executor-js/codemode-core@2396

@executor-js/runtime-quickjs

npm i https://pkg.pr.new/@executor-js/runtime-quickjs@2396

@executor-js/plugin-file-secrets

npm i https://pkg.pr.new/@executor-js/plugin-file-secrets@2396

@executor-js/plugin-graphql

npm i https://pkg.pr.new/@executor-js/plugin-graphql@2396

@executor-js/plugin-keychain

npm i https://pkg.pr.new/@executor-js/plugin-keychain@2396

@executor-js/plugin-mcp

npm i https://pkg.pr.new/@executor-js/plugin-mcp@2396

@executor-js/plugin-onepassword

npm i https://pkg.pr.new/@executor-js/plugin-onepassword@2396

@executor-js/plugin-openapi

npm i https://pkg.pr.new/@executor-js/plugin-openapi@2396

executor

npm i https://pkg.pr.new/executor@2396

commit: 3e2883b

@RhysSullivan
RhysSullivan marked this pull request as ready for review October 25, 2026 21:51
@RhysSullivan
RhysSullivan merged commit dc3eac8 into main Oct 25, 2026
44 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant