Skip to content

fix(oidc): rate limit provider storage and signing per end client - #635

Merged
Bccorb merged 1 commit into
mainfrom
fix/oidc-per-client-limits
Dec 3, 2026
Merged

Bccorb merged 1 commit into
mainfrom
fix/oidc-per-client-limits

Conversation

@Bccorb

@Bccorb Bccorb commented Dec 3, 2026

Copy link
Copy Markdown
Contributor

Summary

The /oidc/* provider storage, signing and event routes now count each end client on its own, ahead of the existing shared ceilings.

  • The OpenID Provider service already forwards the end client's address in x-seamless-client-ip, and applyTrustedClientContext already honours it only alongside a valid service token. The /oidc/* limiters now key on that address (IPv6 by /56), after requireOidcEdge has confirmed the caller is the provider service.
  • One client may use a fifth of each shared ceiling: 1200 payload writes per model, 600 signatures and 600 events a minute. The shared ceilings (6000 per model, 3000, 3000) stay as the backstop.
  • A call that carries no client address, such as one from an older provider service, meets the shared ceilings alone, as before. No provider upgrade is required and no route, schema or header changes.
  • docs/ecosystem.md records that the provider's forwarded address now feeds these limits.

Tests

tests/integration/oidc/oidcEdgeRateLimits.spec.ts covers each limiter refusing one client past its share while another client continues, the fallback when no address is forwarded, IPv6 /56 keying, per-model buckets, refusal of callers without the provider token, and that an address sent with a forged token never becomes a per-client key.

npm run typecheck, npm run lint, npm run format:check, npm run build and npm run coverage (207 files, 3672 tests) pass. npm run generate:api produced no changes.

@Bccorb
Bccorb merged commit ad44644 into main Dec 3, 2026
7 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