Skip to content

Commit 7b5749b

Browse files
authored
Merge pull request #146 from ietf-wg-httpapi/IETF122
Feedback from IETF 121
2 parents 2ea0f32 + f822303 commit 7b5749b

File tree

1 file changed

+20
-8
lines changed

1 file changed

+20
-8
lines changed

draft-ietf-httpapi-ratelimit-headers.md

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -125,16 +125,26 @@ This document uses the terms List, Item and Integer from {{Section 3 of !STRUCTU
125125
Service Limit:
126126
: A service limit is the currently remaining quota from a specific quota policy and, if defined, the remaining time before quota is reallocated.
127127

128+
List:
129+
: A {{!STRUCTURED-FIELDS=RFC8941}} list of Items
130+
131+
Item:
132+
: A {{!STRUCTURED-FIELDS=RFC8941}} item with a set of associated parameters
133+
128134
# RateLimit-Policy Field {#ratelimit-policy-field}
129135

130-
The "RateLimit-Policy" response header field is a non-empty List of Quota Policy Items ({{quotapolicy-item}}). The Item value MUST be a String. Its value is informative. The field value is expected to remain consistent over the lifetime of a connection. It is this characteristic that differentiates it from the [RateLimit](#ratelimit-field) field that contains information that may change on every request.
136+
The "RateLimit-Policy" response header field is a non-empty List{{!RFC8941}} of Quota Policy Items ({{quotapolicy-item}}). The Item{{!RFC8941}} value MUST be a String{{!RFC8941}}.
137+
138+
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.
139+
140+
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=RFC8941}}.
131141

132142
~~~
133143
RateLimit-Policy: "burst";q=100;w=60,"daily";q=1000;w=86400
134144
~~~
135145

136146
## Quota Policy Item {#quotapolicy-item}
137-
A quota policy Item contains an identifier for the policy and a set of parameters that contain information about a server's capacity allocation for the policy.
147+
A quota policy Item contains an identifier for the policy and a set of Parameters{{!RFC8941}} that contain information about a server's capacity allocation for the policy.
138148

139149
The following parameters are defined:
140150

@@ -154,7 +164,7 @@ Other parameters are allowed and can be regarded as comments.
154164

155165
Implementation- or service-specific parameters SHOULD be prefixed parameters with a vendor identifier, e.g. `acme-policy`, `acme-burst`.
156166

157-
This field cannot appear in a trailer section.
167+
This field MUST NOT appear in a trailer section.
158168

159169
### Quota Parameter {#ratelimitpolicy-quota}
160170

@@ -175,7 +185,7 @@ The "qu" parameter value conveys the quota units applicable to the quota ({{rate
175185

176186
### Window Parameter {#ratelimitpolicy-window}
177187

178-
The "w" parameter value conveys a time window applicable to the quota ({{ratelimitpolicy-quota}}). The time window MUST be a non-negative 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.
188+
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.
179189

180190
### Partition Key Parameter {#ratelimitpolicy-partitionkey}
181191

@@ -204,22 +214,24 @@ The following example shows a policy with a partition key:
204214
The following example shows a policy with a partition key and a quota unit:
205215

206216
~~~
207-
RateLimit-Policy: "peruser";q=65535;qu="bytes";w=10;pk=:sdfjLJUOUH==:
217+
RateLimit-Policy: "peruser";q=65535;qu="content-bytes";w=10;pk=:sdfjLJUOUH==:
208218
~~~
209219

210220
# RateLimit Field {#ratelimit-field}
211221

212-
A server uses the "RateLimit" response header field to communicate the service limit for a quota policy for a particular partition key.
222+
A server uses the "RateLimit" response header field to communicate the current service limit for a quota policy for a particular partition key.
223+
224+
The field is expressed as a List{{!RFC8941}} of Service Limit Items ({{servicelimit-item}}).
213225

214-
The field is expressed as a List of Service Limit Items ({{servicelimit-item}}).
226+
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=RFC8941}}.
215227

216228
~~~
217229
RateLimit: "default";r=50;t=30
218230
~~~
219231

220232
## Service Limit Item {#servicelimit-item}
221233

222-
Each service limit Item identifies the quota policy ({{quotapolicy-item}}) associated with the request and contains parameters with information about the current service limit.
234+
Each service limit Item{{!RFC8941}} identifies the quota policy ({{quotapolicy-item}}) associated with the request and contains Parameters{{!RFC8941}} with information about the current service limit.
223235

224236
The following parameters are defined in this specification:
225237

0 commit comments

Comments
 (0)