From 5f8588a972a8b95709f8af8266e4095b6fc82db7 Mon Sep 17 00:00:00 2001 From: Jozef Kralik Date: Thu, 11 Jul 2024 15:24:05 +0000 Subject: [PATCH] helm: fix authority for mock-oauth-server --- charts/plgd-hub/templates/_helpers.tpl | 24 ++++++------------------ 1 file changed, 6 insertions(+), 18 deletions(-) diff --git a/charts/plgd-hub/templates/_helpers.tpl b/charts/plgd-hub/templates/_helpers.tpl index d9e85a965..5da549a6d 100644 --- a/charts/plgd-hub/templates/_helpers.tpl +++ b/charts/plgd-hub/templates/_helpers.tpl @@ -210,7 +210,6 @@ tls: {{- if eq (len $mapEndpoints.Values) 0 }} {{- fail (printf "%s.endpoints or global.authorization.endpoints is required" $prefix) }} {{- end}} - {{- if not $.Values.mockoauthserver.enabled }} audience: {{ include "plgd-hub.resolveTemplateString" (list $ $audience) }} endpoints: {{- range $mapEndpoints.Values }} @@ -221,19 +220,6 @@ tls: {{- include "plgd-hub.httpConfig" (list $ .http $certPath ) | indent 8 }} {{- end }} {{- end }} - {{- else }} - audience: {{ include "plgd-hub.resolveTemplateString" (list $ $audience) }} - endpoints: - {{- range $mapEndpoints.Values }} - {{- $authority := include "plgd-hub.resolveTemplateString" (list $ .authority) }} - {{- if not $authority }} - {{- $authority = include "plgd-hub.mockoauthserver.uri" $ }} - {{- end }} - - authority: {{ $authority }} - http: - {{- include "plgd-hub.httpConfig" (list $ .http $certPath ) | indent 8 }} - {{- end }} - {{- end }} {{- end }} {{- define "plgd-hub.authorizationConfig" }} @@ -662,11 +648,13 @@ true {{- define "plgd-hub.globalAuthority" }} {{- $ := . -}} -{{- $ca := "" -}} -{{- if $.Values.global.authority -}} -{{- $ca = $.Values.global.authority -}} +{{- $authority := $.Values.global.authority | default "" -}} +{{- if not $authority }} +{{- if $.Values.mockoauthserver.enabled }} +{{- $authority = include "plgd-hub.mockoauthserver.uri" $ }} +{{- end }} {{- end -}} -{{- printf "%s" $ca }} +{{- printf "%s" $authority }} {{- end -}} {{- define "plgd-hub.m2mOAuthServerAuthority" }}