-
Notifications
You must be signed in to change notification settings - Fork 63
/
Copy pathconfig-jws-public-keys.yaml
27 lines (27 loc) · 1.25 KB
/
config-jws-public-keys.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
{{- if .Values.simulators }}
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ include "mojaloop-simulator.prefix" . }}jws-public-keys
labels:
app.kubernetes.io/name: {{ include "mojaloop-simulator.prefix" . }}jws-public-keys
app.kubernetes.io/instance: {{ $.Release.Name }}
app.kubernetes.io/version: "{{ $.Chart.AppVersion }}"
app.kubernetes.io/managed-by: {{ $.Release.Service }}
helm.sh/chart: {{ $.Chart.Name }}-{{ $.Chart.Version | replace "+" "_" }}
data:
{{- range $name, $customConfig := .Values.simulators }}
{{- $config := merge $customConfig $.Values.defaults }}
{{- if and ($config.config.schemeAdapter.env.VALIDATE_INBOUND_JWS) (not $config.config.schemeAdapter.secrets.jws.pubKeyConfigMapName) }}
{{- if (not $config.config.schemeAdapter.secrets.jws.publicKey) }}
{{- fail (printf "INBOUND_JWS enabled and jws public key not specified for '%s'. You need to specify %s.schemeAdapter.secrets.jws.publicKey or %s.schemeAdapter.secrets.jws.pubKeyConfigMapName." $name $name $name) }}
{{- end }}
{{ $name }}.pem: |-
{{ $config.config.schemeAdapter.secrets.jws.publicKey | indent 4 }}
{{- end }}
{{- end }}
{{- range $name, $key := .Values.sharedJWSPubKeys }}
{{ $name }}.pem: |-
{{ $key | indent 4 }}
{{- end }}
{{- end }}