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
feat: add HEADER_MAPPING_BASE flag to control JWT claims source for HEADER_MAPPING (#144)
* fix: fall back to top-level JWT claims when userinfo is absent in HEADER_MAPPING
* feat: add HEADER_MAPPING_BASE flag to control JWT claims source
Instead of implicit fallback from userinfo to top-level claims,
add an explicit --header-mapping-base / HEADER_MAPPING_BASE flag
(default: /userinfo) that controls which JWT claims subtree
HEADER_MAPPING reads from. Set to / for top-level claims.
Closes#143
|`--proxy-bearer-token`|`PROXY_BEARER_TOKEN`| - | Bearer token to add to Authorization header when proxying requests |
182
+
|`--proxy-headers`|`PROXY_HEADERS`| - | Comma-separated list of headers to add when proxying requests (format: Header1:Value1,Header2:Value2) |
183
+
|`--header-mapping`|`HEADER_MAPPING`| - | Comma-separated mapping of JSON pointer paths to header names (e.g., `/email:X-Forwarded-Email`) |
184
+
|`--header-mapping-base`|`HEADER_MAPPING_BASE`|`/userinfo`| JSON pointer base path for header mapping claims lookup (e.g., `/userinfo` or `/`) |
185
+
|`--http-streaming-only`|`HTTP_STREAMING_ONLY`|`false`| Reject SSE (GET) requests and keep the backend operating in HTTP streaming-only mode |
186
+
|`--trusted-proxies`|`TRUSTED_PROXIES`| - | Comma-separated list of trusted proxies (IP addresses or CIDR ranges) |
185
187
186
188
For practical configuration examples including environment variables, Docker Compose, and Kubernetes deployments, see the [Configuration Examples](./examples.md) page.
rootCmd.Flags().StringVar(&trustedProxies, "trusted-proxies", getEnvWithDefault("TRUSTED_PROXIES", ""), "Comma-separated list of trusted proxies (IP addresses or CIDR ranges)")
377
380
rootCmd.Flags().StringVar(&proxyHeaders, "proxy-headers", getEnvWithDefault("PROXY_HEADERS", ""), "Comma-separated list of headers to add when proxying requests (format: Header1:Value1,Header2:Value2)")
378
381
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")
379
-
rootCmd.Flags().StringVar(&headerMapping, "header-mapping", getEnvWithDefault("HEADER_MAPPING", ""), "Comma-separated mapping of userinfo JSON pointer paths to header names (e.g., /email:X-Forwarded-Email,/preferred_username:X-Forwarded-User)")
382
+
rootCmd.Flags().StringVar(&headerMapping, "header-mapping", getEnvWithDefault("HEADER_MAPPING", ""), "Comma-separated mapping of JSON pointer paths to header names (e.g., /email:X-Forwarded-Email,/preferred_username:X-Forwarded-User)")
383
+
rootCmd.Flags().StringVar(&headerMappingBase, "header-mapping-base", getEnvWithDefault("HEADER_MAPPING_BASE", "/userinfo"), "JSON pointer base path for header mapping claims lookup (e.g., /userinfo or /)")
0 commit comments