From 17dd470cb2e2d4ba17af226107eb99c855f122e8 Mon Sep 17 00:00:00 2001 From: ypoplavs Date: Fri, 30 Jun 2023 00:43:05 +0300 Subject: [PATCH] add basic auth --- charts/testkube/values-develop.yaml | 36 +++-------------------------- charts/testkube/values-stage.yaml | 36 +++-------------------------- 2 files changed, 6 insertions(+), 66 deletions(-) diff --git a/charts/testkube/values-develop.yaml b/charts/testkube/values-develop.yaml index 753443a92..e216a65f5 100644 --- a/charts/testkube/values-develop.yaml +++ b/charts/testkube/values-develop.yaml @@ -153,39 +153,6 @@ testkube-api: set $methodallowed ""; set $pathallowed ""; - if ( $request_method = GET ){ - set $methodallowed "true"; - set $pathallowed "true"; - } - - if ( $request_method = POST ){ - set $methodallowed "true"; - } - - if ( $request_method = OPTIONS ){ - set $methodallowed "true"; - } - - if ( $uri ~ "^(.*)/tests/(.*)/executions$" ){ - set $pathallowed "true"; - } - - if ( $uri ~ "^(.*)/test-suites/(.*)/executions$" ){ - set $pathallowed "true"; - } - - if ( $uri ~ "^(.*)/tests$" ){ - set $pathallowed "true"; - } - - if ( $uri ~ "^(.*)/repositories$" ){ - set $pathallowed "true"; - } - - set $condition "$methodallowed+$pathallowed"; - if ( $condition != "true+true" ) { - return 401; - } path: /results/(v\d/.*) hosts: - dev.testkube.io @@ -315,6 +282,9 @@ testkube-dashboard: nginx.ingress.kubernetes.io/enable-cors: "true" nginx.ingress.kubernetes.io/cors-allow-methods: "GET" nginx.ingress.kubernetes.io/cors-allow-credentials: "false" + nginx.ingress.kubernetes.io/auth-type: basic + nginx.ingress.kubernetes.io/auth-secret: htpasswd + nginx.ingress.kubernetes.io/auth-realm: "Enter your credentials" # specify the name of the global IP address resource to be associated with the HTTP(S) Load Balancer. kubernetes.io/ingress.global-static-ip-name: testkube-develop cert-manager.io/issue-temporary-certificate: "true" diff --git a/charts/testkube/values-stage.yaml b/charts/testkube/values-stage.yaml index 5cee27630..5390e22f0 100644 --- a/charts/testkube/values-stage.yaml +++ b/charts/testkube/values-stage.yaml @@ -153,39 +153,6 @@ testkube-api: set $methodallowed ""; set $pathallowed ""; - if ( $request_method = GET ){ - set $methodallowed "true"; - set $pathallowed "true"; - } - - if ( $request_method = POST ){ - set $methodallowed "true"; - } - - if ( $request_method = OPTIONS ){ - set $methodallowed "true"; - } - - if ( $uri ~ "^(.*)/tests/(.*)/executions$" ){ - set $pathallowed "true"; - } - - if ( $uri ~ "^(.*)/test-suites/(.*)/executions$" ){ - set $pathallowed "true"; - } - - if ( $uri ~ "^(.*)/tests$" ){ - set $pathallowed "true"; - } - - if ( $uri ~ "^(.*)/repositories$" ){ - set $pathallowed "true"; - } - - set $condition "$methodallowed+$pathallowed"; - if ( $condition != "true+true" ) { - return 401; - } path: /results/(v\d/.*) hosts: - integration.testkube.io @@ -317,6 +284,9 @@ testkube-dashboard: nginx.ingress.kubernetes.io/enable-cors: "true" nginx.ingress.kubernetes.io/cors-allow-methods: "GET" nginx.ingress.kubernetes.io/cors-allow-credentials: "false" + nginx.ingress.kubernetes.io/auth-type: basic + nginx.ingress.kubernetes.io/auth-secret: htpasswd + nginx.ingress.kubernetes.io/auth-realm: "Enter your credentials" # specify the name of the global IP address resource to be associated with the HTTP(S) Load Balancer. kubernetes.io/ingress.global-static-ip-name: testkube-integration # add an annotation indicating the issuer to use.