Skip to content

Invalidate cached api key validations on revoke - #1871

Draft
RhysSullivan wants to merge 2 commits into
mainfrom
apikey-revoke-cache-invalidation
Draft

Invalidate cached api key validations on revoke#1871
RhysSullivan wants to merge 2 commits into
mainfrom
apikey-revoke-cache-invalidation

Conversation

@RhysSullivan

Copy link
Copy Markdown
Collaborator

Since the validation cache landed, the org-api-keys e2e fails on every main run: a revoked key keeps authenticating with 200 where the console flow promises an immediate 401.

Two causes, both fixed:

  • The cache map lived inside each build of the key service, and the account middleware rebuilds that layer per request. The long-lived identity plane cached the key in its own map, so nothing a revoke did in its per-request build could reach it. The map now lives at module scope — one per isolate — shared by every build.
  • Revocation never touched the cache at all. Both revoke paths now drop the revoked key's entries by key id.

A revoked key is now refused on the next request served by the isolate that processed the revoke. Other isolates still age the entry out within the 60s TTL, unchanged.

Verified: the previously failing cloud/org-api-keys-console e2e and the cache's own e2e pass locally; unit tests cover cross-build cache reuse and cross-build revoke invalidation.

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Aug 30, 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 c385591 Aug 30 2026, 09:52 AM

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Aug 30, 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 c385591 Commit Preview URL

Branch Preview URL
Aug 30 2026, 09:51 AM

@github-actions

Copy link
Copy Markdown
Contributor

Cloudflare preview

Console https://executor-preview-pr-1871.executor-e2e.workers.dev
MCP https://executor-preview-pr-1871.executor-e2e.workers.dev/mcp
Deployed commit 50ee2fd

Sign-in is Cloudflare Access (one-time PIN to an allowed email). The preview has its own database and encryption key; it is destroyed when this PR closes.

@pkg-pr-new

pkg-pr-new Bot commented Aug 30, 2026

Copy link
Copy Markdown

Open in StackBlitz

@executor-js/cli

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

@executor-js/config

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

@executor-js/execution

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

@executor-js/sdk

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

@executor-js/codemode-core

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

@executor-js/runtime-quickjs

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

@executor-js/plugin-file-secrets

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

@executor-js/plugin-graphql

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

@executor-js/plugin-keychain

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

@executor-js/plugin-mcp

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

@executor-js/plugin-onepassword

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

@executor-js/plugin-openapi

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

executor

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

commit: 50ee2fd

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