Skip to content

Commit

Permalink
regex on methods
Browse files Browse the repository at this point in the history
  • Loading branch information
jakeyheath committed Oct 21, 2024
1 parent 43ab9ab commit 458302f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
4 changes: 4 additions & 0 deletions stack/templates/oidc_proxy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,12 @@ spec:
- --reverse-proxy
- --skip-jwt-bearer-tokens
{{- range .Values.oidcProxy.skipAuth }}
{{ if contains "*" .method }}
- --skip-auth-route={{ .path }}
{{- else -}}
- --skip-auth-route={{ .method }}={{ .path }}
{{- end -}}
{{- end -}}
{{- range $allHosts -}}
{{- printf "- --whitelist-domain=%s" . | nindent 12 -}}
{{- printf "- --cookie-domain=%s" . | nindent 12 -}}
Expand Down
8 changes: 7 additions & 1 deletion stack/tests/oidc_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -106,10 +106,16 @@ tests:
path: "/v1/api/docs2"
- method: POST
path: "/v1/api/docs3"
- path: "/v1/api/llm/*"
method: ".*"
extraArgs:
- "--skip-auth-route=/v1/api/docs"
- "--skip-auth-route=/v1/api/security/access_token"
asserts:
- documentIndex: 0
contains:
path: spec.template.spec.containers[0].args
content: "--skip-auth-route=/v1/api/llm/.*"
- documentIndex: 0
contains:
path: spec.template.spec.containers[0].args
Expand All @@ -121,7 +127,7 @@ tests:
- documentIndex: 0
lengthEqual:
path: spec.template.spec.containers[0].args
count: 17
count: 19
- documentIndex: 0
contains:
path: spec.template.spec.containers[0].args
Expand Down

0 comments on commit 458302f

Please sign in to comment.