Skip to content

Commit 2882b7c

Browse files
authored
fix: set path prefix for http ext auth service (#3018)
Signed-off-by: huabing zhao <[email protected]>
1 parent b98893a commit 2882b7c

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

internal/xds/translator/extauth.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,9 +147,13 @@ func httpService(http *ir.HTTPExtAuthService) *extauthv3.HttpService {
147147
var (
148148
uri string
149149
headersToBackend []*matcherv3.StringMatcher
150-
service = new(extauthv3.HttpService)
150+
service *extauthv3.HttpService
151151
)
152152

153+
service = &extauthv3.HttpService{
154+
PathPrefix: http.Path,
155+
}
156+
153157
u := url.URL{
154158
// scheme should be decided by the TLS setting, but we don't have that info now.
155159
// It's safe to set it to http because the ext auth filter doesn't use the

internal/xds/translator/testdata/out/xds-ir/ext-auth.listeners.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
patterns:
4040
- exact: header1
4141
- exact: header2
42+
pathPrefix: /auth
4243
serverUri:
4344
cluster: securitypolicy/default/policy-for-gateway-1/envoy-gateway/http-backend
4445
timeout: 10s

0 commit comments

Comments
 (0)