Skip to content

Commit 860c2b9

Browse files
committed
fix: fix auth provider configuration
Previous configuration was using the `.Values.developerHub.authProvider` value to determine the auth provider to configure. This was not correct as the auth providers may be needed to access information even if they they are not used for sign-in. cf RHTAP-6072.
1 parent 1d5c5b4 commit 860c2b9

File tree

1 file changed

+18
-22
lines changed

1 file changed

+18
-22
lines changed

installer/charts/tssc-dh/templates/app-config-content.yaml

Lines changed: 18 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -49,24 +49,7 @@ azureDevOps:
4949
auth:
5050
environment: production
5151
providers:
52-
{{- $signInPage := "" }}
53-
{{- if eq .Values.developerHub.authProvider "oidc" }}
54-
{{- $signInPage = "oidc" }}
55-
oidc:
56-
production:
57-
clientId: ${AUTH__OIDC__CLIENT__ID}
58-
clientSecret: ${AUTH__OIDC__CLIENT__SECRET}
59-
metadataUrl: ${AUTH__OIDC__METADATA__URL}
60-
prompt: auto
61-
signIn:
62-
resolvers:
63-
- resolver: preferredUsernameMatchingUserEntityName
64-
session:
65-
secret:
66-
$env: BACKEND_SECRET
67-
{{- end }}
68-
{{- if eq .Values.developerHub.authProvider "github" }}
69-
{{- $signInPage = "github" }}
52+
{{- if $githubSecretObj }}
7053
github:
7154
production:
7255
clientId: ${GITHUB__APP__CLIENT__ID}
@@ -81,10 +64,9 @@ auth:
8164
dangerouslyAllowSignInWithoutUserInCatalog: true
8265
{{- end }}
8366
{{- end }}
84-
{{- if eq .Values.developerHub.authProvider "gitlab" }}
67+
{{- if $gitlabSecretObj }}
8568
{{- $gitlabSecretData := ($gitlabSecretObj.data | default dict) }}
8669
{{- if and $gitlabSecretData.clientId $gitlabSecretData.clientSecret }}
87-
{{- $signInPage = "gitlab" }}
8870
gitlab:
8971
production:
9072
{{- if ne ($gitlabSecretData.host | b64dec) "gitlab.com" }}
@@ -98,6 +80,20 @@ auth:
9880
dangerouslyAllowSignInWithoutUserInCatalog: true
9981
{{- end }}
10082
{{- end }}
83+
{{- if eq .Values.developerHub.authProvider "oidc" }}
84+
oidc:
85+
production:
86+
clientId: ${AUTH__OIDC__CLIENT__ID}
87+
clientSecret: ${AUTH__OIDC__CLIENT__SECRET}
88+
metadataUrl: ${AUTH__OIDC__METADATA__URL}
89+
prompt: auto
90+
signIn:
91+
resolvers:
92+
- resolver: preferredUsernameMatchingUserEntityName
93+
session:
94+
secret:
95+
$env: BACKEND_SECRET
96+
{{- end }}
10197
backend:
10298
auth:
10399
keys:
@@ -272,8 +268,8 @@ proxy:
272268
quay:
273269
uiUrl: ${QUAY__URL}
274270
{{- end }}
275-
{{- if $signInPage }}
276-
signInPage: {{ $signInPage }}
271+
{{- if .Values.developerHub.authProvider }}
272+
signInPage: {{ .Values.developerHub.authProvider }}
277273
{{- end }}
278274
techdocs:
279275
builder: 'local'

0 commit comments

Comments
 (0)