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

Allow peer address to be accessible to the server handler function #2252

Open
jquirke opened this issue Mar 17, 2024 · 0 comments
Open

Allow peer address to be accessible to the server handler function #2252

jquirke opened this issue Mar 17, 2024 · 0 comments

Comments

@jquirke
Copy link
Contributor

jquirke commented Mar 17, 2024

Currently, it is not possible to ascertain from an encoded YARPC handler exactly to who the remote peer is.

For example, it would be useful from and audit and debugging point of view to identify which peer is sending malicious, malformed, or otherwise problematic RPCs.

The proposed interface would be to add the string to the transport.Request structure, so an application can be do something like:

    peerAddress := yarpc.CallFromContext(ctx).CallerPeerAddress()

Note, the design was chosen to be a string to be as underlying transport (transport being L3/L4) agnostic as possible.

Current workarounds are tightly coupled to the underlying protocol. For example, one can use https://pkg.go.dev/google.golang.org/grpc/peer#FromContext to obtain the peer's net.Addr in a GRPC handler, but there is no trivial equivalent for TChannel and HTTP.

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

No branches or pull requests

1 participant