Skip to content

feat(sts): exchange API keys at /.sts and sign them at /.keys - #233

Closed
alukach wants to merge 2 commits into
mainfrom
feat/api-keys
Closed

alukach wants to merge 2 commits into
mainfrom
feat/api-keys

Conversation

@alukach

@alukach alukach commented Sep 22, 2026

Copy link
Copy Markdown
Contributor

⛔ Blocked by developmentseed/multistore#146 and developmentseed/multistore#147 — this branch builds against them through [patch.crates-io] pinned to their branch, which comes out when the release carrying them lands — and by source-cooperative/source.coop#570, which adds the exchanges route this calls. The proxy half of source-cooperative/source.coop#548; closes #231. Part of source-cooperative/source.coop#491.

What I'm changing

API keys per ADR-013, as amended by ADR-014 (#232): a long-lived JWT the proxy signs for a service account, handed out as sck_ + JWT, exchanged at /.sts for credentials like any ID token — with a revocation check.

  • POST /.keys signs a key. source.coop calls it as whoever is issuing the key, with their Ory ID token as Authorization: Bearer and {"account_id", "jti", "expires_at"} (RFC 3339 or null), once it has written the record. The proxy verifies the token exactly as /.sts does — same issuer, same audiences — then asks the Source API whether that caller manages the account, and only then signs. A token alone mints nothing. Answers {"key": "sck_…"}. Like /.sts, it is 501 until AUTH_AUDIENCE is set.
  • /.sts exchanges a key in process. A WebIdentityToken starting sck_ is verified against the proxy's own signing key — current and, during a rotation, previous — rather than by the STS route, because a Worker cannot fetch its own JWKS (Cloudflare refuses the self-request, error 1042). type must be api_key, so an outbound federation assertion signed under the same key is not a key. Then the step ADR-013 adds: POST /api/v1/service-account-keys/{jti}/exchanges, as the key's own account, cached 60s like the permissions lookup; active: false, 404, or an API failure all deny. Credentials are minted and sealed exactly as the STS route does, same duration floor and cap.
  • One answer for every refusal. Bad signature, expired, revoked, unknown: the client sees InvalidIdentityToken "API key was not accepted" and an x-request-id; the reason is in the log under that id. A wrong RoleArn is still reported as such — it is about the request, not the key.
  • The _default role now says subject_conditions: ["*"] outright, and allow_missing_exp_from: []: both fields multistore#146 requires. The API-key role is separate — trusts the proxy issuer, requires aud = the proxy issuer, exempts it from exp — and is only reachable through the sck_ path, so a bare proxy-signed JWT at /.sts is still an untrusted issuer.

Decisions to flag

How I did it

  • src/keys.rs — new, wasm-free: api_key_role, api_key_claims/mint_api_key (sign_claims from multistore#147), strip_api_key, own_jwks (the signers as a JwksResponse, via the JWKS builder discovery already uses), verify_api_key/verify_with_any_key (tries each key in the set; a set holds one or two), credentials_for.
  • src/lib.rs — /.keys joins the special paths and the fail-closed 501; mint_key/try_mint_key and api_key_exchange/exchange_api_key run after ApiAuth is built and before the router; finish adds CORS and the request id to a pre-gateway response.
  • src/sts.rs — default_role factored out of new so /.keys verifies with the same trust; the two new RoleConfig fields.
  • src/source_api/cache.rs — cached_fetch takes the method and stores nothing for a TTL of 0; get_or_fetch_key_standing (POST, 60s) and assert_caller_manages_account (GET, uncached).
  • Cargo.toml — chrono (RFC 3339 and the clock), rsa/rand as dev-deps for the test key, the keys test target, and the [patch.crates-io] block with a comment saying when to drop it.
  • adrs/013-api-keys.md — aud in the example claims and its bullet.
  • README.md — the two endpoints in the operations table and an "API Keys" section under OIDC Provider.

How to test it

  • cargo test — all suites; tests/keys.rs covers: claims shape (iss, aud, sub, jti, type, exp only when given); past expiry, unparsable expiry and blank fields refused at mint; only sck_-prefixed tokens are keys; a minted key verifies to its record; an expired key is refused; a key signed before a rotation verifies while the previous key is served and not once it is dropped; a federation assertion under the same key is not a key; another issuer's key is refused; credentials unseal to the account and are floored at 900s.
  • cargo clippy --target wasm32-unknown-unknown -- -D warnings and cargo check --target wasm32-unknown-unknown — clean.
  • End to end, once source.coop#570 is deployed against a preview of this: issue a key from a service account's card, save it to a file, then
    AWS_WEB_IDENTITY_TOKEN_FILE=./key AWS_ROLE_ARN=arn:aws:iam::000000000000:role/_default \
      aws --endpoint-url https://<preview> s3 ls s3://<owner>/<product>/
    revoke the key in source.coop and see the next exchange refused within 60s; a key issued with no expiry keeps working until revoked. Not run here: it needs #570 deployed.

PR Checklist

Related Issues

#231, #232 (ADR-014), source-cooperative/source.coop#548, source-cooperative/source.coop#570, source-cooperative/source.coop#561, developmentseed/multistore#146, developmentseed/multistore#147.

🤖 Generated with Claude Code

https://claude.ai/code/session_01REZWKgQy2PDETn6j9YpM4z

An API key (ADR-013) is a JWT the proxy signs for a service account, handed out as sck_ + JWT. POST /.keys signs one for a manager presenting their own ID token, once the Source API confirms they manage the account; source.coop calls it after writing the key's record. A key presented at /.sts is verified against the proxy's own signing key in process — a Worker cannot fetch its own JWKS — and its jti is checked with the Source API, cached for 60s, before credentials are minted. Expired, revoked and unknown keys get one answer; the reason is logged under the request id.

Keys carry aud = the proxy issuer, which ADR-013 now says, and may omit exp: the key record is what expires or is revoked. The _default role says subject_conditions ["*"] outright, which multistore#146 requires, and builds against the multistore branch carrying #146 and #147 through [patch.crates-io] until they are released.

Closes #231

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01REZWKgQy2PDETn6j9YpM4z
@claude

claude Bot commented Sep 22, 2026 •

Copy link
Copy Markdown
Contributor

Claude finished @alukach's task in 3m 24s —— View job


Claude finished reviewing

  • Gather context (diff, changed files, CLAUDE.md)
  • Review correctness/security/best-practices
  • Apply ponytail-review pass for over-engineering
  • Post final review

✅ No blocking issues — safe to merge.

Reviewed src/keys.rs, the /.keys and /.sts wiring in src/lib.rs, the cache-layer changes in src/source_api/cache.rs, and the _default/API-key role split in src/sts.rs, against origin/main. Traced the full mint → exchange → credential-sealing path and the trust boundaries at each hop (issuer/audience checks, the manager oracle, the key-standing oracle, the generic-refusal mapping). Didn't find a correctness or security bug — the implementation matches the PR description closely and the tests in tests/keys.rs exercise the interesting edge cases (rotation, expiry, wrong issuer, federation-vs-key confusion, credential floor/cap).

A couple of non-blocking observations:

  • src/source_api/cache.rs:220 — assert_caller_manages_account goes through the same cached_fetch used for product/permissions lookups, so a 404 (unknown account_id) surfaces to the /.keys caller as ProxyError::BucketNotFound("not found"). Harmless (it's an internal API only source.coop calls, and the status code is still right), but the error text is bucket-flavored for a request that has nothing to do with buckets — worth a glance if that message ever reaches a human.
  • src/lib.rs:596 (exchange_api_key) — every error from the key-standing lookup, including a genuine Source API outage (5xx/network failure → ProxyError::Internal), collapses to the same InvalidIdentityToken "API key was not accepted" as a revoked/unknown key. That's the documented "one answer for every refusal" tradeoff, so presumably intentional, but it does mean an upstream outage looks identical to a bad key from the outside — flagging in case that wasn't the intent for the outage case specifically (vs. the key-validity cases it's clearly meant for).

Simplify (ponytail)

Nothing significant. src/keys.rs:88 (own_jwks) builds the JWKS by reusing the existing discovery-endpoint builder (jwks_json) and round-tripping through a JSON string to get a typed JwksResponse back — a little indirect, but it's correctly reusing existing logic rather than re-deriving JWK encoding, so not flagging it as a fix, just noting it as the one slightly-roundabout spot in an otherwise lean diff.


💰 Estimated review cost: $0.57 · 3m24s · 19 turns

@github-actions

github-actions Bot commented Sep 22, 2026 •

Copy link
Copy Markdown

🚀 Latest commit deployed to https://source-data-proxy-pr-233.source-coop.workers.dev

  • Date: 2026-09-23T04:17:29Z
  • Commit: 0e72cfd

Lockfile only: the audit job refuses 0.23.42, and nothing here uses TLS directly.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01REZWKgQy2PDETn6j9YpM4z
alukach added a commit that referenced this pull request Sep 25, 2026
ADR-013 chose proxy-signed JWT keys so a key could ride the existing /.sts path with only a jti check added. Implementing it (#233, multistore#147, source.coop#570) showed the lookup was never optional, the Worker could not verify against its own JWKS, minting became a source.coop→Ory→proxy→source.coop cycle that let a manager re-mint a live key, exp in the token overrode the editable record, and non-expiring keys died on the second rotation of a signing key shared with outbound federation.

ADR-015 records the replacement: an opaque sck_ secret hashed at rest in source.coop, resolved at /.sts by one proxy-as-itself lookup, accepted only from a POST body, cached 60s, rate-limited on misses. It amends ADR-005 for the single proxy-as-itself route and ADR-014's ADR-013 amendment, and marks ADR-013 superseded. ADR-001's deferred note and the RFC index now point at ADR-015.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
alukach added a commit that referenced this pull request Sep 25, 2026
ADR-013 as revised (#234): a service account's API key is an opaque `sck_` secret that source.coop stores as a SHA-256 hash. When `/.sts` receives one as `WebIdentityToken`, the proxy trims and format-checks it locally, hashes it, and asks `POST {SOURCE_API_URL}/api/v1/service-account-keys/exchanges` whether it is active and for which account, authenticated as itself with the sentinel subject `urn:source:data-proxy`. The answer is cached for 60 seconds, inactive answers included; an API failure fails closed with a 500 and caches nothing. It then mints credentials under the `_default` role for the account the API names, through the STS crate's minting and sealing.

A key is accepted only from a POST form body. One in the query string is refused before any lookup, with a message saying why, because Cloudflare logs request URLs. Every refusal of the key itself reads "API key was not accepted (request id …)" with the id also in `x-amzn-requestid`; the reason is logged once under that id. Attempts are rate-limited per client IP by a new `KEY_EXCHANGE_LIMIT` ratelimit binding in every wrangler config; a deployment without it logs an error and does not refuse traffic.

`ApiAuth` gains `authorization_header_as_self` and refuses the sentinel as an on-behalf-of subject; `cached_fetch` takes a method, an optional JSON body and an `ApiCaller`. `sts::default_role` is factored out so the key exchange mints under the same role.

Supersedes #233: nothing signs a key, so `/.keys`, self-verification against the proxy's own JWKS, the `api_key` role and the multistore pin are gone.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01R1eiTse4416N6uTgAy4Ddd
alukach added a commit that referenced this pull request Sep 25, 2026
…he platform

ADR-013's first Decision, proxy-signed JWT keys, was implemented (#233, source-cooperative/source.coop#570) and withdrawn on review before release. The revision records the replacement in place, since ADR-013 was never live: a key is an opaque sck_ secret stored as a SHA-256 hash in source.coop and resolved at /.sts by one lookup the proxy makes as itself, accepted only from a POST body, cached 60 seconds and rate-limited per client IP. Its Context keeps why the JWT design was withdrawn, and its Alternatives record the source.coop-signed JWT and the two-hop exchange.

ADR-005 gains a note for that one proxy-as-itself lookup and its sentinel subject. ADR-014's amendment of ADR-013 loses its sub and jti wording, and the sentence in "How it authenticates" that said a key's subject is the service account's id now says a key names its account on the key record, which the automated review caught. The RFC index gains ADR-014's row.

This replaces the branch's earlier commits, which drafted an ADR-015 and then folded it back into ADR-013, as one commit on top of #232's ADR-004 and ADR-005 amendments.

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

alukach commented Sep 29, 2026

Copy link
Copy Markdown
Contributor Author

Superseded by #235. This PR signed API keys with the proxy's own signing key; the design review on 2026-09-25 replaced that with opaque sck_ keys that the proxy resolves by hash at source.coop (ADR-013 revised in #234), which removes the signing key, and with it the rotation problem: keys here verified against the current and one previous signer only, so the second rotation invalidated every key signed before the first.

@alukach alukach closed this Sep 29, 2026
alukach added a commit that referenced this pull request Sep 29, 2026
…he platform

ADR-013's first Decision, proxy-signed JWT keys, was implemented (#233, source-cooperative/source.coop#570) and withdrawn on review before release. The revision records the replacement in place, since ADR-013 was never live: a key is an opaque sck_ secret stored as a SHA-256 hash in source.coop and resolved at /.sts by one lookup the proxy makes as itself, accepted only from a POST body, cached 60 seconds and rate-limited per client IP. Its Context keeps why the JWT design was withdrawn, and its Alternatives record the source.coop-signed JWT and the two-hop exchange.

ADR-005 gains a note for that one proxy-as-itself lookup and its sentinel subject. ADR-014's amendment of ADR-013 loses its sub and jti wording, and the sentence in "How it authenticates" that said a key's subject is the service account's id now says a key names its account on the key record, which the automated review caught. The RFC index gains ADR-014's row.

This replaces the branch's earlier commits, which drafted an ADR-015 and then folded it back into ADR-013, as one commit on top of #232's ADR-004 and ADR-005 amendments.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01R1eiTse4416N6uTgAy4Ddd
alukach added a commit that referenced this pull request Sep 29, 2026
…he platform (#234)

One commit on `main`, now that #232 (ADR-014) is merged. It revises
ADR-013 in place, since ADR-013 was never implemented, and it replaces
an earlier draft that added an ADR-015 and then folded it back. Part of
source-cooperative/source.coop#491. Records the decision that replaces
#233, developmentseed/multistore#147 and the proxy half of
source-cooperative/source.coop#570.

## What it records

**ADR-013, revised: API keys are opaque secrets resolved by the
platform.** A key is `sck_` + 32 random bytes (a fixed 47 characters,
`^sck_[A-Za-z0-9_-]{43}$`), stored as a sha256 hash on the key record in
source.coop and shown once. Nothing signs it. At `/.sts` the proxy
accepts it as `WebIdentityToken` from a POST body only, trims and
format-checks it locally, hashes it, and asks `POST
/api/v1/service-account-keys/exchanges` for `{account_id, key_id,
active}`, cached 60s positive and negative, failing closed; then mints
session credentials through the same code as every other exchange. The
cache-miss path is rate-limited by client IP. A stock AWS SDK does the
exchange and the refresh itself from `AWS_WEB_IDENTITY_TOKEN_FILE`; the
emergency stop for a leaked key is disabling the service account.

**Why the first Decision was withdrawn** is recorded under Context, each
point checkable against #233 and source.coop#570: the revocation lookup
was never optional, so the signature verified what the lookup restates;
a Worker cannot fetch its own JWKS, so the "no new path" benefit was
gone; minting was a source.coop→Ory→proxy→source.coop cycle whose
`/.keys` would sign any `jti` for a manager; `exp` in the token overrode
the editable record; and non-expiring keys died on the second rotation
of a signing key shared with outbound federation. The ADR's original
Context and its rejected alternatives stand.

**Amendments**, in ADR-014's house form: ADR-005 gains the one
proxy-as-itself route, with the sentinel subject `urn:source:data-proxy`
that fails both account-id grammars; ADR-014's first two bullets
amending ADR-013 lose their `sub`/`jti` wording. The RFC index gains
ADR-014's row, which #232 omitted.

It also fixes a sentence in ADR-014's "How it authenticates" section,
which the automated review caught: it said a key's subject is the
service account's id, and now says a key names its account on the key
record.

**Alternatives** rejected with reasons: the proxy-signed JWT (the first
Decision), source.coop-signed JWTs verified via a source.coop JWKS, the
two-hop exchange (opaque key → short-lived Ory ID token → `/.sts`), the
proxy's `get_credential` slot, Ory-native tokens, and long-lived Ory
refresh tokens.

## The two-hop spike the ADR cites

Run on 2026-09-25 against the staging Ory project, driving the headless
authorization-code flow source.coop already uses for a person's proxy
credentials (`getOryIdToken` on `main`) with a service-account-shaped
subject and, as a control, a random UUID that matches no identity. Both
returned an RS256 ID token from `https://auth.staging.source.coop` whose
`sub` was exactly the subject given, with the default 3600s lifetime.
The run used a throwaway confidential OAuth2 client created and deleted
for the purpose. Conclusion: Ory Network will mint for a subject with no
identity record, so the two-hop design needs no proxy change and remains
available; the ADR rejects it for the first release on the client-side
cost to HPC and VM users, not on feasibility.

## Review

Five targeted reviews of the plan and the decision text (security, proxy
implementer, source.coop implementer, ops and client experience, ADR and
issue hygiene), each returning "approve with changes"; all changes are
folded in. The ones that moved a decision: keys refused in the query
string (invocation logs are on; GDAL sends STS as a GET and is routed
through the CLI); the sentinel is a URN, not a slug; unknown keys answer
`active: false` rather than 404 so the existing cache code applies; rate
limiting is per IP on misses and ships with the branch; the revocation
numbers distinguish writes (60s) from restricted reads (300s) per the
proxy's caches; ADR-005 is amended, not merely depended on.

## What follows

#235, the proxy PR replacing #233 (its exchange branch survives;
minting, self-verification and the multistore pin do not),
source.coop#570 reworked in place, multistore#147 closed, #231
rewritten, and the epic's Phase 5 items edited.

## PR Checklist

- [x] This PR has **no** breaking changes. (Documentation only.)
- [x] I have updated or added new tests to cover the changes in this PR.
(None apply; no code.)
- [x] This PR affects the [Source Cooperative Frontend &
API](https://github.com/source-cooperative/source.coop), and I have
opened issue/PR source-cooperative/source.coop#570 to track the change.
(Existing PR, to be reworked to this ADR.)

## Related Issues

#230, #231, #232, #233, #235; developmentseed/multistore#146,
developmentseed/multistore#147; source-cooperative/source.coop#491,
source-cooperative/source.coop#548, source-cooperative/source.coop#561,
source-cooperative/source.coop#570, source-cooperative/source.coop#580.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
alukach added a commit to source-cooperative/source.coop that referenced this pull request Sep 29, 2026
#580)

Into #570's branch, as the in-place rework that PR's description will
need once this merges; #570 then no longer depends on the proxy and can
land before it. Implements ADR-013 as revised in
source-cooperative/data.source.coop#234. Part of #491 and #548.

## What

**The key is opaque.** `sck_` + 32 random bytes in base64url, a fixed 47
characters matching `^sck_[A-Za-z0-9_-]{43}$`, from `randomBytes` (not
the modulo-biased legacy generator). Its SHA-256 is the record's
partition key; a random public `key_id` is what the UI, revoke and
expiry actions handle. The table's `account_id` index stands. Nothing
signs the key and nothing calls the proxy at issue: `proxy-keys.ts`, the
Ory ID-token round-trip and the compensating delete are gone, and
`getOryIdToken` is private again.

**The proxy asks by hash, as itself.** `POST
/api/v1/service-account-keys/exchanges` takes `{key_hash}` and answers
`{account_id, key_id, active: true}` for a live key, or `{active:
false}` for an unknown, revoked, expired or disabled one, with the
reason only in the log under the forwarded `x-request-id`. Because the
proxy does not yet know which account is calling, the route
authenticates the proxy itself: `verifyProxyAssertion`, extracted from
`authenticateWithOidcToken` and logging under its own operation name,
verifies the assertion, and the route accepts only the sentinel subject
`urn:source:data-proxy`. `authenticateWithOidcToken` refuses that
subject outright, so it can never become a session, and the route never
touches `getApiSession`, so no cookie reaches it. Last use is recorded
best-effort: a throttled write must not refuse a live key.

**The hash stays on the server.** `ServiceAccountKeyRecord` is the
stored row; `publicKey` strips `key_hash` before either page hands
records to the client component. The Storybook mock returns a key of the
real shape.

**The key UI works end to end.** Opening the issue dialog threw on
#570's branch: its "Never" expiry option had an empty value, which Radix
Select refuses. The select is now `ApiKeyExpiryField`, where "never"
stands for the empty `expires_in_days` the actions read as no expiry.
The smoke test renders its stories, and it skips the dialogs that
contain it, which is how the crash went unnoticed. The show-once view
prints the five variables a stock AWS SDK or the AWS CLI needs to use
the key from a file, filled in for this environment's proxy, with the
same `role/FullAccess` ARN form and region as the GitHub workflow
snippet. `setApiKeyExpiry` had no caller: each live key now has a
"Change expiry" dialog on the same field. The key list says to disable
the account to stop every key at once, and the danger zone says what
disabling does to credentials already issued and warns that enabling
lets unrevoked keys sign in again.

**Decisions to flag.**
- `revokeApiKey` and `setApiKeyExpiry` find the key via
`listByAccount(...).find(key_id)` rather than a third index: one query,
and the ownership check comes free.
- The route answers `active: false` rather than 404 for an unknown hash,
so the proxy's existing cache code applies and the client learns nothing
it did not already hold.
- `after()` is not used for the last-use write; it is awaited in a
`try/catch` because `after()` throws outside a request scope and would
need mocking in every route test.
- The printed `AWS_ROLE_ARN` names `FullAccess`, like the GitHub snippet
already on `main`; both work once
source-cooperative/data.source.coop#221 serves the named roles. Until
then, `role/_default` is the name the proxy accepts.

## Stories

- `IssueApiKeyDialog` › **Default**:
https://source-coop-ui-git-feat-opaque-api-keys-radiantearth.vercel.app/?path=/story/features-service-accounts-issueapikeydialog--default.
Open it, pick "Never", and submit to reach the show-once view with the
variables.
- `ApiKeyExpiryField` › **Default**, **Never**:
https://source-coop-ui-git-feat-opaque-api-keys-radiantearth.vercel.app/?path=/story/features-service-accounts-apikeyexpiryfield--default
- `ServiceAccountDetail` › **Default**, with "Change expiry" on each
live key:
https://source-coop-ui-git-feat-opaque-api-keys-radiantearth.vercel.app/?path=/story/features-service-accounts-serviceaccountdetail--default
- `ServiceAccountDetail` › **Disabled**, with the re-enable warning:
https://source-coop-ui-git-feat-opaque-api-keys-radiantearth.vercel.app/?path=/story/features-service-accounts-serviceaccountdetail--disabled
- `ServiceAccountList` › **Default**:
https://source-coop-ui-git-feat-opaque-api-keys-radiantearth.vercel.app/?path=/story/features-service-accounts-serviceaccountlist--default

Captured from a static Storybook build with headless Chromium, with no
page errors:

![The issue dialog with a label and "Never — until revoked"
chosen](https://raw.githubusercontent.com/source-cooperative/source.coop/assets/opaque-api-keys/issue-api-key-form.png)

![The show-once view: the key, and five export lines for AWS_ROLE_ARN,
AWS_WEB_IDENTITY_TOKEN_FILE, AWS_ENDPOINT_URL_STS, AWS_ENDPOINT_URL_S3
and AWS_REGION with a copy
button](https://raw.githubusercontent.com/source-cooperative/source.coop/assets/opaque-api-keys/issue-api-key-show-once.png)

![The change-expiry dialog: "When should HPC cron job expire?" with the
expiry select, Close and
Save](https://raw.githubusercontent.com/source-cooperative/source.coop/assets/opaque-api-keys/change-expiry.png)

![A disabled service account: the API keys section with Change expiry
and Revoke on the live key, and the danger zone warning that enabling
lets unrevoked keys sign in
again](https://raw.githubusercontent.com/source-cooperative/source.coop/assets/opaque-api-keys/detail-disabled.png)

## Testing

- `npx jest` on the touched suites, 5 suites and 204 tests, all passing:
- `service-account-keys.test.ts`: stores only the hash and returns the
key once; a different key each time; no-expiry; disabled account,
non-manager, bad label and bad expiry refused before any write; revoke
and expiry by `key_id`.
- `oidc.test.ts`: the existing 16, plus: the sentinel never becomes a
session even if an account had that id; `verifyProxyAssertion` returns
claims without resolving anyone, and null for wrong issuer, wrong
audience, expired, or no token.
- The exchanges route: active with account and last-use written; still
active when the write fails; revoked, expired, disabled and unknown all
answer inactive without a write; 401 for any other subject or none; 400
for a non-hex body.
- `ApiKeyExpiryField.test.tsx`: 90 days by default; an empty value for
"never".
- The stories smoke test, which now renders both `ApiKeyExpiryField`
stories.
- `npm run type-check`, `npm run lint` (one `require()` warning in the
new route test, the same pattern as the trusts route test), `npm run
build-storybook`: clean.
- The screenshots above drive both dialogs in a real browser, including
choosing "Never", which crashed before.

## Docs and ADRs

data.source.coop: ADR-013 as revised in
source-cooperative/data.source.coop#234 is what this implements. The
route contract here (`{key_hash}` in, always-200 standing out,
proxy-as-itself auth) is the seam that
source-cooperative/data.source.coop#235 calls;
source-cooperative/data.source.coop#235 is the proxy PR replacing
source-cooperative/data.source.coop#233. The ADR-005 amendment in
source-cooperative/data.source.coop#234 records the sentinel subject.

docs.source.coop: the unattended-workflow guide
(source-cooperative/docs.source.coop#34) carries the setup the show-once
view prints, and uses the same variables. Nothing existing describes
keys.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

https://claude.ai/code/session_01R1eiTse4416N6uTgAy4Ddd

---------

Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
alukach added a commit to source-cooperative/source.coop that referenced this pull request Sep 29, 2026
#580)

Into #570's branch, as the in-place rework that PR's description will
need once this merges; #570 then no longer depends on the proxy and can
land before it. Implements ADR-013 as revised in
source-cooperative/data.source.coop#234. Part of #491 and #548.

## What

**The key is opaque.** `sck_` + 32 random bytes in base64url, a fixed 47
characters matching `^sck_[A-Za-z0-9_-]{43}$`, from `randomBytes` (not
the modulo-biased legacy generator). Its SHA-256 is the record's
partition key; a random public `key_id` is what the UI, revoke and
expiry actions handle. The table's `account_id` index stands. Nothing
signs the key and nothing calls the proxy at issue: `proxy-keys.ts`, the
Ory ID-token round-trip and the compensating delete are gone, and
`getOryIdToken` is private again.

**The proxy asks by hash, as itself.** `POST
/api/v1/service-account-keys/exchanges` takes `{key_hash}` and answers
`{account_id, key_id, active: true}` for a live key, or `{active:
false}` for an unknown, revoked, expired or disabled one, with the
reason only in the log under the forwarded `x-request-id`. Because the
proxy does not yet know which account is calling, the route
authenticates the proxy itself: `verifyProxyAssertion`, extracted from
`authenticateWithOidcToken` and logging under its own operation name,
verifies the assertion, and the route accepts only the sentinel subject
`urn:source:data-proxy`. `authenticateWithOidcToken` refuses that
subject outright, so it can never become a session, and the route never
touches `getApiSession`, so no cookie reaches it. Last use is recorded
best-effort: a throttled write must not refuse a live key.

**The hash stays on the server.** `ServiceAccountKeyRecord` is the
stored row; `publicKey` strips `key_hash` before either page hands
records to the client component. The Storybook mock returns a key of the
real shape.

**The key UI works end to end.** Opening the issue dialog threw on
#570's branch: its "Never" expiry option had an empty value, which Radix
Select refuses. The select is now `ApiKeyExpiryField`, where "never"
stands for the empty `expires_in_days` the actions read as no expiry.
The smoke test renders its stories, and it skips the dialogs that
contain it, which is how the crash went unnoticed. The show-once view
prints the five variables a stock AWS SDK or the AWS CLI needs to use
the key from a file, filled in for this environment's proxy, with the
same `role/FullAccess` ARN form and region as the GitHub workflow
snippet. `setApiKeyExpiry` had no caller: each live key now has a
"Change expiry" dialog on the same field. The key list says to disable
the account to stop every key at once, and the danger zone says what
disabling does to credentials already issued and warns that enabling
lets unrevoked keys sign in again.

**Decisions to flag.**
- `revokeApiKey` and `setApiKeyExpiry` find the key via
`listByAccount(...).find(key_id)` rather than a third index: one query,
and the ownership check comes free.
- The route answers `active: false` rather than 404 for an unknown hash,
so the proxy's existing cache code applies and the client learns nothing
it did not already hold.
- `after()` is not used for the last-use write; it is awaited in a
`try/catch` because `after()` throws outside a request scope and would
need mocking in every route test.
- The printed `AWS_ROLE_ARN` names `FullAccess`, like the GitHub snippet
already on `main`; both work once
source-cooperative/data.source.coop#221 serves the named roles. Until
then, `role/_default` is the name the proxy accepts.

## Stories

- `IssueApiKeyDialog` › **Default**:
https://source-coop-ui-git-feat-opaque-api-keys-radiantearth.vercel.app/?path=/story/features-service-accounts-issueapikeydialog--default.
Open it, pick "Never", and submit to reach the show-once view with the
variables.
- `ApiKeyExpiryField` › **Default**, **Never**:
https://source-coop-ui-git-feat-opaque-api-keys-radiantearth.vercel.app/?path=/story/features-service-accounts-apikeyexpiryfield--default
- `ServiceAccountDetail` › **Default**, with "Change expiry" on each
live key:
https://source-coop-ui-git-feat-opaque-api-keys-radiantearth.vercel.app/?path=/story/features-service-accounts-serviceaccountdetail--default
- `ServiceAccountDetail` › **Disabled**, with the re-enable warning:
https://source-coop-ui-git-feat-opaque-api-keys-radiantearth.vercel.app/?path=/story/features-service-accounts-serviceaccountdetail--disabled
- `ServiceAccountList` › **Default**:
https://source-coop-ui-git-feat-opaque-api-keys-radiantearth.vercel.app/?path=/story/features-service-accounts-serviceaccountlist--default

Captured from a static Storybook build with headless Chromium, with no
page errors:

![The issue dialog with a label and "Never — until revoked"
chosen](https://raw.githubusercontent.com/source-cooperative/source.coop/assets/opaque-api-keys/issue-api-key-form.png)

![The show-once view: the key, and five export lines for AWS_ROLE_ARN,
AWS_WEB_IDENTITY_TOKEN_FILE, AWS_ENDPOINT_URL_STS, AWS_ENDPOINT_URL_S3
and AWS_REGION with a copy
button](https://raw.githubusercontent.com/source-cooperative/source.coop/assets/opaque-api-keys/issue-api-key-show-once.png)

![The change-expiry dialog: "When should HPC cron job expire?" with the
expiry select, Close and
Save](https://raw.githubusercontent.com/source-cooperative/source.coop/assets/opaque-api-keys/change-expiry.png)

![A disabled service account: the API keys section with Change expiry
and Revoke on the live key, and the danger zone warning that enabling
lets unrevoked keys sign in
again](https://raw.githubusercontent.com/source-cooperative/source.coop/assets/opaque-api-keys/detail-disabled.png)

## Testing

- `npx jest` on the touched suites, 5 suites and 204 tests, all passing:
- `service-account-keys.test.ts`: stores only the hash and returns the
key once; a different key each time; no-expiry; disabled account,
non-manager, bad label and bad expiry refused before any write; revoke
and expiry by `key_id`.
- `oidc.test.ts`: the existing 16, plus: the sentinel never becomes a
session even if an account had that id; `verifyProxyAssertion` returns
claims without resolving anyone, and null for wrong issuer, wrong
audience, expired, or no token.
- The exchanges route: active with account and last-use written; still
active when the write fails; revoked, expired, disabled and unknown all
answer inactive without a write; 401 for any other subject or none; 400
for a non-hex body.
- `ApiKeyExpiryField.test.tsx`: 90 days by default; an empty value for
"never".
- The stories smoke test, which now renders both `ApiKeyExpiryField`
stories.
- `npm run type-check`, `npm run lint` (one `require()` warning in the
new route test, the same pattern as the trusts route test), `npm run
build-storybook`: clean.
- The screenshots above drive both dialogs in a real browser, including
choosing "Never", which crashed before.

## Docs and ADRs

data.source.coop: ADR-013 as revised in
source-cooperative/data.source.coop#234 is what this implements. The
route contract here (`{key_hash}` in, always-200 standing out,
proxy-as-itself auth) is the seam that
source-cooperative/data.source.coop#235 calls;
source-cooperative/data.source.coop#235 is the proxy PR replacing
source-cooperative/data.source.coop#233. The ADR-005 amendment in
source-cooperative/data.source.coop#234 records the sentinel subject.

docs.source.coop: the unattended-workflow guide
(source-cooperative/docs.source.coop#34) carries the setup the show-once
view prints, and uses the same variables. Nothing existing describes
keys.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

https://claude.ai/code/session_01R1eiTse4416N6uTgAy4Ddd

---------

Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
alukach added a commit to source-cooperative/source.coop that referenced this pull request Sep 29, 2026
…accounts (#570)

Closes #548. Closes #546. API keys are the second Integration type
beside the GitHub trusts #567 shipped, and #566 replaced proof of
control with per-account trust. The `source.coop` half of #548. Part of
#491.

**Merge order:** this can merge and deploy before the proxy. It no
longer calls the proxy; the proxy calls it.
source-cooperative/data.source.coop#235 is the proxy half and needs the
route here to be live, or every key exchange fails closed.

## What

API keys for environments without OIDC — a server, a scheduler, an
instrument — per ADR-013 as revised in
source-cooperative/data.source.coop#234: **a key is an opaque secret
that source.coop resolves by hash; nothing signs it.** Six commits on
`main`: the original feature, dropping the Ory-id guard once #567
namespaced service-account ids, #580's rework to opaque keys, the key
hint, a calmer key list, and that list as its own component with
stories.

**The key** is `sck_` + 32 random bytes in base64url: a fixed 47
characters, all entropy after the prefix, matching
`sck_[A-Za-z0-9_-]{43}`, which is what gets registered with secret
scanners (#561). It is shown once and never stored.

**The record** (`service-account-keys` table) is keyed by the key's hex
SHA-256, with a public `key_id` (a UUID) for listing, revoking and
changing expiry, a label, who issued it and when, an optional expiry,
`revoked_at` and `last_used_at`. `publicKey()` strips the hash before
any record reaches a client component.

**The hint**: the record also keeps the key's last four characters, and
the key list shows each key as `sck_…Xy9Q`, so someone holding a key can
tell which record, and so which service account, it is. Four characters
are 24 of the key's 256 random bits, leaving far too many to guess. The
hint only confirms a key in hand against its record; it is never used to
look a key up, since keys across the platform will share it. The issue
dialog says how the new key will be listed. Keys issued before the hint
existed are listed without one.

**Issuing** (`issueApiKey`): whoever manages the service account gives a
label and an expiry (30/90/365 days, or never). The action generates the
key, writes the record and returns the key once. A disabled service
account is refused. **Revoking** sets `revoked_at`; **expiry** can be
changed after issuance, including to never.

**Exchanging**: `POST /api/v1/service-account-keys/exchanges` with
`{key_hash}` is what the proxy calls at `/.sts` when a key is presented,
authenticated as the proxy itself (`verifyProxyAssertion`, sentinel
subject `urn:source:data-proxy`, recorded in the ADR-005 amendment in
source-cooperative/data.source.coop#234). It always answers 200 with
`{account_id, key_id, active}`. `active` means known, not revoked, not
expired, and its service account not disabled; an unknown hash is
answered as inactive, indistinguishable from a revoked one. It records
last use. The proxy caches the answer for 60s, so revocation takes
effect for new exchanges within that time; credentials already issued
live to their session cap.

**Resolving the subject**: after an exchange, the proxy's credentials
name the service account itself, and `authenticateWithOidcToken`
resolves it with `fetchByOryId`, then a service account by id. No
service account's id can be someone's Ory identity id: #567 namespaces
it as `{owner}--{id}`, and a UUID never contains `--`.

**UI**: the service account's page (#567's `ServiceAccountDetail`) has
an API keys section, rendered by `ApiKeyList`, a row per key. On the
left, the label with a Revoked or Expired marker, and the key's hint
beneath. On the right, two short lines: how it has been used ("Used 3
days ago", "Never used") and when it ends ("Expires in 5 months", "Never
expires", "Revoked 9 months ago"). The exact dates, and who issued the
key and when, are in their tooltip. Change expiry and Revoke are in a
"⋯" menu; a revoked key has none, and keeps an invisible copy of the
button so its lines align. The section header carries
`IssueApiKeyDialog`, which shows the key once with a copy button, and
the environment variables that point any AWS SDK or the AWS CLI at the
proxy. The list row counts live keys as a way to sign in.

![The API keys section: HPC cron job over sck_…Xy9Q, with Used 6 months
ago and Expires in 5 months on the right and a ⋯ menu; Old laptop,
marked REVOKED, over sck_…a_7k, with Never used and Revoked 9 months
ago](https://raw.githubusercontent.com/source-cooperative/source.coop/assets/service-account-management/service-account-key-rows.png)

Every state a key can be in, from `ApiKeyList`'s Default story:

![Five keys: HPC cron job, used 3 days ago, expires in 5 months;
Instrument uploader, used today, never expires; Laptop, for testing,
never used, expires next month; Last year's sync marked EXPIRED, used
last month, expired last month; Old laptop marked REVOKED, never used,
revoked 9 months ago. Each shows its sck_… hint; live keys have a ⋯
menu](https://raw.githubusercontent.com/source-cooperative/source.coop/assets/service-account-management/api-key-list-states.png)

## Stories

- `ApiKeyList` › **Default** (every key state), **Single**,
**WithoutHint**, **Empty** —
https://source-coop-ui-git-feat-service-account-keys-radiantearth.vercel.app/?path=/story/features-service-accounts-apikeylist--default
(dates are set relative to today; hover a row's dates for the exact
ones)
- `ServiceAccountDetail` › **Default** —
https://source-coop-ui-git-feat-service-account-keys-radiantearth.vercel.app/?path=/story/features-service-accounts-serviceaccountdetail--default
- `ServiceAccountList` › **Default** —
https://source-coop-ui-git-feat-service-account-keys-radiantearth.vercel.app/?path=/story/features-service-accounts-serviceaccountlist--default
- `IssueApiKeyDialog` › **Default** —
https://source-coop-ui-git-feat-service-account-keys-radiantearth.vercel.app/?path=/story/features-service-accounts-issueapikeydialog--default
(submitting reaches the show-once view with the hint line)
- `ApiKeyExpiryField` —
https://source-coop-ui-git-feat-service-account-keys-radiantearth.vercel.app/?path=/story/features-service-accounts-apikeyexpiryfield--default

## Testing

- `npx jest` — 79 suites, 835 tests, all pass on the branch as rebased
onto `main`. `service-account-keys.test.ts` covers issuing (the record
holds the hash, never the key; the hint is the key's last four
characters; the key is returned once), no-expiry keys, refusals before
any write, revoking only own keys, and expiry changes including to
never. The exchanges route test covers the proxy-only auth, active and
inactive answers, and last-use recording.
- `npm run type-check`, `next lint`, `npm run build-storybook` — clean.

## Docs and ADRs

data.source.coop: this implements ADR-013 as revised in
source-cooperative/data.source.coop#234, with ADR-014 from
source-cooperative/data.source.coop#232; the proxy side is
source-cooperative/data.source.coop#235, which supersedes
source-cooperative/data.source.coop#233. The hint is a display detail
the ADR doesn't need. docs.source.coop: the unattended-workflow guide,
source-cooperative/docs.source.coop#37 for
source-cooperative/docs.source.coop#34, should mention matching a key to
its account by its last four characters.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
alukach added a commit that referenced this pull request Sep 30, 2026
Supersedes #233. Implements the proxy half of API keys as recorded in
the revised ADR-013 (#234, stacked on #232). Pairs with
source-cooperative/source.coop#580 (into
source-cooperative/source.coop#570's branch), which serves the route
this calls. Closes #231. Part of source-cooperative/source.coop#491.

## What I'm changing

A service account's API key is an opaque `sck_` secret, 30 random base62
characters and a six-character CRC-32 checksum of them (ADR-013, #242),
that source.coop stores only as a SHA-256 hash. Nothing signs it.
`/.sts` now accepts one as `WebIdentityToken` and resolves it by asking
source.coop:

- **Body only.** A key is read from the POST form body. One in the query
string is refused before any lookup with `API key must be sent in the
request body, not the URL (request id …)`, because Cloudflare logs
request URLs. A JWT in the query string still goes to the STS route as
before.
- **Local checks first.** Trim surrounding whitespace, since every
hand-made token file ends in a newline, then require exactly `sck_` + 36
base62 characters whose last six are the CRC-32 of the thirty before
them (IEEE, as zlib computes it, written out in a few lines rather than
a crate). Anything else with the `sck_` prefix is refused without a
lookup.
- **One lookup, cached.** `POST
{SOURCE_API_URL}/api/v1/service-account-keys/exchanges` with
`{"key_hash"}`, authenticated as the proxy itself (sentinel subject
`urn:source:data-proxy`, the one route ADR-005 now lets the proxy call
as itself). The route always answers 200: `{account_id, key_id, active:
true}` or `{active: false}`. Both are cached for 60 seconds, so
revocation takes effect within a minute and an unknown key costs one
lookup a minute. A non-200 or network failure fails closed as a 500
`InternalError`, which SDKs retry, and caches nothing.
- **One refusal for the key, and one for a mangled one.** A key that
fails its shape or checksum was cut short or mistyped, and reads
`InvalidIdentityToken: API key is malformed; check that it was copied
whole (request id …)`; the format is public, so this reveals nothing,
and it still counts against the rate limit. Unknown, revoked, expired
and disabled all read `InvalidIdentityToken: API key was not accepted
(request id …)`, with the id also in `x-amzn-requestid`. The id is in
the message because SDKs show the user nothing else. The proxy logs one
WARN line per refusal with the reason it knows (`malformed`, `inactive`,
`query_string`, `rate_limited`) plus the key id and an 8-hex hash
prefix; source.coop logs which of unknown, revoked, expired or disabled
under the same request id.
- **Minting.** Credentials for the named account under the `_default`
role, sealed like every other session, with the same 900s floor, 3600s
default and `STS_MAX_SESSION_DURATION_SECS` cap. `RoleArn`'s account
segment is ignored, as for an Ory token. `ReadOnly`/`FullAccess` arrive
with #221.
- **Rate limit.** A new `KEY_EXCHANGE_LIMIT` ratelimit binding, 100
attempts a minute per client IP, in every wrangler config. A client
exchanges about once a session, so a cluster behind one NAT stays far
under it. A deployment without the binding logs an error and does not
refuse traffic.

**Decisions to flag**

- **The limit applies to every `sck_` attempt, not only cache misses.**
The cache sits inside the fetch helper, and at 100 a minute per IP the
distinction makes no difference to legitimate traffic. ADR-013's wording
is updated in #234 to match.
- **No `<RequestId>` element in the STS error XML.** That lives in
multistore-sts's `build_sts_error_response`; the header plus the message
cover what SDKs surface, so no upstream change is needed now.
- **`namespace_id`s `1001` (production), `1002` (staging) and `1003`
(previews)** for the ratelimit binding. They only need to be unique
within the Cloudflare account.
- **CodeQL flags `key_hash` as weak password hashing (`src/keys.rs`),
and it should be dismissed as a false positive.** The rule matches on
the name: it takes the key for a password. A key is 256 random bits, so
a slow hash or salt adds nothing, and the lookup is a key get, so there
is no comparison to time. This is how GitHub stores its own tokens, and
ADR-013 (#234) records it so nobody later "fixes" it to bcrypt. I have
not dismissed the alert; that is the repo owner's call.
- **Security Audit.** It failed here because `main`'s lockfile carried a
rustls advisory (RUSTSEC-2026-0285). #238 fixed that on `main`, and this
branch is rebased onto the fix.

## How I did it

- `src/keys.rs` (new, wasm-free): `parse_api_key`, `looks_like_api_key`,
`key_hash`, `KeyStanding`, `credentials_for`.
- `src/lib.rs`: `api_key_exchange` runs after `ApiAuth` is built and
before the router, and returns `None` for anything that isn't an `sck_`
exchange so the STS route handles it unchanged. `exchange_api_key` does
the lookup and minting; `key_refusal` builds the uniform refusal;
`finish` adds CORS and the request-id headers to a pre-gateway response;
`within_rate_limit` wraps the binding.
- `src/source_api/auth.rs`: `PROXY_SELF_SUBJECT`, `ApiCaller`
(anonymous, an account, or the proxy), `authorization_header_as_self`;
`authorization_header` refuses the sentinel so no request can claim it.
- `src/source_api/cache.rs`: `get_or_fetch_key_standing`; `cached_fetch`
takes a method, an optional JSON body and an `ApiCaller`. The cache key
is `{api_url}?key_hash={hash}`, so it is a URL, as the Cache API
requires, and is scoped to the environment's API.
- `src/sts.rs`: `default_role` factored out of
`StsCredentialRegistry::new`.
- `wrangler.toml`, `wrangler.preview.toml`: the binding per environment.
`README.md`: a Bindings table and an API keys section.

From #233 this keeps `finish`, the shape of
`api_key_exchange`/`exchange_api_key`, `credentials_for` and the method
argument to `cached_fetch`. It drops `/.keys`, minting,
self-verification against the proxy's own JWKS, the `api_key` role,
`chrono`/`rsa` and the `[patch.crates-io]` pin on multistore;
developmentseed/multistore#147 is not needed.

## How to test it

- `cargo test`: all suites, including the new `tests/keys.rs` (a key's
shape, trimming `\n` and `\r\n`, rejection of short, long, wrong-case,
mistyped, wrong-checksum, non-base62, checksum-less 47-character and JWT
tokens, checksum vectors computed independently with Python's zlib (a
CRC above 2^31, one with a leading zero), assembled with `concat!` so
scanners don't flag the file, the SHA-256 test vector, and credentials
sealed for the account within floor, default and cap). Run by the
pre-commit hook, along with `cargo clippy --target
wasm32-unknown-unknown -- -D warnings` and `cargo check --target
wasm32-unknown-unknown`.
- `pytest tests/test_api_keys.py` against `wrangler dev` and
`tests/stub_api.py`, which gains the exchanges route keyed by the hash
of fixed test keys, with a per-hash call counter. Nine tests, all
passing locally with wrangler 3.114: a live key exchanges; **an
unmodified boto3, configured only by `AWS_ROLE_ARN`,
`AWS_WEB_IDENTITY_TOKEN_FILE` (a file holding the key and a trailing
newline) and `AWS_ENDPOINT_URL_STS`, acquires credentials**; the second
exchange within 60s never reaches the API; a trailing newline is
harmless; unknown and revoked keys get byte-identical refusals apart
from the id, and the refusal is cached; a key in the query string is
refused without a lookup; malformed keys, including a mistyped one whose
checksum fails, are refused without a lookup and with the malformed
message; a wrong role is reported as such; an API 500 fails closed and
is not cached. `test_control_plane.py` and `test_writes.py` still pass;
their credentialed tests need CI's GitHub token and were skipped
locally. The checksum commits (d6745e0, 30ad22f) were run by CI's
Integration Tests job, which exchanges the new-format keys against the
worker; it passed on both.
- End to end, once source.coop#580 is on a deployment this preview
points at: issue a key from a service account's page, save it to a file,
then

  ```sh
AWS_WEB_IDENTITY_TOKEN_FILE=./key
AWS_ROLE_ARN=arn:aws:iam::000000000000:role/_default \
AWS_ENDPOINT_URL_STS=https://<preview>/.sts
AWS_ENDPOINT_URL_S3=https://<preview> AWS_REGION=us-east-1 \
    aws s3 ls s3://<owner>/<product>/
  ```

Revoke the key and see the next exchange refused within 60s, then quote
the printed request id to find the proxy's and source.coop's log lines.
Not run here: it needs source-cooperative/source.coop#580 deployed.

## PR Checklist

- [x] This PR has **no** breaking changes. (JWT exchanges at `/.sts` are
unchanged; the new binding is additive.)
- [x] I have updated or added new tests to cover the changes in this PR.
- [x] This PR affects the [Source Cooperative Frontend &
API](https://github.com/source-cooperative/source.coop), and I have
opened issue/PR source-cooperative/source.coop#580 to track the change.

## Related Issues

Closes #231. Supersedes #233. ADR: #234 (revises ADR-013, amends
ADR-005). Route: source-cooperative/source.coop#580, into
source-cooperative/source.coop#570. Epic:
source-cooperative/source.coop#491.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

https://claude.ai/code/session_01R1eiTse4416N6uTgAy4Ddd

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>

This branch was successfully deployed

1 active deployment
preview — e4e418f3 Deployed Sep 23, 2026 by alukach via Deploy & Test / Deploy #346
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Accept API-key JWTs at /.sts: jti revocation check, latency floor, and key minting

1 participant