Skip to content

Commit 6d18f0a

Browse files
committed
set securitypolicy name to oauth2 stats prefix
Signed-off-by: Huabing Zhao <[email protected]>
1 parent 2899416 commit 6d18f0a

7 files changed

+8
-0
lines changed

internal/xds/translator/oidc.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,7 @@ func oauth2Config(securityFeatures *ir.SecurityFeatures) (*oauth2v3.OAuth2, erro
127127
preserveAuthorizationHeader := !oidc.ForwardAccessToken
128128
oauth2 := &oauth2v3.OAuth2{
129129
Config: &oauth2v3.OAuth2Config{
130+
StatPrefix: oidc.Name,
130131
TokenEndpoint: &corev3.HttpUri{
131132
Uri: oidc.Provider.TokenEndpoint,
132133
HttpUpstreamType: &corev3.HttpUri_Cluster{

internal/xds/translator/testdata/out/xds-ir/multiple-listeners-same-port-with-different-filters.listeners.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@
7777
signoutPath:
7878
path:
7979
exact: /foo/logout
80+
statPrefix: securitypolicy/default/policy-for-gateway-2
8081
tokenEndpoint:
8182
cluster: oauth_foo_com_443
8283
timeout: 10s

internal/xds/translator/testdata/out/xds-ir/oidc-and-jwt-with-passthrough.listeners.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@
5858
signoutPath:
5959
path:
6060
exact: /logout
61+
statPrefix: securitypolicy/envoy-gateway/security-policy-1
6162
tokenEndpoint:
6263
cluster: oauth_foo_com_443
6364
timeout: 10s

internal/xds/translator/testdata/out/xds-ir/oidc-backencluster-provider.listeners.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
typedConfig:
2020
'@type': type.googleapis.com/envoy.extensions.filters.http.oauth2.v3.OAuth2
2121
config:
22+
statPrefix: securitypolicy/envoy-gateway/policy-for-gateway
2223
authScopes:
2324
- openid
2425
authType: BASIC_AUTH

internal/xds/translator/testdata/out/xds-ir/oidc-backend-cluster-provider.listeners.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@
5858
signoutPath:
5959
path:
6060
exact: /bar/logout
61+
statPrefix: securitypolicy/envoy-gateway/policy-for-gateway
6162
tokenEndpoint:
6263
cluster: securitypolicy/envoy-gateway/policy-for-gateway/0
6364
timeout: 10s

internal/xds/translator/testdata/out/xds-ir/oidc.listeners.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@
5757
signoutPath:
5858
path:
5959
exact: /foo/logout
60+
statPrefix: securitypolicy/default/policy-for-first-route
6061
tokenEndpoint:
6162
cluster: oauth_foo_com_443
6263
timeout: 10s
@@ -121,6 +122,7 @@
121122
signoutPath:
122123
path:
123124
exact: /bar/logout
125+
statPrefix: securitypolicy/default/policy-for-second-route
124126
tokenEndpoint:
125127
cluster: oauth_bar_com_443
126128
timeout: 10s

internal/xds/translator/testdata/out/xds-ir/securitypolicy-with-oidc-jwt-authz.listeners.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@
5252
signoutPath:
5353
path:
5454
exact: /logout
55+
statPrefix: securitypolicy/default/policy-for-http-route
5556
tokenEndpoint:
5657
cluster: oidc_example_com_443
5758
timeout: 10s

0 commit comments

Comments
 (0)