You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[FlightRPC][Java] Provide standard way to get client IP address #316
Obtaining the IP address of the client can be accomplished via gRPC, but the gRPC interface exposing this information is considered unstable. It would be good to expose this through a standard interface in Flight, both to buffer any future changes/instability in gRPC, but also in support of alternative transports.
It seems like this could be helpful in various situations. Although the gRPC interface for it is considered unstable, it's been around for quite a while and would likely not break unexpectedly (there would be a deprecation and migration path).
An easy way to expose this could be creating some sort of RequestInfo object that gets added to the gRPC Context and later passed into the Flight CallContext so it's easily accessible in request handlers. What other types of data are exposed in the C++/Python interface that we might want to add?
About the experimetal status from the io.grpc.ServerCall#getAttributes method. There is some recent movement here. grpc/grpc-java#1779
I think it is also useful if the following method receives the new org.apache.arrow.flight.RequestInfo object. org.apache.arrow.flight.auth2.CallHeaderAuthenticator#authenticate
The information about the client ip could be interesting for deciding about the authentication.
Updated: The movement on the grpc issue was before the comment of @aiguofer
This is great! I would love to have something like this. Another nice thing to add to the RequestInfo would be the authority.. we've been doing this apache/arrow#38911 (comment) but that interceptor happens after authenticate is called.
Side note: I would also love to have the RequestContext passed to authenticate since it's likely users might want to inject values that are looked up during auth into the request context.
We'd use this too: XTDB applies address-based authentication rules to Flight SQL connections, as pg_hba.conf does for Postgres.
We authenticate in a FlightServerMiddleware, so we'd need the address in FlightServerMiddleware.Factory.onCallStarted as well as in CallHeaderAuthenticator.authenticate — on CallInfo, say, or via the proposed RequestInfo. As of 19.0.0, onCallStarted gets a CallInfo carrying only the method.
In the meantime we register a gRPC ServerStreamTracer through the grpc.builderConsumer transport hint, which stamps the peer address into a server-only header before middleware runs. That relies on the @ExperimentalApiServerBuilder.addStreamTracerFactory.
Activity
asfimport commentedon May 12, 2022
David Li / @lidavidm:
Marking as Java since C++/Python support this.
aiguofer commentedon Jun 29, 2023
It seems like this could be helpful in various situations. Although the gRPC interface for it is considered unstable, it's been around for quite a while and would likely not break unexpectedly (there would be a deprecation and migration path).
An easy way to expose this could be creating some sort of
RequestInfoobject that gets added to the gRPCContextand later passed into the FlightCallContextso it's easily accessible in request handlers. What other types of data are exposed in the C++/Python interface that we might want to add?GH-31924: [FlightRPC][Java] Provide standard way to get client IPaddress
scruz-denodo commentedon Jul 2, 2024
Hi, I have done some changes about this issue. Before creating a pull request I would like to discuss them here.
This is the change:
apache/arrow@main...scruz-denodo:arrow:issue/31924
About the experimetal status from the
io.grpc.ServerCall#getAttributesmethod. There is some recent movement here.grpc/grpc-java#1779
I think it is also useful if the following method receives the new
org.apache.arrow.flight.RequestInfoobject.org.apache.arrow.flight.auth2.CallHeaderAuthenticator#authenticateThe information about the client ip could be interesting for deciding about the authentication.
Updated: The movement on the grpc issue was before the comment of @aiguofer
aiguofer commentedon Jul 2, 2024
This is great! I would love to have something like this. Another nice thing to add to the
RequestInfowould be the authority.. we've been doing this apache/arrow#38911 (comment) but that interceptor happens afterauthenticateis called.Side note: I would also love to have the
RequestContextpassed toauthenticatesince it's likely users might want to inject values that are looked up during auth into the request context.GH-31924: [FlightRPC][Java] Provide standard way to get client IPaddress
scruz-denodo commentedon Jul 3, 2024
I've just added changes for having the
RequestInfoavailable at authentication process withorg.apache.arrow.flight.auth2.CallHeaderAuthenticatorMaybe I add tests and create a PR, for checking if they are valid changes for contributing.
jarohen commentedon Oct 23, 2026
^^ 🤖
Here's our hack, if it helps.
Cheers,
James