feat(oauth2-proxy): setting skip auth routes
This commit is contained in:
@@ -11,7 +11,7 @@ default:
|
|||||||
@just --list --unsorted --list-submodules
|
@just --list --unsorted --list-submodules
|
||||||
|
|
||||||
# Setup OAuth2 Proxy for an application
|
# Setup OAuth2 Proxy for an application
|
||||||
setup-for-app app_name app_host app_namespace="default" upstream_service="":
|
setup-for-app app_name app_host app_namespace="default" upstream_service="" skip_auth_routes="":
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
|
|
||||||
@@ -81,6 +81,7 @@ setup-for-app app_name app_host app_namespace="default" upstream_service="":
|
|||||||
export APP_HOST="{{ app_host }}"
|
export APP_HOST="{{ app_host }}"
|
||||||
export APP_NAMESPACE="{{ app_namespace }}"
|
export APP_NAMESPACE="{{ app_namespace }}"
|
||||||
export UPSTREAM_SERVICE="${upstream_service}"
|
export UPSTREAM_SERVICE="${upstream_service}"
|
||||||
|
export SKIP_AUTH_ROUTES="{{ skip_auth_routes }}"
|
||||||
|
|
||||||
gomplate -f oauth2-proxy-deployment.gomplate.yaml | kubectl apply -f -
|
gomplate -f oauth2-proxy-deployment.gomplate.yaml | kubectl apply -f -
|
||||||
gomplate -f oauth2-proxy-service.gomplate.yaml | kubectl apply -f -
|
gomplate -f oauth2-proxy-service.gomplate.yaml | kubectl apply -f -
|
||||||
|
|||||||
@@ -11,6 +11,11 @@ data:
|
|||||||
redirect_url = "https://{{ .Env.APP_HOST }}/oauth2/callback"
|
redirect_url = "https://{{ .Env.APP_HOST }}/oauth2/callback"
|
||||||
email_domains = "*"
|
email_domains = "*"
|
||||||
reverse_proxy = true
|
reverse_proxy = true
|
||||||
|
{{- if .Env.SKIP_AUTH_ROUTES }}
|
||||||
|
skip_auth_routes = [{{ range $i, $route := (split .Env.SKIP_AUTH_ROUTES ",") }}{{ if $i }},{{ end }}
|
||||||
|
"^{{ $route }}"{{ end }}
|
||||||
|
]
|
||||||
|
{{- end }}
|
||||||
|
|
||||||
---
|
---
|
||||||
apiVersion: apps/v1
|
apiVersion: apps/v1
|
||||||
|
|||||||
Reference in New Issue
Block a user