-
Notifications
You must be signed in to change notification settings - Fork 136
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
feat(header forwarding): add HeaderForwarder and plumbing #507
Conversation
✅ Heimdall Review Status
|
headerforwarder/forwarder.go
Outdated
} | ||
|
||
// shouldRememberHeaders is called to determine if response headers should be remembered for a given request. | ||
// Response headers will only be remembered if the request does not contain all of the interesting |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What if a sticky session cookie is provided in the request but it expires and a new sticky session cookie comes in the response?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
technically since the Cookie
and Set-Cookie
header are different, headers for requests with cookies will always be forwarded.
If that's eventually not what we want we'd have to write custom logic to associate Cookie
and Set-Cookie
together for request/response (and storing/accessing) respectively
Hi @potterbm-cb , some CI checks failed, can you try to fix them, same for the other pr. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm, we should work on covering this repo with unit tests
closed and reopened PR to try to get the CI unstuck ("Minimum required reviews" wasn't registering the reviews) |
Motivation
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:
Cookie
andSet-Cookie
headers, which will need to be passed from the caller to the native node, and returned from the native node ALB to the callerSolution
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 anhttp.RoundTripper
, and can be applied to Mesh servers as middlewareA few key features:
http.RoundTripper
so that it can be used to create anhttp.Client
or other clientfunc(http.Handler) http.Handler
Open questions