You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: draft-ietf-httpapi-ratelimit-headers.md
+28-25Lines changed: 28 additions & 25 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -45,6 +45,8 @@ normative:
45
45
IANA: RFC8126
46
46
HTTP: RFC9110
47
47
PROBLEM: RFC9457
48
+
SF: RFC8941
49
+
WEB-ORIGIN: RFC6454
48
50
49
51
informative:
50
52
PRIVACY: RFC6973
@@ -90,21 +92,21 @@ The following features are out of the scope of this document:
90
92
: RateLimit header fields are not meant to support authorization or other kinds of access controls.
91
93
92
94
Response status code:
93
-
: RateLimit header fields may be returned in both successful (see {{Section 15.3 of HTTP}}) and non-successful responses. This specification does not cover whether non Successful responses count on quota usage, nor does it mandates any correlation between the RateLimit values and the returned status code.
95
+
: RateLimit header fields may be returned in both successful (see {{Section 15.3 of HTTP}}) and non-successful responses. This specification does not cover whether non Successful responses count on quota usage, nor does it mandate any correlation between the RateLimit values and the returned status code.
94
96
95
97
Throttling algorithm:
96
98
: This specification does not mandate a specific throttling algorithm. The values published in the fields, including the window size, can be statically or dynamically evaluated.
97
99
98
100
Service Level Agreement:
99
-
: Conveyed quota hints do not imply any service guarantee. Server is free to throttle respectful clients under certain circumstances.
101
+
: Conveyed quota hints do not imply any service guarantee. Server is free to throttle clients that adhere to the server’s recommended limits under certain circumstances.
100
102
101
103
## Notational Conventions
102
104
103
105
{::boilerplate bcp14}
104
106
105
-
The term Origin is to be interpreted as described in Section 7 of{{!WEB-ORIGIN=RFC6454}}.
107
+
The term Origin is to be interpreted as described in {{Section 7 ofWEB-ORIGIN}}.
106
108
107
-
This document uses the terms List, Item and Integer from {{Section 3 of !STRUCTURED-FIELDS=RFC9651}} to specify syntax and parsing, along with the concept of "bare item".
109
+
This document uses the terms List, Item and Integer from {{Section 3 of SF}} to specify syntax and parsing, along with the concept of "bare item".
108
110
109
111
The term "problem type" in this document is to be interpreted as described in [PROBLEM].
110
112
@@ -129,25 +131,26 @@ The term "problem type" in this document is to be interpreted as described in [P
129
131
: A service limit is the currently remaining quota from a specific quota policy and, if defined, the remaining time before quota is reallocated.
130
132
131
133
List:
132
-
: A {{!STRUCTURED-FIELDS=RFC9651}} list of Items
134
+
: A {{SF}} list of Items
133
135
134
136
Item:
135
-
: A {{!STRUCTURED-FIELDS=RFC9651}} item with a set of associated parameters
137
+
: A {{SF}} item with a set of associated parameters
136
138
137
139
# RateLimit-Policy Field {#ratelimit-policy-field}
138
140
139
-
The "RateLimit-Policy" response header field is a non-empty List{{!RFC9651}} of Quota Policy Items ({{quotapolicy-item}}). The Item{{!RFC9651}} value MUST be a String{{!RFC9651}}.
141
+
The "RateLimit-Policy" response header field is a non-empty List{{SF}} of Quota Policy Items ({{quotapolicy-item}}). The Item{{SF}} value MUST be a String{{SF}}.
140
142
141
-
The field value SHOULD remain consistent over a sequence of HTTP responses. It is this characteristic that differentiates it from the [RateLimit](#ratelimit-field) field that contains information that MAY change on every request. The "RateLimit-Policy" field enables clients to control their own flow of requests based on policy information provided by the server. Situations where throttling constraints are highly dynamic are better served using the (RateLimit field)[{#ratelimit-field}] that communicates the latest service information a client can react to. Both fields can be communicated by the server when appropriate.
143
+
The field value SHOULD remain consistent over a sequence of HTTP responses. It is this characteristic that differentiates it from the [RateLimit](#ratelimit-field) field that contains information that MAY change on every request. The "RateLimit-Policy" field enables clients to control their own flow of requests based on policy information provided by the server. Situations where throttling constraints are highly dynamic are better served using the [RateLimit field](#ratelimit-field) that communicates the latest service information a client can react to. Both fields can be communicated by the server when appropriate.
142
144
143
-
Lists of Quota Policy Items ({{quotapolicy-item}}) can be split over multiple "RateLimit-Policy" fields in the same HTTP response as described in {{Section 3.1 of !STRUCTURED-FIELDS=RFC9651}}.
145
+
Lists of Quota Policy Items ({{quotapolicy-item}}) can be split over multiple "RateLimit-Policy" fields in the same HTTP response as described in {{Section 3.1 of SF}}.
A quota policy Item contains an identifier for the policy and a set of Parameters{{!RFC9651}} that contain information about a server's capacity allocation for the policy.
152
+
153
+
A quota policy Item contains an identifier for the policy and a set of Parameters{{SF}} that contain information about a server's capacity allocation for the policy.
151
154
152
155
The following parameters are defined:
153
156
@@ -224,17 +227,17 @@ The following example shows a policy with a partition key and a quota unit:
224
227
225
228
A server uses the "RateLimit" response header field to communicate the current service limit for a quota policy for a particular partition key.
226
229
227
-
The field is expressed as a List{{!RFC9651}} of Service Limit Items ({{servicelimit-item}}).
230
+
The field is expressed as a List{{SF}} of Service Limit Items ({{servicelimit-item}}).
228
231
229
-
Lists of Service Limit Items can be split over multiple "RateLimit" fields in the same HTTP response as described in {{Section 3.1 of !STRUCTURED-FIELDS=RFC9651}}.
232
+
Lists of Service Limit Items can be split over multiple "RateLimit" fields in the same HTTP response as described in {{Section 3.1 of SF}}.
230
233
231
234
~~~
232
235
RateLimit: "default";r=50;t=30
233
236
~~~
234
237
235
238
## Service Limit Item {#servicelimit-item}
236
239
237
-
Each service limit Item{{!RFC9651}} identifies the quota policy ({{quotapolicy-item}}) associated with the request and contains Parameters{{!RFC9651}} with information about the current service limit.
240
+
Each service limit Item{{SF}} identifies the quota policy ({{quotapolicy-item}}) associated with the request and contains Parameters{{SF}} with information about the current service limit.
238
241
239
242
The following parameters are defined in this specification:
240
243
@@ -247,7 +250,7 @@ The following parameters are defined in this specification:
247
250
pk:
248
251
: The OPTIONAL "pk" parameter value conveys the partition key associated to the corresponding request.
249
252
250
-
This field cannot appear in a trailer section. Other parameters are allowed and can be regarded as comments.
253
+
This field MUST NOT appear in a trailer section. Other parameters are allowed and can be regarded as comments.
251
254
252
255
Implementation- or service-specific parameters SHOULD be prefixed parameters with a vendor identifier, e.g. `acme-policy`, `acme-burst`.
"title": "Request cannot be satisifed as assigned quota has been exceeded",
315
+
"title": "Request cannot be satisfied as assigned quota has been exceeded",
313
316
"violated-policies": ["daily","bandwidth"]
314
317
}
315
318
~~~
316
319
317
320
## Temporary Reduced Capacity
318
321
319
-
This section defines the "https://iana.org/assignments/http-problem-types#temporary-reduced-capacity" problem type. A server MAY use this problem type if it wants to communicate to the client that the requests sent by the client exceed cannot currently be satisfied due to a temporary reduction in capacity due to service limitations. The server MAY chose to include a RateLimit-Policy field indicating the new temporarily lower quota. This problem type defines the extension member "violated-policies" as an array of strings, whose value is the names of policies where the quota was exceeded.
322
+
This section defines the "https://iana.org/assignments/http-problem-types#temporary-reduced-capacity" problem type. A server MAY use this problem type if it wants to communicate that the client’s requests currently cannot be satisfied due to a temporary reduction in server capacity. The server MAY choose to include a RateLimit-Policy field indicating the new temporarily lower quota. This problem type defines the extension member "violated-policies" as an array of strings, whose value is the names of policies where the quota was exceeded.
"title": "Request cannot be satisifed due to temporary server capacity constraints",
330
+
"title": "Request cannot be satisfied due to temporary server capacity constraints",
328
331
"violated-policies": ["hourly"]
329
332
}
330
333
~~~
331
334
332
335
## Abnormal Usage Detected
333
336
334
-
This section defines the "https://iana.org/assignments/http-problem-types#abnormal-usage-detected" problem type. A server MAY use this problem type to communicate to the client that it has detected a pattern of requests that suggest unintentional or malicous behaviour on the part of the client. This problem type defines the extension member "violated-policies" as an array of strings, whose value is the names of policies where the quota was exceeded.
337
+
This section defines the "https://iana.org/assignments/http-problem-types#abnormal-usage-detected" problem type. A server MAY use this problem type to communicate to the client that it has detected a pattern of requests that suggest unintentional or malicious behaviour on the part of the client. This problem type defines the extension member "violated-policies" as an array of strings, whose value is the names of policies where the quota was exceeded.
335
338
336
339
~~~ http-message
337
340
HTTP/1.1 429 Too Many Requests
@@ -376,7 +379,7 @@ Implementers concerned with response fields' size, might take into account their
376
379
377
380
# Client Behavior {#receiving-fields}
378
381
379
-
The RateLimit header fields can be used by clients to determine whether the associated request respected the server's quota policy, and as an indication of whether subsequent requests will. However, the server might apply other criteria when servicing future requests, and so the quota policy may not completely reflect whether requests will succeed.
382
+
The RateLimit header fields can be used by clients to determine whether the associated request respected the server's quota policy, and as an indication of whether subsequent requests will be successful. However, the server might apply other criteria when servicing future requests, and so the quota policy may not completely reflect whether requests will succeed.
380
383
381
384
For example, a successful response with the following fields:
382
385
@@ -430,7 +433,7 @@ An intermediary MAY alter the RateLimit header fields in such a way as to commun
430
433
431
434
An intermediary SHOULD forward a request even when presuming that it might not be serviced; the service returning the RateLimit header fields is the sole responsible of enforcing the communicated quota policy, and it is always free to service incoming requests.
432
435
433
-
This specification does not mandate any behavior on intermediaries respect to retries, nor requires that intermediaries have any role in respecting quota policies. For example, it is legitimate for a proxy to retransmit a request without notifying the client, and thus consuming quota units.
436
+
This specification does not mandate any behavior on intermediaries with respect to retries, nor does it require that intermediaries have any role in respecting quota policies. For example, it is legitimate for a proxy to retransmit a request without notifying the client, and thus consuming quota units.
434
437
435
438
[Privacy considerations](#privacy) provide further guidance on intermediaries.
436
439
@@ -636,7 +639,7 @@ A basic quota mechanism limits the number of acceptable requests in a given time
636
639
637
640
When quota is exceeded, servers usually do not serve the request replying instead with a 4xx HTTP status code (e.g. 429 or 403) or adopt more aggressive policies like dropping connections.
638
641
639
-
Quotas may be enforced on different basis (e.g. per user, per IP, per geographic area, etc.) and at different levels. For example, an user may be allowed to issue:
642
+
Quotas may be enforced on different basis (e.g. per user, per IP, per geographic area, etc.) and at different levels. For example, a user may be allowed to issue:
0 commit comments