Support proxy_auth_domain on gRPC auxiliary transport - #6469
Open
abhinavp105 wants to merge 1 commit into
Open
Conversation
BackendRegistry gated the gRPC auth path on GRPC_SUPPORTED_AUTH =
Set.of("jwt", "basic"), which silently dropped any configured
proxy_auth_domain. This adds "proxy" to that set so HTTPProxyAuthenticator
is included in the gRPC auth chain.
No other changes were needed:
- BackendRegistry.authenticate() already calls XFFResolver.resolve()
unconditionally for both REST and gRPC, so RemoteIpDetector sets
OPENDISTRO_SECURITY_XFF_DONE on the thread context when the caller
IP matches the configured internal-proxies allowlist.
- GrpcRequestChannel.getRemoteAddress() returns the client
InetSocketAddress from Grpc.TRANSPORT_ATTR_REMOTE_ADDR.
- GrpcRequestChannel.getHeaders() exposes ASCII headers
case-insensitively so user_header / roles_header lookups work.
Tests
- BackendRegistryGrpcAuthTest: added a success case and a regression
guard that fails if "proxy" is dropped from GRPC_SUPPORTED_AUTH.
- ProxyAuthGrpcTest (new): full integration test on
SINGLENODE + SecureNetty4GrpcServerTransport + TLS, exercising
SecurityGrpcFilter -> BackendRegistry -> HTTPProxyAuthenticator ->
roles_mapping with a real DocumentService.Bulk call.
Also updates the stale "JWT only" comment inside authenticate().
Signed-off-by: Abhinav Pandey <avinodkumarpandey@atlassian.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
abhinavp105
requested review from
DarshitChanpura,
Rishav9852Kumar,
RyanL1997,
cwperks,
derek-ho,
finnegancarroll,
nibix,
reta,
shikharj05 and
willyborankin
as code owners
September 4, 2026 15:15
Contributor
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #6439
BackendRegistry.GRPC_SUPPORTED_AUTHgated the gRPC auth path on{jwt, basic}, silently dropping any configuredproxy_auth_domain. This adds"proxy"to that set soHTTPProxyAuthenticatoris included in the gRPC auth chain — enabling Envoyext_authz-style header-based identity (x-proxy-user/x-proxy-roles) to be trusted on gRPC the same way it is on REST today.No other wiring changes were needed:
BackendRegistry.authenticate()already callsXFFResolver.resolve()unconditionally for both REST and gRPC, soRemoteIpDetectorsetsOPENDISTRO_SECURITY_XFF_DONEon the thread context when the caller IP matches the configured internal-proxies allowlist.GrpcRequestChannel.getRemoteAddress()returns the clientInetSocketAddressfromGrpc.TRANSPORT_ATTR_REMOTE_ADDR.GrpcRequestChannel.getHeaders()exposes ASCII headers case-insensitively souser_header/roles_headerlookups work.Tests
BackendRegistryGrpcAuthTest— added a success case (testGrpcAuthenticateWithValidProxyAuthAndConfiguredDomain) and a regression guard (testGrpcProxyAuthDomainIsNotSkipped) that fails if"proxy"is dropped fromGRPC_SUPPORTED_AUTH.ProxyAuthGrpcTest(new) — full integration test onSINGLENODE+SecureNetty4GrpcServerTransport+ TLS, exercisingSecurityGrpcFilter→BackendRegistry→HTTPProxyAuthenticator→roles_mappingwith a realDocumentService.Bulkcall. Positive case, plus negatives for missingx-forwarded-forand missing user header.Also updates the stale
"JWT only"comment insideauthenticate().Check List