From a4c5e49941b6baecf4b24c53d6d31986a7e64f37 Mon Sep 17 00:00:00 2001 From: Vladislav Sukhin Date: Fri, 15 Nov 2024 20:47:09 +0300 Subject: [PATCH 1/2] fix: add redirect uri Signed-off-by: Vladislav Sukhin --- charts/testkube-enterprise/profiles/values.demo.yaml | 1 + charts/testkube-enterprise/templates/dex-config-secret.yaml | 2 ++ charts/testkube-enterprise/values.yaml | 1 + 3 files changed, 4 insertions(+) diff --git a/charts/testkube-enterprise/profiles/values.demo.yaml b/charts/testkube-enterprise/profiles/values.demo.yaml index 2ce4dd5cc..38cd46ee4 100644 --- a/charts/testkube-enterprise/profiles/values.demo.yaml +++ b/charts/testkube-enterprise/profiles/values.demo.yaml @@ -107,6 +107,7 @@ dex: - id: testkube-enterprise redirectURIs: - http://localhost:8090/auth/callback + - http://localhost:38090/auth/callback name: Testkube secret: QWkVzs3nct6HZM5hxsPzwaZtq additionalConfig: | diff --git a/charts/testkube-enterprise/templates/dex-config-secret.yaml b/charts/testkube-enterprise/templates/dex-config-secret.yaml index 3e0fe0408..fcf3006ec 100644 --- a/charts/testkube-enterprise/templates/dex-config-secret.yaml +++ b/charts/testkube-enterprise/templates/dex-config-secret.yaml @@ -29,11 +29,13 @@ stringData: secret: '{{ $api.api.oauth.clientSecret }}' redirectURIs: - '{{ if .Values.global.domain }}https://{{ .Values.global.restApiSubdomain }}.{{ .Values.global.domain }}/auth/callback{{ else }}http://localhost:8090/auth/callback{{ end }}' + - '{{ if .Values.global.domain }}https://{{ .Values.global.restApiSubdomain }}.{{ .Values.global.domain }}/auth/callback{{ else }}http://localhost:38090/auth/callback{{ end }}' - id: teskube-cloud-cli name: 'Testkube Enterprise CLI' secret: '{{ $api.api.oauth.clientSecret }}' redirectURIs: - '{{ if .Values.global.domain }}https://{{ .Values.global.restApiSubdomain }}.{{ .Values.global.domain }}/auth/callback{{ else }}http://localhost:8090/auth/callback{{ end }}' + - '{{ if .Values.global.domain }}https://{{ .Values.global.restApiSubdomain }}.{{ .Values.global.domain }}/auth/callback{{ else }}http://localhost:38090/auth/callback{{ end }}' {{- with .Values.dex.configTemplate.additionalStaticClients }} {{- toYaml . | nindent 6 }} {{- end }} diff --git a/charts/testkube-enterprise/values.yaml b/charts/testkube-enterprise/values.yaml index 80c3d1b9a..b9ce06adb 100644 --- a/charts/testkube-enterprise/values.yaml +++ b/charts/testkube-enterprise/values.yaml @@ -728,6 +728,7 @@ dex: # name: Testkube Cloud - localdev # redirectURIs: # - http://localhost:8090/auth/callback + # - http://localhost:38090/auth/callback # secret: some-secret # -- Additional config which will be appended to the config like `staticClients`, `staticPasswords ,`connectors`... additionalConfig: "" From 819b6ef652770265167769d5566550c0845b49fe Mon Sep 17 00:00:00 2001 From: Vladislav Sukhin Date: Fri, 22 Nov 2024 15:36:17 +0300 Subject: [PATCH 2/2] fix: if statement Signed-off-by: Vladislav Sukhin --- .../templates/dex-config-secret.yaml | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/charts/testkube-enterprise/templates/dex-config-secret.yaml b/charts/testkube-enterprise/templates/dex-config-secret.yaml index fcf3006ec..d2b009fa5 100644 --- a/charts/testkube-enterprise/templates/dex-config-secret.yaml +++ b/charts/testkube-enterprise/templates/dex-config-secret.yaml @@ -28,14 +28,22 @@ stringData: name: 'Testkube Enterprise' secret: '{{ $api.api.oauth.clientSecret }}' redirectURIs: - - '{{ if .Values.global.domain }}https://{{ .Values.global.restApiSubdomain }}.{{ .Values.global.domain }}/auth/callback{{ else }}http://localhost:8090/auth/callback{{ end }}' - - '{{ if .Values.global.domain }}https://{{ .Values.global.restApiSubdomain }}.{{ .Values.global.domain }}/auth/callback{{ else }}http://localhost:38090/auth/callback{{ end }}' + {{- if .Values.global.domain }} + - 'https://{{ .Values.global.restApiSubdomain }}.{{ .Values.global.domain }}/auth/callback' + {{- else }} + - 'http://localhost:8090/auth/callback' + - 'http://localhost:38090/auth/callback' + {{- end }} - id: teskube-cloud-cli name: 'Testkube Enterprise CLI' secret: '{{ $api.api.oauth.clientSecret }}' redirectURIs: - - '{{ if .Values.global.domain }}https://{{ .Values.global.restApiSubdomain }}.{{ .Values.global.domain }}/auth/callback{{ else }}http://localhost:8090/auth/callback{{ end }}' - - '{{ if .Values.global.domain }}https://{{ .Values.global.restApiSubdomain }}.{{ .Values.global.domain }}/auth/callback{{ else }}http://localhost:38090/auth/callback{{ end }}' + {{- if .Values.global.domain }} + - 'https://{{ .Values.global.restApiSubdomain }}.{{ .Values.global.domain }}/auth/callback' + {{- else }} + - 'http://localhost:8090/auth/callback' + - 'http://localhost:38090/auth/callback' + {{- end }} {{- with .Values.dex.configTemplate.additionalStaticClients }} {{- toYaml . | nindent 6 }} {{- end }}