Skip to content

feat(irpc-iroh): make it easy to do a manual connection loop with authentication #14

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

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

Frando
Copy link
Member

@Frando Frando commented Apr 25, 2025

This exposes a function read_request from irpc_iroh that can be used to read a single request from a connection, and upcast the streams into the types used by irpc.

With this new public function, it is easy to drive the connection loop yourself, which you might want to do if there's some state that changes, e.g. that the first request is expected to be an authentication requests, and all other requests should be declined if that is not the case.

The change is semver-compatible (only adds a new public fn).

See examples/auth.rs for an example.

This is used in https://github.com/n0-computer/n0des/pull/259

@Frando Frando marked this pull request as draft April 25, 2025 13:28
@Frando Frando force-pushed the Frando/manual-accept-with-auth branch 2 times, most recently from 35b6d34 to fec1283 Compare April 25, 2025 13:29
@Frando Frando force-pushed the Frando/manual-accept-with-auth branch from fec1283 to 45911f2 Compare May 21, 2025 10:24
@Frando Frando force-pushed the Frando/manual-accept-with-auth branch from 541b450 to 4e13805 Compare May 21, 2025 20:44
@Frando Frando requested a review from rklaehn May 21, 2025 21:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant