From 9b2f47852aa1b159d1af28c9e423d8642bc5051d Mon Sep 17 00:00:00 2001 From: Breee Date: Tue, 12 Dec 2023 18:53:57 +0100 Subject: [PATCH] feat(config): add root_ca_certificate to config Signed-off-by: Breee --- examples/credentials.yaml | 3 ++- internal/clients/keycloak.go | 5 +++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/examples/credentials.yaml b/examples/credentials.yaml index ef0ce05..c4f5a58 100644 --- a/examples/credentials.yaml +++ b/examples/credentials.yaml @@ -11,5 +11,6 @@ stringData: "client_secret": "xxxxxx", "url": "https://keycloak.example.com", "base_path": "/auth", - "realm": "master" + "realm": "master", + "root_ca_certificate" : "" } diff --git a/internal/clients/keycloak.go b/internal/clients/keycloak.go index 71a193b..709a1c5 100644 --- a/internal/clients/keycloak.go +++ b/internal/clients/keycloak.go @@ -40,6 +40,7 @@ const ( realmKey = "realm" basePathKey = "base_path" additionalHeadersKey = "additional_headers" + rootCaCertificateKey = "root_ca_certificate" ) // TerraformSetupBuilder builds Terraform a terraform.SetupFn function which @@ -111,6 +112,10 @@ func TerraformSetupBuilder(version, providerSource, providerVersion string) terr if v, ok := creds[additionalHeadersKey]; ok { ps.Configuration[additionalHeadersKey] = v } + // root ca certificate + if v, ok := creds[rootCaCertificateKey]; ok { + ps.Configuration[rootCaCertificateKey] = v + } return ps, nil } }