You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add forwardAuthorization flag for conditional token forwarding (#147)
* feat(proxy): add forwardAuthorization flag to control token forwarding
- Introduced `--proxy-forward-authorization` command line option.
- Updated configuration documentation to include new option.
- Modified proxy handling to conditionally forward the Authorization header based on the new flag.
- Added tests to verify the behavior of the new flag.
* test(proxy): add tests for forwardAuthorization flag from env
* docs(configuration): update proxy options table formatting to adhere to linter
|`--proxy-bearer-token`|`PROXY_BEARER_TOKEN`| - | Bearer token to add to Authorization header when proxying requests |
182
+
|`--proxy-forward-authorization`|`PROXY_FORWARD_AUTHORIZATION`|`false`| Forward the incoming Authorization bearer token to the backend after validation |
183
+
|`--proxy-headers`|`PROXY_HEADERS`| - | Comma-separated list of headers to add when proxying requests (format: Header1:Value1,Header2:Value2) |
184
+
|`--header-mapping`|`HEADER_MAPPING`| - | Comma-separated mapping of JSON pointer paths to header names (e.g., `/email:X-Forwarded-Email`) |
185
+
|`--header-mapping-base`|`HEADER_MAPPING_BASE`|`/userinfo`| JSON pointer base path for header mapping claims lookup (e.g., `/userinfo` or `/`) |
186
+
|`--http-streaming-only`|`HTTP_STREAMING_ONLY`|`false`| Reject SSE (GET) requests and keep the backend operating in HTTP streaming-only mode |
187
+
|`--trusted-proxies`|`TRUSTED_PROXIES`| - | Comma-separated list of trusted proxies (IP addresses or CIDR ranges) |
187
188
188
189
For practical configuration examples including environment variables, Docker Compose, and Kubernetes deployments, see the [Configuration Examples](./examples.md) page.
rootCmd.Flags().StringVar(&proxyBearerToken, "proxy-bearer-token", getEnvWithDefault("PROXY_BEARER_TOKEN", ""), "Bearer token to add to Authorization header when proxying requests")
382
+
rootCmd.Flags().BoolVar(&forwardAuthorizationHeader, "proxy-forward-authorization", getEnvBoolWithDefault("PROXY_FORWARD_AUTHORIZATION", false), "Forward the incoming Authorization bearer token to the backend after validation")
379
383
rootCmd.Flags().StringVar(&trustedProxies, "trusted-proxies", getEnvWithDefault("TRUSTED_PROXIES", ""), "Comma-separated list of trusted proxies (IP addresses or CIDR ranges)")
380
384
rootCmd.Flags().StringVar(&proxyHeaders, "proxy-headers", getEnvWithDefault("PROXY_HEADERS", ""), "Comma-separated list of headers to add when proxying requests (format: Header1:Value1,Header2:Value2)")
381
385
rootCmd.Flags().BoolVar(&httpStreamingOnly, "http-streaming-only", getEnvBoolWithDefault("HTTP_STREAMING_ONLY", false), "Reject SSE (GET) requests and keep the backend in HTTP streaming-only mode")
0 commit comments