Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FlightRPC][Java] Provide standard way to get client IP address #31924

Open
asfimport opened this issue May 12, 2022 · 5 comments
Open

[FlightRPC][Java] Provide standard way to get client IP address #31924

asfimport opened this issue May 12, 2022 · 5 comments

Comments

@asfimport
Copy link
Collaborator

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.

Reporter: Todd Farmer / @toddfarmer

Note: This issue was originally created as ARROW-16565. Please see the migration documentation for further details.

@asfimport
Copy link
Collaborator Author

David Li / @lidavidm:
Marking as Java since C++/Python support this.

@aiguofer
Copy link
Contributor

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?

scruz-denodo added a commit to scruz-denodo/arrow that referenced this issue Jul 2, 2024
@scruz-denodo
Copy link

scruz-denodo commented 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:
main...scruz-denodo:arrow:issue/31924

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

@aiguofer
Copy link
Contributor

aiguofer commented Jul 2, 2024

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 #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.

scruz-denodo added a commit to scruz-denodo/arrow that referenced this issue Jul 3, 2024
…IPaddress

Added RequestInfo to Authenticator classes.
@scruz-denodo
Copy link

I've just added changes for having the RequestInfo available at authentication process with org.apache.arrow.flight.auth2.CallHeaderAuthenticator

Maybe I add tests and create a PR, for checking if they are valid changes for contributing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants