Skip to content

feat(proxy): API keys with per-account rate limits (design and implementation) - #143

Open
sefk wants to merge 36 commits into
devfrom
feat/api-keys-website-proxy
Open

sefk wants to merge 36 commits into
devfrom
feat/api-keys-website-proxy

Conversation

@sefk

@sefk sefk commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Adds optional API keys to the platform proxy (/api/v1/*, /openapi.json, /codes, /mcp). A call with a key is counted against the key's account at the account's limit. A call without a key is counted against its address as before. The design, with its alternatives, the plugin spike and the test results, is in docs/design/api-keys.md.

  • Keys: Better Auth's API key plugin stores and manages keys in our Postgres. Its HTTP endpoints are disabled, and our own server actions wrap its server methods.
    • Keys look like dfo_live_…, are hashed at rest and shown once.
    • The migration adds a unique key-hash index and a foreign key that deletes an account's keys with the account.
  • Proxy: the key is read from Authorization: Bearer dfo_… or X-API-Key and stripped before anything goes upstream.
    • The verifier reads the plugin's table itself, behind a cache of about a minute.
    • An unknown or revoked key gets a 401.
    • If the key store is unavailable, the call goes through as anonymous (fails open).
  • Limits:
    • A key not in the cache is first counted against its address, so made-up keys cannot force unlimited lookups.
    • A valid key is counted against its account, at the account's api_rate_limit or RATE_LIMIT_KEYED (600 by default), per surface.
    • When the shared limiter is slow, each instance falls back to an in-memory count instead of letting the call through uncounted.
  • Backends: a keyed caller is named user:<digest> in x-dfo-caller. dfo-apis and dfo-ai need their matching changes deployed first.
  • Usage: one log line per keyed call from forward() (key id, account, surface, outcome). The key's last use is recorded about once a minute.
  • Pages:
    • /account/api-keys lets a signed-in user create, label and delete their own keys, up to API_KEYS_MAX_PER_ACCOUNT (5 by default), and see their limit.
    • /admin/api-keys is a proof of concept for emails in ADMIN_EMAILS, linked from the account menu for admins only. Operators can list every key, create a key for an account, delete any key, and set an account's limit.
  • Switches and docs: API_KEYS_ENABLED turns all keyed access off. /openapi.json declares the two key headers.

Closes #142

This branch also carries the just stack commits from #149, merged in for local testing. Merging #149 first leaves them out of this diff.

Deploy order

  1. feat(caller): accept an account caller from the website apis#320: accept user: callers.
  2. feat(caller): forward account callers to dfo-apis ai#201: forward them.
  3. This pull request.

New settings: RATE_LIMIT_KEYED, API_KEYS_ENABLED, API_KEYS_MAX_PER_ACCOUNT, ADMIN_EMAILS.

Related pull requests

Repo Pull request Merge order
docs DevelopmentFinanceObservatory/docs#26: the "Use an API key" page Before apis#320 and ai#201, whose guide pages link to it
dfo-apis DevelopmentFinanceObservatory/apis#320: accept user: callers, and the quickstart says a key is optional Before ai#201 and this PR
dfo-ai DevelopmentFinanceObservatory/ai#201: forward user: callers, and the MCP connect page covers keys Before this PR
spec-kit DevelopmentFinanceObservatory/spec-kit#57: the invalid_api_key code, already copied here Any time. After it merges, update the spec-kit commit cited in src/lib/proxy/proxyCodes.ts
infra DevelopmentFinanceObservatory/infra#150: ADMIN_EMAILS from Secret Manager After this PR. Then add the real list as a new secret version (gcloud secrets versions add) and roll a revision

Open questions

  • @jm-rivera: how does someone ask for a higher limit? The docs page (docs#26) says higher limits are available on request but names no way to ask. It likely needs a contact email address.
  • @jm-rivera: who else should be an admin? The admin lists live in each environment's Secret Manager secret, not in the repo. Dev starts with Sef and Jorge, production with Jorge. infra#150 leaves a TODO in each environment's settings.

How tested

  • just check: lint, typecheck, build and the full test suite, with 215 proxy, key-service and schema tests.
  • Codex review of each branch, with no findings.
  • Local stack, with email sign-in through a mail catcher and a key from /account/api-keys:
    • Question and answer through MCP. The pi coding agent, running a local model (qwen3.6-35b-a3b), connected to /mcp with the key as its bearer. Asked "how much money was given to kenya in 2025", it answered:

      According to the OECD DAC2A dataset (official development assistance, bilateral flows, net disbursements in
      current US dollars), Kenya received $196.1 million in aid from 9 providers in 2025.
      
      Breakdown by provider:
      
      | Provider               | Amount (USD)                             |
      | DACPrivateDonors       | $193.8M                                  |
      | GatesFoundation        | $177.1M                                  |
      | PostcodeLotteryGroup   | $3.5M                                    |
      | PeoplesPostcodeLottery | $2.6M                                    |
      | country/AUT (Austria)  | $3.1M                                    |
      | GermanPostcodeLottery  | $180K                                    |
      | DutchPostcodeLottery   | $338K                                    |
      | SwedishPostcodeLottery | $341K                                    |
      | NordicDevelopmentFund  | −$973K (negative = repayments/reversals) |
      | country/PRT (Portugal) | $111K                                    |
      
      Notes:
      - ~$193.8M of the total comes from private donors (mostly reported via the DACPrivateDonors aggregate).
      - The Gates Foundation is the largest single named donor at $177.1M.
      - Two entries are excluded from the total to avoid double-counting: DACPrivateDonors and
        PostcodeLotteryGroup (totals of other parties).
      - The data is partial — the OECD publishes DAC2A quarterly, and the December release covers every donor for
        the year.
      

      The figures come from the tools. The small model's arithmetic is unreliable (it mixes official and private totals), which is the model, not the proxy.

    • MCP session with the key. initialize and tools/list returned 16 tools, with X-RateLimit-Limit: 600 (anonymous MCP: 300).

    • Usage counted per account. The limiter's rows were mcp:acct:<user id> and api:acct:<user id>. An anonymous call at the same time counted against its address at 120.

    • Rate limit on the API. With the account's limit at 5, five keyed calls answered 200 and the sixth answered 429 with Retry-After, the X-RateLimit-* headers and a rate_limited problem document.

    • Rate limit on MCP. A second MCP session in the same window was refused at initialize.

    • pi under a limit of 2. It still finished the question, more slowly.

    • Limit changes. Each change took effect within seconds.

Not covered locally:

  • the backends counting the user: caller, which needs dev with the dfo-apis and dfo-ai changes
  • Cloudflare's edge rules

🤖 Generated with Claude Code

https://claude.ai/code/session_015QQk2mKJZzXv2AYykDjvQf

sefk and others added 9 commits November 13, 2026 14:47
A working design for API keys on the platform proxy (#142): the key
format and header, storage, per-key limits, the proxy check, and the
three phases. Still being revised.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015QQk2mKJZzXv2AYykDjvQf
Keys cover /mcp from Phase 1, default limits are tuned in Phase 2 from
observed usage, and expiring keys and multiple keys per account move
to a Future Features section.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015QQk2mKJZzXv2AYykDjvQf
Present the header as a proposal within The Key, and introduce the
survey of how other services convey tokens.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015QQk2mKJZzXv2AYykDjvQf
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015QQk2mKJZzXv2AYykDjvQf
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015QQk2mKJZzXv2AYykDjvQf
@sefk
sefk requested a review from jm-rivera as a code owner November 13, 2026 23:25
sefk and others added 4 commits November 13, 2026 15:34
Compares building against Better Auth's API key plugin, a hosted key
service, hosted and Google gateways, and Cloudflare.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015QQk2mKJZzXv2AYykDjvQf
…d use

Split Design into Requirements (true for either option), Build (our
own key table) and Use (Better Auth's API key plugin, with what it
provides, how it fits, its lack of an admin interface, and a spike
checklist). Add a tentative recommendation to the summary and note
that the work-by-repository split holds for both options.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015QQk2mKJZzXv2AYykDjvQf
One number per key, applied to each surface separately, replaces the
separate API and MCP limits. A separate MCP limit per key moves to
Future Features.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015QQk2mKJZzXv2AYykDjvQf
Recommend building Phase 1 on our own key table behind a verifier and
deciding on Better Auth's plugin at Phase 2 planning. Add where keys
apply, one resolved identity per request, limits on invalid-key
attempts, revocation and emergency-switch rules, and the open choice
between anonymous and 503 when the key store is unavailable. Correct
the dfo-ai work (its MCP servers drop non-ip callers) and the rollout
order, and record the static-list alternative.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015QQk2mKJZzXv2AYykDjvQf
@jm-rivera

Copy link
Copy Markdown
Contributor

Thanks @sefk, this was a very helpful overview.

In short, I think we should build API keys on @better-auth/api-key from Phase 1 instead of having our own key table. The plugin issues, stores, revokes and checks keys.

My rationale:

  • We already use BetterAuth for sign-in and sessions. So let's use the api key module instead of having our own implementation for generating, hashing and storing keys, checking ownership, building endpoints etc.
  • We can/should keep the keys in our Postgres.
  • This would allow us to support self-service from the start. Partners could therefore sign in and create their own keys.

In this scenario we should still keep the limiter on our side (anonymous traffic needs our limit_counter anyway). And we should own caching and outage handling, since the plugin treats db outages as invalid key.

In terms of the design in #143:

  • Cloudflare is on Pro: 600 calls a minute per address on the data API and 60 on the Studio, each blocking for 10 minutes. /mcp has no edge limit. Let me know if you're proposing any changes to this.
  • Claude's custom connectors accept an API key as a request header. ChatGPT accepts only OAuth or no sign-in.
  • dfo-apis refuses a key: caller with a 400. We'd need to ship the changes to dfo-apis first, then dfo-ai, then the website.
  • We should plan on adding specific caps keyed MCP use (right now keys are not required, and we shouldn't plan to turn it on yet). But all outside MCP calls share one dfo-ai bucket of about 2,400 calls a minute. Perhaps a daily cap per account would make sense?
  • We should drop the separate budget for bad-key attempts. The normal address limit can do that job, but we should apply it before we look up the key (so made up keys can't force unlimited database lookups).
  • We should make sure one caller can't get past its own rate limit by sending a big burst of calls (right now, when the limit check is slow, the proxy lets the call through instead of blocking it).
  • We should log key usage in forward() (where the key is checked). Otherwise we don't see which key is used (and therefore no per-key usage metrics).
  • The work should also include infra (a Cloud Run Job, so we can change limits and delete keys in production) and dfo-docs (the API quickstart still says no key is needed).
  • Revoking a key should mean deleting it (the plugin lets a key's owner switch it back on).
  • Limits should count per account (i.e not per key)

Recommend Better Auth's API key plugin from Phase 1, with our own
limiter, cache and outage handling around it; building our own key
table becomes the fallback if the spike fails. Limits count per
account, revoking deletes the key, bad keys count against the address
limit before lookup, a slow counter falls back to a per-instance count
instead of letting bursts through, and key usage is logged in
forward(). Record the current Cloudflare rules and the claude.ai and
ChatGPT connector support, add infra and docs to the work, and move
MCP caps to Future Features.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015QQk2mKJZzXv2AYykDjvQf
@sefk

sefk commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor Author

Sef here. Thanks for the review. Two questions in chat (testing, admin interface) but that doesn't have to hold up this work. I'll implement today.


From Claude, on behalf of @sefk.

Thanks @jm-rivera. All of these are folded into the design in 314eed7:

  • Plugin from Phase 1. Agreed. The recommendation is now @better-auth/api-key from Phase 1, with keys in our Postgres. Our limiter, cache and outage handling sit around it. The spike moves to before Phase 1 code, and our own key table becomes the fallback if the spike fails. I added "how does the verifier tell an invalid key from an unavailable store" to the spike, since the plugin reports a DB outage as an invalid key and we fail open on outages.
  • Cloudflare. No change proposed. The Pro rules (600/min per address on the data API, 60 on the Studio, 10-minute block, none on /mcp) are recorded in How It Works Today and Cloudflare Integration. 600/min binds only if we grant an account more than that from one address, and we'd revisit then. The Cloudflare open question is closed.
  • Connectors. The MCP client table now says Claude custom connectors take a key as a header and ChatGPT takes only OAuth or no sign-in.
  • dfo-apis 400 / ship order. Recorded; the order stays dfo-apis → dfo-ai → website.
  • Keyed MCP caps. Under Future Features: a separate MCP limit or a daily cap per account, with dfo-ai's shared ~2,400/min bucket as the reason. Keys are not required on /mcp, and there's no plan to require them.
  • Bad-key budget. Dropped. A key that isn't in the cache is counted against its address's normal limit before the lookup, so made-up keys can't cause more lookups than the address could make calls. Cached valid keys skip that step, so a keyed caller isn't throttled by its address limit.
  • Bursts on a slow limiter. When the shared count is slow, each instance falls back to a small in-memory count per caller instead of letting the call through uncounted. The proxy stays available, and one caller is still held near its limit on each instance.
  • Logging. Key usage (public key id, account, surface, outcome) is logged in forward().
  • infra and docs. Added to Work by Repository: a Cloud Run Job to run the admin command in production, and the API quickstart update.
  • Revoke = delete. Agreed. Disabling isn't revocation, since an owner can re-enable a disabled key.
  • Per-account limits. Agreed. The limit lives on the account (an extra field on the Better Auth user), and all of an account's keys share it. Backends are told the caller by account too, so dfo-apis allowances are per account. The exact header form (key: vs dfo-ai's user:) is left to settle with the dfo-apis change.

sefk and others added 11 commits November 16, 2026 11:47
The plugin fits with workarounds: the proxy reads the plugin's table
itself (verifyApiKey writes on every call and reports an outage as an
invalid key), the plugin's HTTP endpoints are disabled and wrapped, and
the migration adds a unique key index and a cascading foreign key to
the user.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015QQk2mKJZzXv2AYykDjvQf
Installs @better-auth/api-key at the same version as better-auth and wires
it into the auth config with the plugin's own limiter, metadata and
key-as-session off, and its HTTP key endpoints on disabledPaths. Server-side
auth.api calls still work.

Migration 0025 adds the apikey table with a unique index on the key hash and
a foreign key to user that deletes an account's keys with the account, and
user.api_rate_limit, the account's own calls-per-window limit
(user.additionalFields.apiRateLimit, never settable or returned to the
account).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015QQk2mKJZzXv2AYykDjvQf
readApiKey reads a key from `Authorization: Bearer dfo_...` or `X-API-Key`:
a bearer that is not a dfo_ key is no key, two different keys conflict, and
a value over 128 characters is refused unread.

createKeyVerifier answers valid, invalid or unavailable for a key without
calling the plugin's verifyApiKey, which writes to the key row on every call
and reports an outage as an invalid key. It hashes with the plugin's own
hasher, reads apikey joined to user.api_rate_limit on its own small bounded
pool (buildKeyPool), checks enabled and expires_at itself, and caches in
process: valid for an absolute minute and never past the key's expiry,
invalid for 30 s, unavailable not at all, with one read per key at a time and
bounded memory.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015QQk2mKJZzXv2AYykDjvQf
forward() now decides each call once (access.ts) before the limiter, on the
API and MCP surfaces. No key: anonymous, counted by address as before. A
valid key in the cache: counted against the key's account. Any other key:
counted against the address first, then looked up. Invalid is a 401 problem
document and not anonymous, an unavailable key store goes on as anonymous,
and two different keys are a 400. The account's limit is its own
user.api_rate_limit or RATE_LIMIT_KEYED (default 600), applied to each
surface apart; API_KEYS_ENABLED=false strips keys and treats every call as
anonymous.

A dfo_ bearer and X-API-Key never go upstream, whether or not the key
verified; any other Authorization behaves as before. The Studio strips a key
and ignores it. A keyed call is named user:<digest> to dfo-apis and to
/mcp's upstream, resolved once in forward(). /openapi.json declares the
optional key as a security scheme.

The limiter takes a caller key and a limit, and a shared count that fails or
times out is now counted in memory per instance instead of passing
uncounted.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015QQk2mKJZzXv2AYykDjvQf
One structured line per call that carried a key, written where the key is
checked: the key's public id, its account, the surface and the outcome
(allowed, limited, invalid or unavailable). Never the key or its hash. The
request log still names a keyed call by its address, since it is written from
raw headers when the response closes; docs/analytics.md says so and describes
the new line.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015QQk2mKJZzXv2AYykDjvQf
/account/api-keys lists the signed-in user's keys, makes one from a label
and deletes one after a confirmation. The full key is shown once, at
creation, with a copy button; only its hash is stored. Server actions take
the owner from the session, force the dfo_live_ prefix, pass no expiry,
limit, metadata or permissions, and delete the row to revoke. An account
holds at most API_KEYS_MAX_PER_ACCOUNT keys (default 5). The page shows the
account's limit read-only and how to send a key.

The key service (src/lib/apiKeys/service) also carries the operator
functions the admin page uses next, and its tests cover them: ownership,
the forced prefix, the cap, and a created key verifying through the proxy's
key verifier.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015QQk2mKJZzXv2AYykDjvQf
/admin/api-keys lists every key across accounts (id, label, start, owner
email, created, last request, account limit) with an email filter, makes a
key for an account by email (shown once), deletes any key, and sets or
clears an account's limit. It shows whether API_KEYS_ENABLED is on.

Admins are signed-in users whose verified email is in ADMIN_EMAILS
(comma-separated, case-insensitive; unset or empty means no admins). The
gate runs on the page and again in every action, and answers anyone else,
signed out included, with the 404 page. Each mutation logs one structured
line with the actor's email, the action and the key or account id, never a
key.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015QQk2mKJZzXv2AYykDjvQf
…rt (#142)

The plugin stores the first 6 characters of a key as its start, which is
only 'dfo_li', so every key looked the same on the key pages. Keep 12: the
prefix and three of the 32 random characters, such as dfo_live_RCd.
Existing rows keep their old start.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015QQk2mKJZzXv2AYykDjvQf
)

The example called /api/search/catalogue, the site's own endpoint, which
does not honour keys. GET /api/v1/graph/capabilities is on a keyed surface
and cheap, and the docs already use it.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015QQk2mKJZzXv2AYykDjvQf
A lookup that finds a valid key sets apikey.last_request, in the
background on the key pool. It runs on a cache miss only, so about once per
cache lifetime per key per instance, never on a cache hit and never for an
invalid or unavailable answer. The write is fire and forget: the verdict
does not wait for it, and a failure is logged at most, with no key or hash
in the line. The runtime role already holds UPDATE on the table through the
default privileges, and a test now says so.

The key pages show the value as an approximate 'last used', up to a minute
or so behind the last call.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015QQk2mKJZzXv2AYykDjvQf
`just stack` starts the dev apis proxy and the Studio harness from an ai
checkout beside this one (AI_DIR, default ../ai) and the dev server, with
each output line prefixed by its service and Ctrl-C stopping all three.
Plain bash in the recipe, so it needs no process manager. It warns up
front when gcloud has no valid login, since the proxy cannot prompt for
one there.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015QQk2mKJZzXv2AYykDjvQf
sefk and others added 6 commits November 16, 2026 13:38
On a terminal, each service's prefix in `just stack` gets its own color
and lines that look like errors (ERROR, Traceback, *Error, *Exception,
`error:`, Next's ⨯) are shown in red. NO_COLOR or a non-terminal output
keeps the plain prefixes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015QQk2mKJZzXv2AYykDjvQf
A Testing section with the local run against the implementation:
question and answer through MCP with a key, usage counted against the
account, the limit enforced on the API and MCP with the 429 it returns,
and what remains to test on dev (backends seeing the account caller,
Cloudflare, a live store outage).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015QQk2mKJZzXv2AYykDjvQf
The design and its implementation ship together in one pull request.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015QQk2mKJZzXv2AYykDjvQf
Phase 1 operators use the /admin/api-keys page, not an admin command,
and self-service at /account/api-keys was built alongside it. The
backends see a keyed call as `user:<digest>`, which settles the caller
form; the open question narrows to whether site sessions should be
named by account too. The infra Cloud Run Job becomes optional.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015QQk2mKJZzXv2AYykDjvQf
Admins (a verified email on ADMIN_EMAILS) see "Admin: API keys" in the
account menu. Whether the viewer is an admin is a server setting, so the
menu asks through a server action the first time it opens for a user;
the admin page and its actions still enforce the gate themselves.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015QQk2mKJZzXv2AYykDjvQf
@sefk sefk changed the title docs(design): add the API keys design doc feat(proxy): API keys with per-account rate limits (design and implementation) Nov 16, 2026
Comment thread db/test/api-key.test.ts Fixed
sefk and others added 4 commits November 16, 2026 15:42
Copy proxy-codes.json from the spec-kit client contract at 57ee5cd, which
lists invalid_api_key (401), and add the code to REGISTRY_CODES. The 401
for an unknown, revoked or malformed key now has type /codes/invalid_api_key
instead of about:blank, and GET /codes/invalid_api_key resolves.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015QQk2mKJZzXv2AYykDjvQf
The account menu is also built into the prototypes app's static export,
which refuses server actions, so importing one there broke `pnpm build`
in CI. The menu now asks GET /api/account/admin instead, with the same
answer: whether the signed-in viewer is on ADMIN_EMAILS.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015QQk2mKJZzXv2AYykDjvQf
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015QQk2mKJZzXv2AYykDjvQf
CodeQL read hashing a freshly created key with SHA-256 in the test as a
weakly hashed password. Keys are 32 random characters, so a fast hash
is right, but the test does not need a real key to pin the algorithm:
it now checks the plugin's hasher against a fixed input's precomputed
base64url SHA-256.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015QQk2mKJZzXv2AYykDjvQf
@sefk

sefk commented Nov 17, 2026

Copy link
Copy Markdown
Contributor Author

Adding a couple of screen shots.

1. The User View

2026-11-16-15-23-dfo-admin-api-keys-page

2. The Admin View

2026-11-16-15-24-dfo-api-keys-admin-page

This branch has not been deployed

No deployments
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.

Add API keys to the platform proxy

3 participants