Skip to content

Commit 90335a6

Browse files
authored
remove http cache for jwks (#8198)
1 parent d0e4040 commit 90335a6

File tree

3 files changed

+0
-30
lines changed

3 files changed

+0
-30
lines changed

internal/configs/version2/__snapshots__/templates_test.snap

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1234,7 +1234,6 @@ upstream vs_default_cafe_coffee {
12341234
keepalive 16;
12351235
}
12361236

1237-
proxy_cache_path /var/cache/nginx/jwks_uri_cafe levels=1 keys_zone=jwks_uri_cafe:1m max_size=10m;
12381237

12391238
server {
12401239
listen 80;
@@ -1256,8 +1255,6 @@ server {
12561255
internal;
12571256
proxy_method GET;
12581257
proxy_set_header Content-Length "";
1259-
proxy_cache jwks_uri_cafe;
1260-
proxy_cache_valid 200 12h;
12611258
proxy_ssl_server_name on;
12621259
proxy_ssl_name sni.idp.spec.example.com;
12631260
proxy_pass_request_headers off;
@@ -1270,8 +1267,6 @@ server {
12701267
internal;
12711268
proxy_method GET;
12721269
proxy_set_header Content-Length "";
1273-
proxy_cache jwks_uri_cafe;
1274-
proxy_cache_valid 200 12h;
12751270
proxy_ssl_server_name on;
12761271
proxy_ssl_name sni.idp.spec.example.com;
12771272
proxy_pass_request_headers off;
@@ -1362,7 +1357,6 @@ upstream vs_default_cafe_coffee {
13621357
keepalive 16;
13631358
}
13641359

1365-
proxy_cache_path /var/cache/nginx/jwks_uri_cafe levels=1 keys_zone=jwks_uri_cafe:1m max_size=10m;
13661360

13671361
server {
13681362
listen 80;
@@ -1384,8 +1378,6 @@ server {
13841378
internal;
13851379
proxy_method GET;
13861380
proxy_set_header Content-Length "";
1387-
proxy_cache jwks_uri_cafe;
1388-
proxy_cache_valid 200 12h;
13891381
proxy_pass_request_headers off;
13901382
proxy_pass_request_body off;
13911383
proxy_set_header Host idp.spec.example.com;
@@ -1396,8 +1388,6 @@ server {
13961388
internal;
13971389
proxy_method GET;
13981390
proxy_set_header Content-Length "";
1399-
proxy_cache jwks_uri_cafe;
1400-
proxy_cache_valid 200 12h;
14011391
proxy_pass_request_headers off;
14021392
proxy_pass_request_body off;
14031393
proxy_set_header Host idp.route.example.com;

internal/configs/version2/nginx-plus.virtualserver.tmpl

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -115,10 +115,6 @@ map $request_method $cache_purge_{{ replaceAll $l.Cache.ZoneName "-" "_" }} {
115115
{{- end }}
116116
{{- end }}
117117

118-
{{- with $s.JWKSAuthEnabled }}
119-
proxy_cache_path /var/cache/nginx/jwks_uri_{{$s.VSName}} levels=1 keys_zone=jwks_uri_{{$s.VSName}}:1m max_size=10m;
120-
{{- end }}
121-
122118
{{- if and $s.OIDC $s.OIDC.PKCEEnable }}
123119
include oidc/oidc_pkce_supplements.conf;
124120
{{- end }}
@@ -290,10 +286,6 @@ server {
290286
internal;
291287
proxy_method GET;
292288
proxy_set_header Content-Length "";
293-
{{- if .KeyCache }}
294-
proxy_cache jwks_uri_{{ $s.VSName }};
295-
proxy_cache_valid 200 12h;
296-
{{- end }}
297289
{{- with .JwksURI }}
298290
{{- if .JwksSNIEnabled }}
299291
proxy_ssl_server_name on;

internal/configs/version2/templates_test.go

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -731,12 +731,6 @@ func TestExecuteVirtualServerTemplateWithJWKSWithToken(t *testing.T) {
731731
if !bytes.Contains(got, []byte("token=$http_token")) {
732732
t.Error("want `token=$http_token` in generated template")
733733
}
734-
if !bytes.Contains(got, []byte("proxy_cache jwks_uri_")) {
735-
t.Error("want `proxy_cache` in generated template")
736-
}
737-
if !bytes.Contains(got, []byte("proxy_cache_valid 200 12h;")) {
738-
t.Error("want `proxy_cache_valid 200 12h;` in generated template")
739-
}
740734

741735
if !bytes.Contains(got, []byte("proxy_ssl_server_name on;")) {
742736
t.Error("want `proxy_ssl_server_name on;` in generated template")
@@ -760,12 +754,6 @@ func TestExecuteVirtualServerTemplateWithJWKSWithoutToken(t *testing.T) {
760754
if bytes.Contains(got, []byte("token=$http_token")) {
761755
t.Error("want no `token=$http_token` string in generated template")
762756
}
763-
if !bytes.Contains(got, []byte("proxy_cache jwks_uri_")) {
764-
t.Error("want `proxy_cache` in generated template")
765-
}
766-
if !bytes.Contains(got, []byte("proxy_cache_valid 200 12h;")) {
767-
t.Error("want `proxy_cache_valid 200 12h;` in generated template")
768-
}
769757
snaps.MatchSnapshot(t, string(got))
770758
t.Log(string(got))
771759
}

0 commit comments

Comments
 (0)