-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Unix Domain Socket Credential Support with Connected Trait #365
Comments
If I am miss understanding something, shouldn't this work? https://docs.rs/tonic/0.2.1/tonic/struct.Request.html#method.remote_addr |
So two of the functions UnixStream exposes are Neither of those are really compatible with I could, technically, shoehorn the group id and user id into the flowinfo and scope_id of |
@dfreese ah yeah, socketaddr from net didn't make sense but I forgot to check the module :) This is an interesting use case that I am not 100% sure how to fix just yet. We might want to coordinate with hyper on this as well. |
In the process of updating our code to tokio 1.x, I had a little more trouble migrating the code I had on tokio 0.2 because the types that we used disappeared, particularly tokio::next::unit::Incoming. Drawing on the example of hyper::server::conn::AddrIncoming, this creates a UnixIncoming struct in the example, and then uses that within the server code. I generally found this cleaner, though I understand that is subjective. I also thought it could be useful to inform any further unix api discussions, similar in the vein of hyperium#365.
We also have this use case :) After researching a bit seems to be more blocked by hyper capabilities than tonic atm? |
One thought might be to have the ability in the |
That way you could associate data from a connection with any |
Or any way to get back the originally yielded item in the |
I like that approach. That would allow for a lot more flexibility for different types of connections. Obviously, I haven't yet had a chance to think about what that'd look like or potential downsides. |
Yeah, i think in this case we might want to try to take advantage of https://docs.rs/http/0.2.4/http/request/struct.Request.html#method.extensions? |
This should be solved via #255 |
Yeah, looks like what we wanted, currently do not need it anymore but seems useful! |
Thanks @davidpdrsn for getting back to this. That looks like it would certainly fit the use case we had here. |
We're using tonic, and want to be able to use it with unix domain sockets. When using them, we want to be able to validate the peer_cred of the tokio::net::UnixStream, for example.
It looks like Request gets it's information from the Connected trait, which is empty in the UDS example
Is peer_cred something that you'd be willing to expose in Request? I understand that would be a little messy, in that it starts to open you up to supporting a number of different connection types through the Request interface.
(BTW: I'm happy to add this, or something else if it seems like there would be a better way of going about it)
The text was updated successfully, but these errors were encountered: