File tree 2 files changed +19
-10
lines changed
2 files changed +19
-10
lines changed Original file line number Diff line number Diff line change @@ -24,13 +24,21 @@ type: Opaque
24
24
stringData :
25
25
nginx.htpasswd : |-
26
26
{{- if .Values.global.hashedBasicAuthUsers }}
27
- {{ range .Values.global.hashedBasicAuthUsers }}
28
- {{- . | indent 4 }}
29
- {{ end }}
27
+ {{ range .Values.global.hashedBasicAuthUsers }}
28
+ {{- . | indent 4 }}
29
+ {{ end }}
30
30
{{- else }}
31
- {{ range $key, $value := .Values.global.basicAuthUsers }}
32
- {{- (htpasswd $value.user $value.password) | indent 4 }}
33
- {{ end }}
34
- {{ end }}
31
+ {{ range $key, $value := .Values.global.basicAuthUsers }}
32
+ {{- if $value.secretName }}
33
+ {{- $secret := lookup "v1" "Secret" $.Release.Namespace $value.secretName }}
34
+ {{- if $secret }}
35
+ {{- $passwordBase64 := index $secret.data $value.user}}
36
+ {{- htpasswd $value.user ($passwordBase64 | b64dec) | indent 4 }}
37
+ {{- end }}
38
+ {{- else }}
39
+ {{- (htpasswd $value.user $value.password) | indent 4 }}
40
+ {{- end }}
41
+ {{ end }}
42
+ {{- end }}
35
43
---
36
44
{{- end }}
Original file line number Diff line number Diff line change @@ -69,11 +69,15 @@ global:
69
69
# maxAuthSubjectsCount the maximum possible number of authorization subjects in Ditto headers, default: 100
70
70
maxAuthSubjectsCount : 100
71
71
# basicAuthUsers configures several user/password combinations which the nginx of the Ditto chart will authenticate
72
+ # secretName - name of kubernetes secret, containing password for user(s). secret.data must contain ${user}: passwordBase64
73
+ # if provided, password from secret will be used. Single kubernetes secret can be used for all users, by adding row for each user.
72
74
basicAuthUsers :
73
75
# - user: ditto
74
76
# password: ditto
77
+ # secretName: ditto
75
78
# - user: jane
76
79
# password: janesPw
80
+ # secretName: jane
77
81
# hashedBasicAuthUsers configures a list of hashed .htpasswd username/password entries
78
82
hashedBasicAuthUsers : []
79
83
# jwtOnly controls whether only OpenID-Connect authentication is supported
@@ -172,9 +176,6 @@ global:
172
176
podDeletionCostPatching :
173
177
# enabled whether the pod-deletion-cost annotation patching should be enabled
174
178
enabled : true
175
- # annotations defines k8s annotations to add to corresponding jobs
176
- annotations : {}
177
-
178
179
179
180
# # ----------------------------------------------------------------------------
180
181
# # dbconfig for mongodb connections
You can’t perform that action at this time.
0 commit comments