Skip to content

Commit

Permalink
feat: by default include other idp helper headers (#108)
Browse files Browse the repository at this point in the history
  • Loading branch information
jakeyheath authored Sep 13, 2024
1 parent 37e3565 commit bbd7ef3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion stack/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -189,5 +189,5 @@ app.kubernetes.io/instance: {{ .Release.Name }}
{{- define "oidcProxy.nginxAuthAnnotations" -}}
nginx.ingress.kubernetes.io/auth-url: "http://{{ include "oidcProxy.name" . }}.{{ .Release.Namespace }}.svc.cluster.local:4180/oauth2/auth"
nginx.ingress.kubernetes.io/auth-signin: "https://{{- include "oidcProxy.authDomain" . }}/oauth2/start?rd=https://$host$escaped_request_uri"
nginx.ingress.kubernetes.io/auth-response-headers: {{join "," (concat (list "Authorization" "X-Forwarded-Email") .Values.global.oidcProxy.additionalHeaders) }}
nginx.ingress.kubernetes.io/auth-response-headers: {{join "," (concat (list "Authorization" "X-Auth-Request-User" "X-Auth-Request-Groups" "X-Auth-Request-Email" "X-Auth-Request-Preferred-Username") .Values.global.oidcProxy.additionalHeaders) }}
{{- end -}}
4 changes: 2 additions & 2 deletions stack/tests/ingress_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ tests:
- documentIndex: 0
equal:
path: metadata.annotations["nginx.ingress.kubernetes.io/auth-response-headers"]
value: "Authorization,X-Forwarded-Email"
value: "Authorization,X-Auth-Request-User,X-Auth-Request-Groups,X-Auth-Request-Email,X-Auth-Request-Preferred-Username"
- it: adds additional nginx auth headers when using additionalHeaders
set:
global:
Expand All @@ -49,4 +49,4 @@ tests:
- documentIndex: 0
equal:
path: metadata.annotations["nginx.ingress.kubernetes.io/auth-response-headers"]
value: "Authorization,X-Forwarded-Email,X-Forwarded-User,blahblahblah"
value: "Authorization,X-Auth-Request-User,X-Auth-Request-Groups,X-Auth-Request-Email,X-Auth-Request-Preferred-Username,X-Forwarded-User,blahblahblah"

0 comments on commit bbd7ef3

Please sign in to comment.