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

Set v7 protocol as current version in docs #272

Merged
merged 11 commits into from
Sep 16, 2020
Merged

Conversation

marioizquierdo
Copy link
Contributor

Set the v7 protocol as the current version. Include differences with v5 so we can link other implementations to this doc. This should be merged along with a new release that enumerates all the changes that were included in this release:

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@@ -0,0 +1,15 @@
A major release that includes a protocol spec update. The jump from v5 to v7 is to avoid confusion with issues and comments that were targeting v6 and were never released (see [achieved protocol spec v6](https://twitchtv.github.io/twirp/docs/spec_v6.html)).
Copy link
Contributor

Choose a reason for hiding this comment

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

achieved => archived?


Changes in the Protocol spec v7:

* Twirp routes can have any prefix: `<prefix>/<package>.<Service>/<Method>` section. In v5 the prefix was mandatory was always `/twirp`.
Copy link
Contributor

Choose a reason for hiding this comment

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

was mandatory was always => was mandatory, always


* #264 Optional Twirp Prefix. Implements the proposal #263 with the optional prefix, using an option to specify a different prefix than the default value "/twirp". The default value ensures backwards compatibility when updating the service. Using different prefixes, it is now possible to mount the same Twirp service in multiple routes, which may help migrating existing services from the "/twirp" prefix to a new one.
* #264 also introduces [server options on the server constructor](https://github.com/twitchtv/twirp/pull/264#issuecomment-686170407). Adding server hooks should now done through a server option. The server options are available in the new version of the `twirp` package, servers generated with the new version require the `twirp` package to be updated as well.
* #270 ResourceExhausted error code to HTTP 429 status code. To implement the new spec for this error, so it is clear that this error code can be used for rate limiting. This change may affect middleware if it depends on a specific status code being used.
Copy link
Contributor

Choose a reason for hiding this comment

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

To implement the new spec for this error, so it is clear that this error code can be used for rate limiting.

This sentence doesn't quite make sense.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

😄 what was I thinking? Updated. Thanks!

PROTOCOL.md Outdated
| 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.
Copy link
Contributor

Choose a reason for hiding this comment

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

Does this need to be updated to 429?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, this entire file should be a copy-paste form the spec in the docs. Which I though I did already 🤔 good catch. I wonder if this should just contain a link to the docs ... but realistically it almost never changes, so it's fine to have some duplication 🤷

Copy link
Contributor Author

Choose a reason for hiding this comment

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

oh.. I see. I need to merge #270 first

@marioizquierdo marioizquierdo merged commit 0f72ad6 into master Sep 16, 2020
@marioizquierdo marioizquierdo deleted the release_v7 branch September 16, 2020 07:30
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.

3 participants