feat(spec,gates): require the standards-track RateLimit header fields - #105
Open
ucekmez wants to merge 1 commit into
Open
feat(spec,gates): require the standards-track RateLimit header fields#105ucekmez wants to merge 1 commit into
ucekmez wants to merge 1 commit into
Conversation
9 tasks
§13 mandated `X-RateLimit-Limit` / `-Remaining` / `-Reset` — the de-facto convention inherited from early drafts. `X-`-prefixed header names have been discouraged since RFC 6648 (2012), and mandating them on their own would be a predictable finding on the IETF path this project intends to take at v0.2. The standards-track form is `RateLimit` and `RateLimit-Policy` (draft-ietf-httpapi-ratelimit-headers, active in the httpapi WG). Both forms are kept. Removing `X-RateLimit-*` would break deployed clients for no functional gain, so §13 now requires the standards-track fields and keeps the de-facto ones as a compatibility SHOULD, with a rule that when both are present they MUST describe the same quota — an implementation that lets them drift is worse than one that sends only one. Changes: - §13 rewritten: `RateLimit` reports current state (`r` remaining, `t` seconds to reset), `RateLimit-Policy` describes the quota (`q`, `w`), `Retry-After` MUST accompany a 429. - `build429Response` emits `RateLimit` always, and `RateLimit-Policy` plus the `X-RateLimit-*` trio when a quota is known. On a 429 the remaining quota is zero by definition. - compliance-cli probes the standards-track fields as failures and the `X-` form as an optional skip, rather than probing only for `X-`. Refs: EEP audit 2026-08 finding B8 Signed-off-by: Ugur Cekmez <ucekmez@gmail.com>
ucekmez
force-pushed
the
feat/rfc9457-problem-details
branch
from
August 26, 2026 19:39
4245e37 to
11bd504
Compare
ucekmez
force-pushed
the
feat/ietf-ratelimit-headers
branch
from
August 26, 2026 19:39
6d6fb69 to
51e2c2b
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
PR 13 of a stacked series. Base is #104. Not for merge without review.
§13 mandated
X-RateLimit-Limit/-Remaining/-Reset— the de-facto convention inherited from early IETF drafts.X--prefixed header names have been discouraged since RFC 6648 (2012). Mandating them on their own is a predictable finding on the IETF path this project intends to take at v0.2. The standards-track form isRateLimitandRateLimit-Policyfrom draft-ietf-httpapi-ratelimit-headers, active in thehttpapiWG (draft-11, May 2026).Both forms are kept
Removing
X-RateLimit-*would break deployed clients for no functional gain. So §13 now requires the standards-track fields and keeps the de-facto ones as a compatibility SHOULD — plus a rule that matters: when both are present they MUST describe the same quota. An implementation that lets them drift is worse than one that sends only one form.What changed
RateLimitreports current state (rremaining,tseconds to reset),RateLimit-Policydescribes the quota (q,w),Retry-AfterMUST accompany a 429.build429ResponseemitsRateLimitalways, andRateLimit-Policy+ theX-RateLimit-*trio when a quota is known. On a 429 the remaining quota is zero by definition, which the tests pin.X-form as an optional skip — previously it probed only forX-RateLimit-Limit, which would have kept EEP pinned to the discouraged names indefinitely.Scope
Checklist
X-RateLimit-*still emitted. New normative MUST for the standards-track fields, so publishers that send only theX-form will newly fail the §13 probe. Worth a CHANGELOG line.Verification
@eep-dev/gates@eep-dev/compliance-clitests/codegen-schema-types --checkNotes for reviewers
The draft is not yet an RFC.
draft-ietf-httpapi-ratelimit-headersis an active Internet-Draft, not a published RFC, and its field syntax changed across revisions — earlier drafts defined three separateRateLimit-Limit/-Remaining/-Resetfields, the current one defines two structured fields. I've implemented the current (draft-11) two-field form. If the WG changes it again this will need a revision; pinning to the current draft still seems better than staying on a convention RFC 6648 discourages.The quota policy name is hardcoded as
"eep"inbuild429Response. A publisher with several named policies will want to pass its own; I did not add the parameter because nothing in-tree needs it yet and I'd rather not invent an API surface speculatively. Easy to add.No middleware change —
@eep-dev/middlewaredoes not implement rate limiting at all today, so there is no place to emit these from. The spec text plus the conformance probe is what makes it checkable.