Skip to content

Commit d32e616

Browse files
mlautzaskunstkomputerDanielRaapDev
authored
[ugc-proxy] Add support for basic auth API credentials via secrets (#305)
* [ugc-proxy] Add support for basic auth API credentials via secrets * Apply suggestion from @kunstkomputer Co-authored-by: Jonas Pruditsch <6641029+kunstkomputer@users.noreply.github.com> * Apply suggestion from @DanielRaapDev Co-authored-by: Daniel Raap <raap@subshell.com> --------- Co-authored-by: Jonas Pruditsch <6641029+kunstkomputer@users.noreply.github.com> Co-authored-by: Daniel Raap <raap@subshell.com>
1 parent 1313ebb commit d32e616

3 files changed

Lines changed: 30 additions & 3 deletions

File tree

charts/sophora-ugc-proxy/Chart.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@ description: A Helm chart for Kubernetes to install Sophora UGC Proxy connected
44

55
type: application
66

7-
version: 1.5.3
7+
version: 1.6.0
88
annotations:
99
artifacthub.io/changes: |
10-
- kind: fixed
11-
description: "Fixed linter errors"
10+
- kind: added
11+
description: "Add support for supplying API basic-auth credentials from a Kubernetes Secret"
1212
1313
# This is the version number of the application being deployed. This version number should be
1414
# incremented each time you make changes to the application. Versions are not expected to

charts/sophora-ugc-proxy/templates/deployment.yaml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,24 @@ spec:
5757
optional: false
5858

5959
{{- end }}
60+
{{- with .Values.authentication.apiBasicAuth }}
61+
{{- if .enabled }}
62+
{{- if .usernameKey }}
63+
- name: AUTH_USERNAME
64+
valueFrom:
65+
secretKeyRef:
66+
name: {{ .secretName }}
67+
key: {{ .usernameKey }}
68+
{{- end }}
69+
{{- if .passwordKey }}
70+
- name: AUTH_PASSWORD
71+
valueFrom:
72+
secretKeyRef:
73+
name: {{ .secretName }}
74+
key: {{ .passwordKey }}
75+
{{- end }}
76+
{{- end }}
77+
{{- end }}
6078
{{ if .Values.env -}}
6179
{{- toYaml .Values.env | nindent 12 }}
6280
{{- end }}

charts/sophora-ugc-proxy/values.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,15 @@ authentication:
2323
# accessKeyKey: access-key
2424
# secretIdKey: secret-id
2525
s3buckets: {}
26+
# authentication.apiBasicAuth.enabled enable basic auth for UGC Proxy API
27+
# authentication.apiBasicAuth.secretName name of the secret containing the credentials
28+
# authentication.apiBasicAuth.usernameKey key of the username in the secret. Will be available as environment variable '$AUTH_USERNAME'.
29+
# authentication.apiBasicAuth.passwordKey key of the password in the secret. Will be available as environment variable '$AUTH_PASSWORD'.
30+
apiBasicAuth:
31+
enabled: false
32+
secretName: ""
33+
usernameKey: ""
34+
passwordKey: ""
2635

2736
image:
2837
repository: container.subshell.com/sophora/ugc-proxy

0 commit comments

Comments
 (0)