Skip to content

Commit

Permalink
helm: fix authority for mock-oauth-server
Browse files Browse the repository at this point in the history
  • Loading branch information
jkralik committed Jul 12, 2024
1 parent ad3d2c5 commit 5f8588a
Showing 1 changed file with 6 additions and 18 deletions.
24 changes: 6 additions & 18 deletions charts/plgd-hub/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand All @@ -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" }}
Expand Down Expand Up @@ -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" }}
Expand Down

0 comments on commit 5f8588a

Please sign in to comment.