Skip to content

Commit dd17fb9

Browse files
authored
Editorial review.
1 parent 0669b82 commit dd17fb9

File tree

1 file changed

+20
-14
lines changed

1 file changed

+20
-14
lines changed

draft-ietf-httpapi-ratelimit-headers.md

Lines changed: 20 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ Currently, there is no standard way for servers to communicate quotas so that cl
7171
- RateLimit-Policy: a quota policy, defined by the server, that client HTTP requests will consume.
7272
- RateLimit: the currently remaining quota available for a specific policy.
7373

74-
These fields enable establishing complex rate limiting policies, including using multiple and variable time windows and dynamic quotas, and implementing concurrency limits.
74+
These fields enable publishing complex rate limiting policies, including using multiple and variable time windows and dynamic quotas, and implementing concurrency limits.
7575

7676
## Goals {#goals}
7777

@@ -106,6 +106,8 @@ The following features are out of the scope of this document:
106106

107107
The term Origin is to be interpreted as described in {{Section 7 of WEB-ORIGIN}}.
108108

109+
The terms "request", "response", "server", "client" are from {{HTTP}}.
110+
109111
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".
110112

111113
The term "problem type" in this document is to be interpreted as described in [PROBLEM].
@@ -125,11 +127,12 @@ The term "problem type" in this document is to be interpreted as described in [P
125127
: A time window indicates a period of time associated to the allocated quota.
126128

127129
Quota Policy:
128-
: A quota policy is implemented by the server to regulate the activity within a specified quota partition, quantified in quota units, over a defined time window. This activity is restricted to a predefined limit, known as the quota. Quota policies can be advertised by servers, but they are not required to be, and more than one quota policy can affect a given request from a client to a server.
130+
: A quota policy is implemented by the server to regulate the activity within a specified quota partition, quantified in quota units, over a defined time window. This activity is restricted to a predefined limit, known as the quota. Quota policies MAY be advertised by servers; each request can be subject to more than one quota policy.
129131

130132
Service Limit:
131133
: A service limit is the currently remaining quota from a specific quota policy and, if defined, the remaining time before quota is reallocated.
132134

135+
<!-- Duplicated from notational conventions. -->
133136
List:
134137
: A {{SF}} list of Items
135138

@@ -140,9 +143,9 @@ The term "problem type" in this document is to be interpreted as described in [P
140143

141144
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}}.
142145

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.
146+
The field value SHOULD remain consistent over a sequence of 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.
144147

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}}.
148+
Lists of Quota Policy Items ({{quotapolicy-item}}) can be split over multiple "RateLimit-Policy" fields in the same response as described in {{Section 3.1 of SF}}.
146149

147150
~~~
148151
RateLimit-Policy: "burst";q=100;w=60,"daily";q=1000;w=86400
@@ -155,16 +158,16 @@ A quota policy Item contains an identifier for the policy and a set of Parameter
155158
The following parameters are defined:
156159

157160
q:
158-
: The REQUIRED "q" parameter indicates the quota allocated by this policy measured in quota units.
161+
: This REQUIRED parameter value indicates the quota allocated by this policy measured in quota units.
159162

160163
qu:
161-
: The OPTIONAL "qu" parameter value conveys the quota units associated to the "q" parameter. The default quota unit is "requests".
164+
: This OPTIONAL parameter value conveys the quota units associated to the "q" parameter. The default quota unit is "requests".
162165

163166
w:
164-
: The OPTIONAL "w" parameter value conveys a time window.
167+
: This OPTIONAL parameter value conveys a time window.
165168

166169
pk:
167-
: The OPTIONAL "pk" parameter value conveys the partition key associated to the corresponding request.
170+
: This OPTIONAL parameter value conveys the partition key associated to the corresponding request.
168171

169172
Other parameters are allowed and can be regarded as comments.
170173

@@ -174,7 +177,7 @@ This field MUST NOT appear in a trailer section.
174177

175178
### Quota Parameter {#ratelimitpolicy-quota}
176179

177-
The "q" parameter value MUST be a non-negative Integer. The value indicates the quota allocated for client activity (measured in quota units) for a given quota partition.
180+
The "q" parameter value MUST be a non-negative Integer. The value indicates the quota allocated for client activity (measured in quota units) for a given quota partition.
178181

179182
### Quota Unit Parameter {#ratelimitpolicy-quotaunit}
180183

@@ -191,7 +194,7 @@ The "qu" parameter value conveys the quota units applicable to the quota ({{rate
191194

192195
### Window Parameter {#ratelimitpolicy-window}
193196

194-
The "w" parameter value conveys a time window applicable to the quota ({{ratelimitpolicy-quota}}). The time window MUST be a non-negative, non-zero, Integer value expressing an interval in seconds, similar to the "delay-seconds" rule defined in {{Section 10.2.3 of HTTP}}. Sub-second precision is not supported.
197+
The "w" parameter value conveys a time window applicable to the quota ({{ratelimitpolicy-quota}}). The time window MUST be a positive Integer value expressing an interval in seconds, similar to the "delay-seconds" rule defined in {{Section 10.2.3 of HTTP}}. Sub-second precision is not supported.
195198

196199
### Partition Key Parameter {#ratelimitpolicy-partitionkey}
197200

@@ -245,10 +248,10 @@ The following parameters are defined in this specification:
245248
: This REQUIRED parameter value conveys the remaining quota units for the identified policy ({{ratelimit-remaining-parameter}}).
246249

247250
t:
248-
: This OPTIONAL parameter value conveys the time until additional quota is made available for the identified policy ({{ratelimit-reset-parameter}}).
251+
: This OPTIONAL parameter value conveys the time interval until additional quota is made available for the identified policy ({{ratelimit-reset-parameter}}).
249252

250253
pk:
251-
: The OPTIONAL "pk" parameter value conveys the partition key associated to the corresponding request.
254+
: This OPTIONAL parameter value conveys the partition key associated to the corresponding request.
252255

253256
This field MUST NOT appear in a trailer section. Other parameters are allowed and can be regarded as comments.
254257

@@ -369,7 +372,8 @@ Under certain conditions, a server MAY artificially lower RateLimit header field
369372

370373
## Generating Partition Keys
371374

372-
Servers MAY choose to return partition keys that distinguish between quota allocated to different consumers or different resources. There are a wide range of strategies for partitioning server capacity, including per user, per application, per HTTP method, per resource, or some combination of those values. The server SHOULD document how the partition key is generated so that clients can predict the key value for a future request and determine if there is sufficient quota remaining to execute the request. Servers should avoid returning partition keys that contain sensitive information. Servers SHOULD only use information that is present in the request to generate the partition key.
375+
Servers MAY choose to return partition keys that distinguish between quota allocated to different consumers or different resources. There are a wide range of strategies for partitioning server capacity, including per user, per application, per HTTP method, per resource, or some combination of those values. The server SHOULD document how the partition key is generated so that clients can predict the key value for a future request and determine if there is sufficient quota remaining to execute the request. Servers should avoid returning partition keys that contain sensitive information.
376+
Servers SHOULD only use information that is present in the request to generate the partition key. <!-- Maybe SHOULD use opaque pk? -->
373377

374378
## Performance Considerations
375379

@@ -417,7 +421,9 @@ Partition keys are useful for a client if it is likely that single client will m
417421

418422
If a server documents the partition key generation algorithm, clients MAY generate a partition key for a future request. Using this key, and comparing to the key returned by the server, the client can determine if there is sufficient quota remaining to execute the request.
419423

420-
For cases where the partition key generation algorithm of a server is unknown, clients MAY use heuristics to guess if a future request will be successful based on its similarity to previous requests.
424+
When the partition key generation algorithm is unknown, clients MAY use heuristics to guess if a future request will be successful based on its similarity to previous requests.
425+
426+
<!-- The above text seems to suggest a protocol... -->
421427

422428
## Intermediaries {#intermediaries}
423429

0 commit comments

Comments
 (0)