Skip to content

v0.0.2

Pre-release
Pre-release
Compare
Choose a tag to compare
@jhump jhump released this 25 May 21:30
· 53 commits to main since this release
ac036e8

This adds numerous improvements to the knitgateway command to make it more suitable for use in production environments. This also includes some minor changes to the Go library for creating custom gateways (and which also powers knitgateway). Changes described in more detail below.

Command knitgateway

  • Add support for TLS as an HTTP server. Also adds ability to customize TLS settings as an HTTP client when connecting to RPC backends.
  • Add ability to configure CORS behavior.
  • Add signal-handling so that the gateway performs a graceful shutdown when terminated or interrupted.
  • Add periodic re-polling of descriptors, so that the gateway auto-reconfigures itself if and when the backing RPC schemas change. This allows it to update itself over time as backends are updated, without requiring a restart or redeploy.
  • Add ability to cache schema descriptors, for re-use in subsequent restart in the event that backend schema sources are unavailable (like due to network partition).
  • Add ability to configure per-request maximum parallelism.
  • Add --version flag, to easily check the version of knitgateway in use.
  • Fix a bug where requests through the gateway could inexplicably fail after a whole minute if the connections to backends used HTTP/2.

Package github.com/bufbuild/knit-go

  • Fix a bug where some headers that are request/protocol/transport-specific were incorrectly being propagated to requests to RPC backends. Some of these headers could arrive via HTTP 1.1 requests and then cause issues when propagated over HTTP/2 connections.
  • Fix error-handling for two cases:
    1. If request parameters for a top-level request in a Knit query or in a relation are invalid, an "invalid_argument" error code is now returned instead of "unknown".
    2. If a resolver returned the wrong number of results for a batch, this could bypass the Knit query's error-handling mode and result in the entire request failing, even if the relation in question was configured to catch (via @catch property in query). This is now fixed.
  • Add a vararg ...knit.HandlerOption parameter to the end of parameter list for Gateway.AsHandler, which allows providing Connect handler options when creating the handler.