Make authentication more flexible
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 5/5
- Tiempo estimado
- Más de una semana
- Aptitud para principiantes
- 42/100
- Tipo de issue
- Refactorización
- Claridad
- Bastante claro
- Estado de actividad
- Tranquilo
- Stack tecnológico
- typescript
Línea de trabajo
Empieza leyendo src/authn/SolidAuthnLogic.ts y los cambios tratados en pull request 171 para entender el manejo actual de Inrupt y Uvdsl. Define el comportamiento deseado de selección y valores predeterminados de cara al consumidor antes de evaluar implementaciones de autenticadores independientes y la carga diferida. Se considerará terminado cuando se preserve la API externa y se permita seleccionar la biblioteca de autenticación, usando Uvdsl de forma predeterminada.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
When we switched out the auth lib there was an improvement suggestion from Noel:
Following up from my comments in this week's meeting, looking at the current PR it seems like src/authn/SolidAuthnLogic.ts is attempting to handle both Inrupt and Uvdsl libraries? If so, that's is good, here's a couple of comments:
I see that the Inrupt library was removed from the dependencies, but it's still used in some places using the "sessionAny". I'd strongly suggest to keep the dependency installed, and cast the variable to its actual type, rather than using any. Any should be avoided as much as possible.
The current implementation seems to rely on if/else logic inside of the same file. That is ok for now, specially if we can keep the external API for consumers the same. But ideally, we would have two different implementations of an interface, one for Inrupt and one for Uvdsl, and resolve the proper instance to use at runtime. This would also allow to add more adapters in the future. Even if that's not a goal right, it's also good for code organization. As Aad mentioned in the call, this is called the Adapter pattern. Though if that confuses you more than it helps, just take a look at how I've done it for my apps (each authentication library has its own class).
Another additional improvement is to make sure to lazy-load the authentication libraries. Basically, if someone is logging in with uvdsl, they don't need to download all the javascript of Inrupt's library. I also do that in my apps, in particular using dynamic imports (see the .lazy files).
I haven't looked at all the code in the PR, but it's not immediately clear to me how consumers of this library choose which authentication library to use. Ideally, we could have a login() function that takes an "authenticationLibrary" parameter (or "authenticator", as I call them in my code, etc.). That could default to uvdsl, but should be easy to replace with Inrupt.
- Lenguaje dominante
- TypeScript
- Estrellas
- 12
- Forks
- 13
- Merge medio
- 15 h 15 min
- PR fusionados (30 d)
- 3
Guía de contribución
No hay ninguna guía de contribución indexada para este repositorio
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de SolidOS/solid-logic
-
Migrate to Vite Abierto
SolidOS/solid-logic#314 · 1 asignado ·
-
bug
SolidOS/solid-logic#290 · 1 asignado ·
-
enhancement
SolidOS/solid-logic#274 · 4 comentarios · 2 asignados ·
-
Dificultad 4/5 3-5 días Aptitud para principiantes 25/100
SolidOS/solid-logic#76 · 2 comentarios ·
-
enhancement
SolidOS/solid-logic#64 · 5 comentarios · 1 asignado ·
Todos los issues de SolidOS/solid-logic
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
-
bug v2
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
modelcontextprotocol/inspector#2458 · 1 comentario ·
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 75/100
railmapgen/rmp-gallery#4068 ·
-
Mend: dependency security vulnerability status: needs triage 🕵️♀️
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
carbon-design-system/ibm-products#9907 ·