Skip to content

Commit f624397

Browse files
authored
Merge pull request #411 from cloudfoundry/workaroud_for_jwt_key_yaml
Workaround for JWT key secrets file
2 parents b24d2f9 + 6af9eb0 commit f624397

File tree

1 file changed

+11
-0
lines changed
  • terraform-modules/concourse/app/files/config/uaa

1 file changed

+11
-0
lines changed

terraform-modules/concourse/app/files/config/uaa/uaa.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,12 @@ spec:
182182
template:
183183
spec: #! pod spec
184184
#! START delete when https://github.com/vmware-tanzu/carvel-secretgen-controller/issues/70 is fixed
185+
186+
#! NOTE: We are not using the default "yq" from https://github.com/mikefarah/yq here. Instead, we use this flavour:
187+
188+
#! yq transcodes YAML documents to JSON and passes them to jq.
189+
#! See https://github.com/kislyuk/yq for more information.
190+
185191
initContainers:
186192
#@overlay/append
187193
- name: fix-secrets
@@ -220,6 +226,11 @@ spec:
220226
#REMOVE EMPTY LINES
221227
sed -i '/^[[:space:]]*$/d' jwt_policy_signing_keys.yml
222228
229+
# Convert RSA key from single-quoted string to block scalar style
230+
# Otherwise we get an Exception: com.nimbusds.jose.JOSEException: -----END RSA PRIVATE KEY not found
231+
sed -i "s/signingKey: '-----BEGIN RSA PRIVATE KEY-----/signingKey: |\\n -----BEGIN RSA PRIVATE KEY-----/" jwt_policy_signing_keys.yml
232+
sed -i "s/-----END RSA PRIVATE KEY-----'/-----END RSA PRIVATE KEY-----/" jwt_policy_signing_keys.yml
233+
223234
FIXED_VALUE=$(yq -r .login.saml.keys.default_saml_key.key saml_keys.yml | base64 -d)
224235
yq -Yi ".login.saml.keys.default_saml_key.key|=\"${FIXED_VALUE}\"" saml_keys.yml
225236

0 commit comments

Comments
 (0)