Skip to content

Commit 2eaefca

Browse files
committed
keycloak updates
1 parent 4e10792 commit 2eaefca

File tree

8 files changed

+53
-22
lines changed

8 files changed

+53
-22
lines changed

examples/common-secrets/keycloak-ca-secret.yaml

Lines changed: 0 additions & 7 deletions
This file was deleted.

examples/common-secrets/keycloak-tls-secret.yaml

Lines changed: 0 additions & 8 deletions
This file was deleted.

examples/custom-resources/oidc/keycloak-ca-secret.yaml

Lines changed: 0 additions & 1 deletion
This file was deleted.

examples/custom-resources/oidc/keycloak-tls-secret.yaml

Lines changed: 0 additions & 1 deletion
This file was deleted.

hack/secrets.json

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -588,6 +588,47 @@
588588
]
589589
},
590590
"crl": false
591+
},
592+
{
593+
"ca": {
594+
"secretName": "keycloak-ca",
595+
"fileName": "example-keycloak-ca-secret.yaml",
596+
"templateData": {
597+
"commonName": "KeycloakCA",
598+
"country": "IE",
599+
"organization": "F5 NGINX",
600+
"organizationalUnit": "KIC",
601+
"locality": "Cork",
602+
"province": "Cork"
603+
},
604+
"valid": true,
605+
"secretType": "nginx.org/ca",
606+
"symlinks": [
607+
"/examples/custom-resources/oidc/keycloak-ca-secret.yaml"
608+
],
609+
"usedIn": [
610+
"examples/custom-resources/oidc"
611+
]
612+
},
613+
"server": {
614+
"secretName": "keycloak-tls",
615+
"fileName": "example-keycloak-tls-secret.yaml",
616+
"templateData": {
617+
"commonName": "keycloak.default.svc.cluster.local",
618+
"country": "IE",
619+
"organization": "F5 NGINX",
620+
"organizationalUnit": "KIC",
621+
"locality": "Cork",
622+
"province": "Cork"
623+
},
624+
"valid": true,
625+
"symlinks": [
626+
"/examples/custom-resources/oidc/keycloak-tls-secret.yaml"
627+
],
628+
"usedIn": [
629+
"examples/custom-resources/oidc"
630+
]
631+
}
591632
}
592633
],
593634
"htpasswds": [

hack/tls-cert-gen/main.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -348,11 +348,14 @@ func createOpaqueSecretYaml(secret yamlSecret, isValid bool, keyPair *JITTLSKey,
348348
Data: map[string][]byte{
349349
v1.TLSCertKey: keyPair.cert,
350350
v1.TLSPrivateKeyKey: keyPair.key,
351-
configs.CACrtKey: caCert,
352351
},
353352
Type: v1.SecretTypeOpaque,
354353
}
355354

355+
if caCert != nil {
356+
s.Data[configs.CACrtKey] = caCert
357+
}
358+
356359
if !isValid {
357360
s.Data[v1.TLSCertKey] = []byte(``)
358361
}

hack/tls-cert-gen/mtls-gen.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -218,8 +218,12 @@ func generateMTLSBundleFiles(bundle mtlsBundle, projectRoot string) error {
218218
return nil
219219
}
220220

221+
// nolint cyclo:ignore
221222
func removeBundleFiles(logger *slog.Logger, bundle mtlsBundle) error {
222223
for _, secret := range []yamlSecret{bundle.Ca, bundle.Client, bundle.Server} {
224+
if secret.FileName == "" {
225+
continue
226+
}
223227
filePath := filepath.Join(projectRoot, realSecretDirectory, secret.FileName)
224228
log.Debugf(logger, "Removing file %s", filePath)
225229
if _, err := os.Stat(filePath); !os.IsNotExist(err) {

tests/.gitignore

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,10 @@ data/egress-mtls/secret/tls-secret.yaml
5050
data/hsts/standard-tls/tls-secret.yaml
5151
data/hsts/mergeable-tls/tls-secret.yaml
5252
data/ingress-mtls/secret/tls-secret.yaml
53-
data/jwt-auth-mergeable/jwt-auth-master-secret.yaml
54-
data/jwt-auth-mergeable/jwt-auth-master-secret-updated.yaml
55-
data/jwt-auth-mergeable/jwt-auth-minion-secret.yaml
56-
data/jwt-auth-mergeable/jwt-auth-minion-secret-updated.yaml
53+
data/jwt-auth-mergeable/jwt-master-secret.yaml
54+
data/jwt-auth-mergeable/jwt-master-secret-updated.yaml
55+
data/jwt-auth-mergeable/jwt-minion-secret.yaml
56+
data/jwt-auth-mergeable/jwt-minion-secret-updated.yaml
5757
data/jwt-policy/secret/jwk-secret-invalid.yaml
5858
data/jwt-policy/secret/jwk-secret-valid.yaml
5959
data/jwt-secrets/jwt-secret-invalid.yaml

0 commit comments

Comments
 (0)