AuthModule : adding headers before authentication
See original GitHub issueAs a solution to https://github.com/datawire/ambassador/issues/216, we decided to add a routing service between our many auth services. The idea was to route the request depending on a http header which ambassador would add depending on the AuthService
configuration.
Sadly, add_request_headers
or envoy_override
are not available in the AuthService
schema. This can be done at the Mapping
level since it’s passed the authentication.
Describe the solution you’d like
---
apiVersion: ambassador/v0
kind: AuthService
name: auth-router
auth_service: some-auth-service
add_request_headers:
- name: x-some-auth-header
value: some-value
Describe alternatives you’ve considered
The envoy_override
could be a more advanced option.
---
apiVersion: ambassador/v0
kind: AuthService
name: auth-router
auth_service: some-auth-service
envoy_override:
request_headers_to_add:
- append: true
header:
key: x-some-auth-header
value: some-value
Third option
If a Mapping
define the add_request_headers
options, maybe add those headers to the authentication automatically.
Work around
In the end we used the host/:authority
to route our traffic, but the solution would have been much more elegant if the routing could be determined through the service’s annotation instead of hardcoding it in the authentication routing proxy.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:6
- Comments:5 (2 by maintainers)
Top GitHub Comments
Why not just deploy the AuthService as a sidecar?
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.