Skip to content

feat(security): 429 rate limiting on public evidence/JWKS endpoints (v0.1.25.46)#224

Merged
amavashev merged 1 commit into
mainfrom
feat/public-endpoint-rate-limit
Jul 4, 2026
Merged

feat(security): 429 rate limiting on public evidence/JWKS endpoints (v0.1.25.46)#224
amavashev merged 1 commit into
mainfrom
feat/public-endpoint-rate-limit

Conversation

@amavashev

Copy link
Copy Markdown
Collaborator

feat(security): 429 rate limiting on public evidence/JWKS endpoints (v0.1.25.46)

Implements the spec's SHOULD-level throttling on the only anonymous
surface (GET /v1/evidence/* and the CyclesEvidence JWKS).
PublicEndpointRateLimitFilter: fixed 60s window per client IP,
in-process (abuse damping, not a distributed quota); over-limit
requests get 429 with error=LIMIT_EXCEEDED (new ErrorCode, spec
v0.1.25.12 / runcycles/cycles-protocol#122 — the runtime enum
previously had no throttling code, making a conformant 429 impossible),
Retry-After, X-RateLimit-Reset, X-RateLimit-Remaining: 0, and the
standard correlation headers. Authenticated /v1 endpoints not covered —
abuse there is key-attributable.

Config: CYCLES_PUBLIC_RATE_LIMIT_ENABLED (default true),
CYCLES_PUBLIC_RATE_LIMIT_REQUESTS_PER_MINUTE (default 300). Per
instance, keyed on the socket peer; deployments behind a
connection-terminating ingress should limit at the ingress and/or
raise the limit (documented in README + CHANGELOG).

Bounded client map (10k, stale-window eviction); injectable clock for
deterministic tests. 500 tests green (incl. new filter unit suite:
limits, rollover, per-client isolation, both paths, disabled flag,
header/body conformance), spec coverage 11/11, JaCoCo >=95% met,
contract tests pinned to the spec revision from cycles-protocol#122.

Revision 0.1.25.45 -> 0.1.25.46 (pom + prod compose pins);
CHANGELOG/AUDIT/README updated. Depends on cycles-protocol#122
(LIMIT_EXCEEDED enum value) for contract-test green on main.

…v0.1.25.46)

Implements the spec's SHOULD-level throttling on the only anonymous
surface (GET /v1/evidence/* and the CyclesEvidence JWKS).
PublicEndpointRateLimitFilter: fixed 60s window per client IP,
in-process (abuse damping, not a distributed quota); over-limit
requests get 429 with error=LIMIT_EXCEEDED (new ErrorCode, spec
v0.1.25.12 / runcycles/cycles-protocol#122 — the runtime enum
previously had no throttling code, making a conformant 429 impossible),
Retry-After, X-RateLimit-Reset, X-RateLimit-Remaining: 0, and the
standard correlation headers. Authenticated /v1 endpoints not covered —
abuse there is key-attributable.

Config: CYCLES_PUBLIC_RATE_LIMIT_ENABLED (default true),
CYCLES_PUBLIC_RATE_LIMIT_REQUESTS_PER_MINUTE (default 300). Per
instance, keyed on the socket peer; deployments behind a
connection-terminating ingress should limit at the ingress and/or
raise the limit (documented in README + CHANGELOG).

Bounded client map (10k, stale-window eviction); injectable clock for
deterministic tests. 500 tests green (incl. new filter unit suite:
limits, rollover, per-client isolation, both paths, disabled flag,
header/body conformance), spec coverage 11/11, JaCoCo >=95% met,
contract tests pinned to the spec revision from cycles-protocol#122.

Revision 0.1.25.45 -> 0.1.25.46 (pom + prod compose pins);
CHANGELOG/AUDIT/README updated. Depends on cycles-protocol#122
(LIMIT_EXCEEDED enum value) for contract-test green on main.
@amavashev amavashev merged commit c5a2b85 into main Jul 4, 2026
8 checks passed
@amavashev amavashev deleted the feat/public-endpoint-rate-limit branch July 4, 2026 12:15
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