Skip to content

Commit fb3e8b3

Browse files
author
Stefan
committed
add hashedBasicAuthUsers section where already hashed username/password combinations can be configured;
first use hashedBasicAuthUsers if configured; Signed-off-by: Stefan <[email protected]>
1 parent 50f2194 commit fb3e8b3

File tree

3 files changed

+15
-0
lines changed

3 files changed

+15
-0
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,4 @@
99
Chart.lock
1010
# dependencies of charts get downloaded to chart/<chartname>/carts - so exclude those:
1111
charts/*/charts
12+
/charts/ditto/requirements.lock

charts/ditto/templates/nginx-auth.yaml

+6
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,14 @@ metadata:
2323
{{ $labels | indent 4 }}
2424
data:
2525
"nginx.htpasswd": |-
26+
{{- if .Values.global.hashedBasicAuthUsers }}
27+
{{ range $key, $value := .Values.global.hashedBasicAuthUsers }}
28+
{{- $value.hashedUserPassword | indent 4 }}
29+
{{ end }}
30+
{{- else }}
2631
{{ range $key, $value := .Values.global.basicAuthUsers }}
2732
{{- (htpasswd $value.user $value.password) | indent 4 }}
2833
{{ end }}
34+
{{ end }}
2935
---
3036
{{- end }}

charts/ditto/values.yaml

+8
Original file line numberDiff line numberDiff line change
@@ -86,12 +86,20 @@ openshift:
8686
## ----------------------------------------------------------------------------
8787
## global configuration shared by all components
8888
global:
89+
# Nginx Basic Auth config
90+
# either configure one or more basic auth user in the basicAuthUsers section
91+
# where you can specify username and password in clear text
92+
# or use the hashedBasicAuthUsers section where you can add already hashed username/password combinations
8993
# default basic auth user used for authentication in nginx is ditto with password ditto
9094
# add more users to the basicAuthUsers array or replace the default user
9195
basicAuthUsers:
9296
ditto:
9397
user: ditto
9498
password: ditto
99+
# alternative: add already hashed username and password combinations
100+
hashedBasicAuthUsers: []
101+
# ditto:
102+
# hashedUserPassword: ditto:A6BgmB8IEtPTs
95103
## jwtOnly controls whether only OpenID-Connect authentication is supported
96104
## if false, basicAuth is used
97105
## ref: https://www.eclipse.org/ditto/installation-operating.html#openid-connect

0 commit comments

Comments
 (0)