Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added support for policy identifier #130

Merged
merged 31 commits into from
Sep 29, 2024
Merged

Conversation

darrelmiller
Copy link
Contributor

@darrelmiller darrelmiller commented Jul 19, 2023

This proposal takes what we currently have in draft-07

RateLimit-Policy: 100;w=60, 10000;w=86400
{ 50 requests and 30 seconds}
RateLimit: limit=100, remaining=50, reset=30  // protection limit
{ 1 requests and 40 seconds}
RateLimit: limit=10000, remaining=90, reset=200 // quota limit

and suggests the following alternative

RateLimit-Policy: protection;l=100;w=60, quota;l=10000;w=86400
{ 50 requests and 30 seconds}
RateLimit: protection;r=50;t=30
{ 1 request and 40 seconds}
RateLimit: quota;r=90;t=200

This proposal introduces a policy "identifier" that connects the RateLimit field to the RateLimit-Policy field. The primary purpose is to address #127.

With the change in draft-07 to use structured fields in the header we now have the opportunity to explore different approaches and features without trying to maintain similarity with past efforts.

@darrelmiller darrelmiller changed the title Darrelmiller-policyname Added support for policy identifier Jul 19, 2023
@darrelmiller darrelmiller requested a review from ioggstream July 19, 2023 02:58
@nfriedly
Copy link

nfriedly commented Nov 6, 2023

I'm a big fan of this overall, I think it's a solid improvement in terms of consistency and ease of parsing.

I am curious about the reasoning for separate RateLimit and RateLimit-Policy headers? It seems to me that the policy parameters could also be appended to the RateLimit header.

@darrelmiller
Copy link
Contributor Author

I am curious about the reasoning for separate RateLimit and RateLimit-Policy headers? It seems to me that the policy parameters could also be appended to the RateLimit header.

The split is due to variability of the values and HTTP/2 HPACK compression. RateLimit-Policy should rarely change and therefore can be optimized by header compression. RateLimit will change on ever request and therefore will not be optimized.

@ioggstream
Copy link
Collaborator

make returns this error.

draft-ietf-httpapi-ratelimit-headers.xml(0): Error: IDREF attribute target references an unknown ID "ratelimit-reset-keyword", at None

@ioggstream
Copy link
Collaborator

@darrelmiller I tried to fix the broken section references: now it should build. Could you please PTAL?

@ioggstream
Copy link
Collaborator

@nfriedly PR welcome for fixing inconsistencies :)

@richsalz
Copy link
Contributor

richsalz commented Jan 8, 2024

make returns this error.

draft-ietf-httpapi-ratelimit-headers.xml(0): Error: IDREF attribute target references an unknown ID "ratelimit-reset-keyword", at None

There's a few instances still to be cleaned up:

; grep -n ratelimit-reset-keyword *.md
draft-ietf-httpapi-ratelimit-headers.md:216:     the time window reset time ({{ratelimit-reset-keyword}}).
draft-ietf-httpapi-ratelimit-headers.md:233:- inferred by the value of the [reset keyword](#ratelimit-reset-keyword) at the moment of the reset, or
draft-ietf-httpapi-ratelimit-headers.md:263:## Reset Keyword {#ratelimit-reset-keyword}
draft-ietf-httpapi-ratelimit-headers.md:440:Consider that service limit might not be restored after the moment referenced by the [reset keyword](#ratelimit-reset-keyword),
draft-ietf-httpapi-ratelimit-headers.md:579:| RateLimit | reset                 | Dictionary Key |Quota reset interval | {{ratelimit-reset-keyword}} of {{&SELF}} |       |

Copy link
Contributor

@jidicula jidicula left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👋 hey folks - @kfcampbell shared this inside GitHub's API team as open for comment. I'm new to providing feedback on IETF proposals, so thank you for your patience if any of my comments are low-value or irrelevant to the crux of the PR 🙇‍♂️.

I've got a couple of points about wording consistency in this proposal, as well as some copyedits:

draft-ietf-httpapi-ratelimit-headers.md Outdated Show resolved Hide resolved
draft-ietf-httpapi-ratelimit-headers.md Outdated Show resolved Hide resolved
draft-ietf-httpapi-ratelimit-headers.md Outdated Show resolved Hide resolved
Copy link

@izuzak izuzak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just adding two minor comments after reading the draft. ✌️ Overall, I like the draft so far -- great work! 👏

draft-ietf-httpapi-ratelimit-headers.md Outdated Show resolved Hide resolved
draft-ietf-httpapi-ratelimit-headers.md Show resolved Hide resolved
@darrelmiller darrelmiller merged commit e3054dc into main Sep 29, 2024
0 of 2 checks passed
@darrelmiller darrelmiller deleted the darrelmiller-policyname branch September 29, 2024 19:58
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.

6 participants