Make it possible to have stateful connections

Abierto
#60 2 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 2 días

@Frando ya está trabajando en esto.

Desde el 27/10/2026.

  • #61 de @Frando — cerrado sin fusionar
  • #155 de @Frando — abierto

Evaluación

Dificultad
5/5
Tiempo estimado
Más de una semana
Aptitud para principiantes
42/100
Tipo de issue
Nueva funcionalidad
Claridad
Bastante claro
Estado de actividad
Estancado
Stack tecnológico
rust

Línea de trabajo

Comienza con el ejemplo auth.rs y las implementaciones de RemoteConnection para irpc sobre QUIC e irpc-iroh; después, sigue cómo irpc::Client gestiona las reconexiones. Define un mecanismo del ciclo de vida de la conexión para una configuración con estado y verifica que la autenticación se envíe antes de las solicitudes de la aplicación después de cada reconexión.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

A typical usecase involves authenticating to a remote server.

I first thought this would be easy enough: See this example https://github.com/n0-computer/irpc/blob/main/irpc-iroh/examples/auth.rs

There's a Auth message that contains whatever authentication token you are using. The server expects the first message on a connection to be that message, and aborts the connection if not or if the token doesn't verify. From the server side, all is good.

On the client side however, it seems to be fine to just issue an Auth rpc call when constructing a client. However, it is not: the RemoteConnection impls for both irpc over quic and irpc-iroh support reconnects-on-demand: If the previous connection was aborted by the server in-between (e.g. because the server was restarted), irpc will reconnect to the server with the same args (alpn and node addr) than in the initial connection. The request submitted by the application will then be sent on the new connection - which will fail, because the server expects an Auth message as the first message on each connection.

It is currently completely invisible to the irpc::Client and application code if and when such reconnections happend, therefore there's no way currently to "send an Auth request first whenever a reconnect happens".

Fixing this is quite important to me, I have multiple uses of irpc that would need this. The only alternative currently is to send a token with each and every request, which is wasteful and cumbersome.

Lenguaje dominante
Rust
Estrellas
59
Forks
10
Merge medio
3 d 15 h
PR fusionados (30 d)
21

Preparar el entorno

Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de n0-computer/irpc

Todos los issues de n0-computer/irpc

Issues similares

Más issues de Rust

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.