Skip to content

Commit

Permalink
Update PROTOCOL.md with the latest changes in v7
Browse files Browse the repository at this point in the history
  • Loading branch information
marioizquierdo committed Sep 16, 2020
1 parent 4d2a319 commit be41802
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
3 changes: 1 addition & 2 deletions PROTOCOL.md
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ corresponding HTTP Status Code for the response.
| already_exists | 409 | An attempt to create an entity failed because one already exists.
| permission_denied | 403 | The caller does not have permission to execute the specified operation. It must not be used if the caller cannot be identified (use "unauthenticated" instead).
| unauthenticated | 401 | The request does not have valid authentication credentials for the operation.
| resource_exhausted | 403 | Some resource has been exhausted, perhaps a per-user quota, or perhaps the entire file system is out of space.
| resource_exhausted | 429 | Some resource has been exhausted or rate-limited, perhaps a per-user quota, or perhaps the entire file system is out of space.
| failed_precondition | 412 | The operation was rejected because the system is not in a state required for the operation's execution. For example, doing an rmdir operation on a directory that is non-empty, or on a non-directory object, or when having conflicting read-modify-write on the same resource.
| aborted | 409 | The operation was aborted, typically due to a concurrency issue like sequencer check failures, transaction aborts, etc.
| out_of_range | 400 | The operation was attempted past the valid range. For example, seeking or reading past end of a paginated collection. Unlike "invalid_argument", this error indicates a problem that may be fixed if the system state changes (i.e. adding more items to the collection). There is a fair bit of overlap between "failed_precondition" and "out_of_range". We recommend using "out_of_range" (the more specific error) when it applies so that callers who are iterating through a space can easily look for an "out_of_range" error to detect when they are done.
Expand All @@ -213,4 +213,3 @@ corresponding HTTP Status Code for the response.
| unavailable | 503 | The service is currently unavailable. This is most likely a transient condition and may be corrected by retrying with a backoff.
| dataloss | 500 | The operation resulted in unrecoverable data loss or corruption.


2 changes: 1 addition & 1 deletion docs/spec_v7.md
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ corresponding HTTP Status Code for the response.

## Differences with v5

Twirp v5 implementations need to change the following behaviors to support v7:
Note v6 was a draft and never released. Twirp implementations supporting the protocol spec v5 should update directly to support v7.

* Twirp URLs in v5 could only have the "/twirp" prefix. In v7 they can have any arbitrary prefix or no prefix. See Go PR for reference: https://github.com/twitchtv/twirp/pull/264
* Error responses with code `resource_exhausted` in v5 had the HTTP status `403`. In v7 they have status `429`. See Go PR for reference: https://github.com/twitchtv/twirp/pull/270
Expand Down

0 comments on commit be41802

Please sign in to comment.