Skip to content
This repository has been archived by the owner on Dec 21, 2023. It is now read-only.

Commit

Permalink
fix(installer): Normalize 401 responses (#8792)
Browse files Browse the repository at this point in the history
* fix(installer): Normalize 401 responses

Signed-off-by: odubajDT <ondrej.dubaj@dynatrace.com>

* fix

Signed-off-by: odubajDT <ondrej.dubaj@dynatrace.com>

* working version

Signed-off-by: odubajDT <ondrej.dubaj@dynatrace.com>

* fix

Signed-off-by: odubajDT <ondrej.dubaj@dynatrace.com>

* typo

Signed-off-by: odubajDT <ondrej.dubaj@dynatrace.com>

Signed-off-by: odubajDT <ondrej.dubaj@dynatrace.com>
  • Loading branch information
odubajDT committed Sep 1, 2022
1 parent b46547f commit c8a33e5
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions installer/manifests/keptn/templates/api-gateway-nginx.yaml
Expand Up @@ -90,6 +90,10 @@ data:
proxy_busy_buffers_size 256k;
}
location @error401 {
return 401 '{"code":401, "message":"unauthenticated or invalid credentials"}';
}
# health check
location /nginx-health {
access_log off;
Expand All @@ -116,6 +120,7 @@ data:
deny all;
}
auth_request /api/v1/auth;
error_page 401 = @error401;
rewrite {{ .Values.prefixPath }}/api/mongodb-datastore/(.*) /$1 break;
proxy_pass http://mongodb-datastore:8080;
proxy_redirect off;
Expand All @@ -136,6 +141,7 @@ data:
# the access is denied) before we store the file
# see http://nginx.org/en/docs/http/ngx_http_auth_request_module.html
auth_request {{ .Values.prefixPath }}/api/v1/auth;
error_page 401 = @error401;
rewrite {{ .Values.prefixPath }}/api/mongodb-datastore/(.*) /$1 break;
proxy_pass http://mongodb-datastore:8080;
Expand Down Expand Up @@ -168,6 +174,7 @@ data:
deny all;
}
auth_request /api/v1/auth;
error_page 401 = @error401;
rewrite {{ .Values.prefixPath }}/api/controlPlane/(.*) /$1 break;
proxy_pass http://shipyard-controller:8080;
Expand All @@ -184,6 +191,7 @@ data:
# the access is denied) before we store the file
# see http://nginx.org/en/docs/http/ngx_http_auth_request_module.html
auth_request {{ .Values.prefixPath }}/api/v1/auth;
error_page 401 = @error401;
rewrite {{ .Values.prefixPath }}/api/controlPlane/(.*) /$1 break;
proxy_pass http://shipyard-controller:8080;
Expand Down Expand Up @@ -215,6 +223,7 @@ data:
# the access is denied) before we store the file
# see http://nginx.org/en/docs/http/ngx_http_auth_request_module.html
auth_request {{ .Values.prefixPath }}/api/v1/auth;
error_page 401 = @error401;
rewrite {{ .Values.prefixPath }}/api/secrets/(.*) /$1 break;
proxy_pass http://secret-service:8080;
Expand Down Expand Up @@ -251,6 +260,7 @@ data:
# the access is denied) before we store the file
# see http://nginx.org/en/docs/http/ngx_http_auth_request_module.html
auth_request {{ .Values.prefixPath }}/api/v1/auth;
error_page 401 = @error401;

rewrite {{ .Values.prefixPath }}/api/statistics/(.*) /$1 break;
proxy_pass http://statistics-service:8080;
Expand Down Expand Up @@ -323,6 +333,7 @@ data:
# the access is denied) before we store the file
# see http://nginx.org/en/docs/http/ngx_http_auth_request_module.html
auth_request /api/v1/auth;
error_page 401 = @error401;

rewrite {{ .Values.prefixPath }}/api/resource-service/(.*) /$1 break;
proxy_pass http://resource-service:8080;
Expand Down

0 comments on commit c8a33e5

Please sign in to comment.