twirp

A simple RPC framework with protobuf service definitions

APACHE-2.0 License

Downloads
34.4K
Stars
7.1K
Committers
84

Bot releases are visible (Hide)

twirp - v5.5.1: Security vulnerability fix on Python urllib3

Published by marioizquierdo almost 6 years ago

A security vulnerability was discovered on the requirements.txt file that is used to test Python-generated code, and could be used as sub-dependency checks for Python projects using Twirp.

Fix submitted in this PR: https://github.com/twitchtv/twirp/pull/137

twirp - v5.5.0: Add support for paths=source_relative option

Published by spenczar about 6 years ago

This release adds support for a new generator option, paths=source_relative, to match the behavior of the official protoc-gen-go generator. That behavior is documented at https://github.com/golang/protobuf/pull/533.

Now, protoc-gen-twirp can work outside of GOPATH to generate code. Files are output relative to where the proto source was found.

The change to make this possible is #126.

twirp - v5.4.2: Fix code generation for services with methods of the same name

Published by spenczar about 6 years ago

This is a bug fix release. It fixes #123.

Previously, if a service had a method of the same name, the generated Go code would not compile. For example, generated code for this service would not compile:

service Echo {
  rpc Echo(Msg) returns (Msg);
}

This was fixed in #124.

twirp - v5.4.1: Fix import statement generation bug

Published by spenczar over 6 years ago

This release includes two bug fixes.

First, there was a bug in import statement generation when multiple .proto files were imported which shared an identical protobuf package, but which had different output go packages. This would most commonly occur when importing multiple "well-known type" definitions, like google/protobuf/empty.proto and google/protobuf/wrappers.proto. This was reported in #104, and fixed in #107.

Second, generated Go clients would previously return non-nil response types even when returning non-nil errors. This led to confusing behavior in some obscure cases, as users usually expect non-nil error to imply a nil response. This was fixed in #105.

twirp - v5.4.0: Support for command-line parameters to set go import paths

Published by spenczar over 6 years ago

This release includes #102, which adds support for flags for protoc-gen-twirp to map .proto files to particular Go import paths. This was requested in #13.

Documentation is available in https://github.com/twitchtv/twirp/blob/2d98ac4d4ccb29e08ea745c758e6d103f971eba5/docs/command_line.md, which is (as of this release) on the doc website at https://twitchtv.github.io/twirp/docs/command_line.html.

twirp - v5.3.0: Accept headers and no logging

Published by spenczar over 6 years ago

This release includes the following changes:

  • Generated code no longer logs with the standard library's log package under any circumstances. Previously, it would log in rare cases like when failing to write a complete error body back to clients or when failing to close request bodies. Now, those circumstances trigger an Error hook if it hasn't already been triggered once during handling of the request.
    (dfbd75ae3c12b7f8c9a355f582b635cf77c4645a)
  • Generated Go clients now set an Accept header in requests. The JSON client sets application/json, and the Protobuf client sets application/protobuf. This should make generated clients work more smoothly with API gateways. Servers don't do any particular handling with this new header and it is not required by the Twirp spec, but it's recommended that clients set it in other language implementations as well.
    (f91c5c69fd3b0f2bc8fd263b1dae3a67073fd9f0)
  • Generated Python clients now work with Python 3.
    (dbf7a0df8630b787da395fee3facdfb7ef5c38ce)
twirp - v5.2.0: Context values for clients

Published by spenczar over 6 years ago

This release includes the following changes:

  • Context values describing the requested service, package, and method are now
    available to HTTPClients passed to generated Twirp clients.
    (a22cc722f7feaeb12b7768699bf5e202464fa4b0)

  • Generated clients no longer emit logs to the standard library logger under any
    circumstances. Instead, they will return any error encountered closing an HTTP
    response body if they found no other errors during the request. If they hit
    other errors, then HTTP response body close errors are ignored.
    (c0c435531e9a1787cec6159bd6262bcf5aa48bea)

  • Handling of Content-Type headers with name=value pairs after the
    MIME type is now correct.
    (2067a95fa595ef8d484d02bdab04c922479a2225)

  • The vendor directory is now committed. This should make installation of
    protoc-gen-twirp more straightforward.
    (2642ca800080894c36e3457b9a1603e4ee752eba)

twirp - v5.1.0: New HTTPClient interface

Published by spenczar over 6 years ago

Release v5.1.0 improves the flexibility of client constructors. It also fixes some typos, fixes a bug in the generator, and makes minor performance improvements.

Generated client constructors now accept an interface, type HTTPClient interface { Do(*http.Request) (*http.Response, error) } instead of the concrete type *http.Client. This lets users provide clients that smartly retry or use custom service discovery systems. It should be backwards compatible, as *http.Client fulfills that interface and can still be plugged in without changes. This is #39, and was proposed and designed in #12.

Generated servers will avoid an unnecessary string concatenation when handling requests; the string is now precomputed. This is #53.

Code generation now works correctly if a proto file imports another proto file found in the same directory. This was #15, fixed in #47.

#36 and #44 fixed typos in documenting comments and error messages.

All associated PRs bundled into this release can be tracked found here: https://github.com/twitchtv/twirp/pulls?q=is%3Apr+is%3Aclosed+milestone%3Av5.1.0

twirp - v5.0.0: First public release

Published by spenczar almost 7 years ago

This is the first public release of Twirp. Hooray!