Skip to content

Update docs to mesh, add header forwarder

Latest
Compare
Choose a tag to compare
@potterbm-cb potterbm-cb released this 18 Oct 18:32
bad12fa

Docs update

We publicly renamed Rosetta to Mesh, this release contains all the docs updates for that rename

Header Forwarding

Why

In order to support some common use cases, Mesh servers need the ability to pass request headers through to the native nodes, and to return headers from native node requests back to the caller.

Use cases:

  • passing a client ID header to the nodes — this client ID shouldn't originate with the Mesh server since it may have many different callers, so it should be passed through to the native node requests
  • sticky session cookies — to support sticky sessions on native nodes, AWS uses cookies. Cookies are managed by the Cookie and Set-Cookie headers, which will need to be passed from the caller to the native node, and returned from the native node ALB to the caller

Solution

The HeaderForwarder type extracts headers from potentially many native node requests and adds them to a Mesh response. HeaderForwarder can be injected into native node network requests as an http.RoundTripper, and can be applied to Mesh servers as middleware

A few key features:

  • opt-in — users of this library can choose to use or not use this feature
  • implements http.RoundTripper so that it can be used to create an http.Client or other client
  • implements a common middleware pattern: func(http.Handler) http.Handler
  • assigns every request a unique ID (which is used to associate headers from native node responses back to Mesh request/responses)
  • allows forwarding only specific headers

Changelog

Full changelog: v0.8.5...v0.8.6