diff --git a/charts/sn-platform-slim/templates/_helpers.tpl b/charts/sn-platform-slim/templates/_helpers.tpl index 20dd6d44e..3728267b1 100644 --- a/charts/sn-platform-slim/templates/_helpers.tpl +++ b/charts/sn-platform-slim/templates/_helpers.tpl @@ -240,10 +240,24 @@ Define function for get authenticaiton environment variable {{- if .Values.auth.authentication.jwt.enabled }} {{- if and (eq .Component "proxy") .Values.auth.superUsers.proxyRolesEnabled }} - name: brokerClientAuthenticationParameters +{{- if .Values.auth.authentication.jwt.readTokenFromFile }} value: "file:///mnt/token/TOKEN" +{{- else }} + valueFrom: + secretKeyRef: + name: {{ .Release.Name }}-token-proxy-admin + key: TOKEN +{{- end }} {{- else }} - name: brokerClientAuthenticationParameters +{{- if .Values.auth.authentication.jwt.readTokenFromFile }} value: "file:///mnt/token/TOKEN" +{{- else }} + valueFrom: + secretKeyRef: + name: {{ .Release.Name }}-token-admin + key: TOKEN +{{- end }} {{- end }} {{- if .Values.auth.authentication.jwt.usingSecretKey }} - name: tokenSecretKey @@ -265,6 +279,7 @@ Define function for get authenticaiton secret secretName: "{{ .Values.auth.oauth.brokerClientCredentialSecret }}" {{- end }} {{- if .Values.auth.authentication.jwt.enabled }} +{{- if .Values.auth.authentication.jwt.readTokenFromFile }} {{- if and (eq .Component "proxy") .Values.auth.superUsers.proxyRolesEnabled }} - mountPath: /mnt/token secretName: {{ .Release.Name }}-token-proxy-admin @@ -272,6 +287,7 @@ Define function for get authenticaiton secret - mountPath: /mnt/token secretName: {{ .Release.Name }}-token-admin {{- end }} +{{- end }} {{- if .Values.auth.authentication.jwt.usingSecretKey }} - mountPath: /mnt/secrets secretName: {{ .Release.Name }}-token-symmetric-key diff --git a/charts/sn-platform-slim/values.yaml b/charts/sn-platform-slim/values.yaml index d658c13cf..99e1324c4 100644 --- a/charts/sn-platform-slim/values.yaml +++ b/charts/sn-platform-slim/values.yaml @@ -300,6 +300,7 @@ auth: usingSecretKey: false # Whether to enable automatic initialization jwt authentication secret autoInitSecret: false + readTokenFromFile: false tls: enabled: false authorization: diff --git a/charts/sn-platform/templates/_helpers.tpl b/charts/sn-platform/templates/_helpers.tpl index 4e5e173a5..fdfc303cd 100644 --- a/charts/sn-platform/templates/_helpers.tpl +++ b/charts/sn-platform/templates/_helpers.tpl @@ -266,10 +266,24 @@ Define function for get authenticaiton environment variable {{- if .Values.auth.authentication.jwt.enabled }} {{- if and (eq .Component "proxy") .Values.auth.superUsers.proxyRolesEnabled }} - name: brokerClientAuthenticationParameters +{{- if .Values.auth.authentication.jwt.readTokenFromFile }} value: "file:///mnt/token/TOKEN" +{{- else }} + valueFrom: + secretKeyRef: + name: {{ .Release.Name }}-token-proxy-admin + key: TOKEN +{{- end }} {{- else }} - name: brokerClientAuthenticationParameters +{{- if .Values.auth.authentication.jwt.readTokenFromFile }} value: "file:///mnt/token/TOKEN" +{{- else }} + valueFrom: + secretKeyRef: + name: {{ .Release.Name }}-token-admin + key: TOKEN +{{- end }} {{- end }} {{- if .Values.auth.authentication.jwt.usingSecretKey }} - name: tokenSecretKey @@ -291,6 +305,7 @@ Define function for get authenticaiton secret secretName: "{{ .Values.auth.oauth.brokerClientCredentialSecret }}" {{- end }} {{- if and .Values.auth.vault.enabled (or .Values.broker.readPublicKeyFromFile .Values.proxy.readPublicKeyFromFile) }} +{{- if .Values.auth.authentication.jwt.readTokenFromFile }} {{- if and (eq .Component "proxy") .Values.auth.superUsers.proxyRolesEnabled }} - mountPath: /mnt/token secretName: {{ .Release.Name }}-token-proxy-admin @@ -298,6 +313,7 @@ Define function for get authenticaiton secret - mountPath: /mnt/token secretName: {{ .Release.Name }}-token-admin {{- end }} +{{- end }} - mountPath: {{ default "/pulsar/vault/v1/identity/oidc/.well-known/keys" .Values.broker.publicKeyPath }} {{ $defaultSecretName := print (include "pulsar.fullname" .) "-" .Values.vault.component "-public-key" }} secretName: {{ default $defaultSecretName .Values.broker.publicKeySecret }} diff --git a/charts/sn-platform/values.yaml b/charts/sn-platform/values.yaml index 9f2569a65..543c751bb 100644 --- a/charts/sn-platform/values.yaml +++ b/charts/sn-platform/values.yaml @@ -357,6 +357,7 @@ auth: usingSecretKey: false # Whether to enable automatic initialization jwt authentication secret autoInitSecret: false + readTokenFromFile: false tls: enabled: false authorization: