refactor: Implemented pagination for Organizations plugin list endpoints. - #106
Merged
Conversation
… code.
- Quota rejections returned 429 Too Many Requests, which in this API already
means rate limiting: the rate-limit and api-key plugins return it paired with
Retry-After and X-RateLimit-* headers. A quota is not transient, so standard
retry middleware backed off and retried a condition that can only clear once
someone frees a slot or raises the configured limit. Quotas now return 409
Conflict, leaving 429 to mean rate limiting everywhere in the API.
- Add a typed Error carrying Code, Status and Message so error responses include
a stable machine-readable code alongside the human-readable message, and
clients no longer have to match on English prose.
- Dispatch on errors.AsType rather than error identity, so a wrapped plugin
error keeps its status and code instead of silently degrading to 400.
- Add AssertErrorResponse alongside AssertErrorMessage for asserting the code.
- Add table-driven tests covering each sentinel, wrapped and doubly wrapped
errors, delegation to the core handler, sentinel comparability, and a golden
list of the registered codes.
Affects POST /organizations, POST /organizations/{id}/members,
POST /organizations/{id}/invitations, and PATCH
/organizations/{id}/invitations/{id}/accept. members_limit defaults to 100 when
unset, so this is reachable on a default configuration.
BREAKING CHANGE: organization quota rejections return 409 instead of 429.
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.
No description provided.