Verify: allow passing a function to `audience`
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Aptitud para principiantes
- 35/100
- Tipo de issue
- Nueva funcionalidad
- Claridad
- Bastante claro
- Estado de actividad
- Estancado
- Stack tecnológico
- javascript
- Área
- authentication
Línea de trabajo
Comienza en el punto de entrada jwt.verify() y sigue cómo se consume la opción audience, incluido el paso a través de jwt-express descrito aquí. Usa el ejemplo de audiencias dinámicas para aclarar la forma de retorno compatible de la función para un string o un array, y añade cobertura que demuestre que los valores modificados se detectan sin reiniciar la app.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Describe the problem you'd like to have solved
We have a use case where our audience list comes from AWS Parameter Store and could be changed on the fly without having to restart the whole app.
Describe the ideal solution
It would be ideal to be able to pass a function that return the audience(s). Something like this;
// This could be updated elsewhere.
// Could be an array ['audience1', 'audience2'] or just a string.
let audiences = []; ;
jwt.verify(token, secretOrPublicKey, {
audience: function() {
return audiences; return the reference to the list.
}
});
Alternatives and current work-arounds
We actually are not calling jwt.verify() directly but uses jwt-express to create a middleware for token verification. jwt-express passes through the audience option to jwt.verify() internally. Here's what we currently have:
app.use(jwtExpress({ audience: audiences }));
The middleware only gets the copy of the list at the time the app starts. We could wrap the jwtExpress middleware inside another middleware that always returns the current copy of the audiences list, but it would be an ugly solution.
- Lenguaje dominante
- JavaScript
- Estrellas
- 18.2k
- Forks
- 1.3k
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Guía de contribución
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 auth0/node-jsonwebtoken
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
auth0/node-jsonwebtoken#1042 · 1 comentario ·
-
`jwt.sign()` callback is executed twice for "The payload already has an "..." property" errors Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
auth0/node-jsonwebtoken#1000 · 2 comentarios · 1 reacción ·
-
Dificultad 4/5 3-5 días Aptitud para principiantes 65/100
auth0/node-jsonwebtoken#1046 ·
-
Dificultad 5/5 Más de una semana Aptitud para principiantes 10/100
auth0/node-jsonwebtoken#1034 ·
-
Dificultad 3/5 1-2 días Aptitud para principiantes 48/100
auth0/node-jsonwebtoken#1032 ·
Todos los issues de auth0/node-jsonwebtoken
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
-
area-deployment area-integrations triage:bot-seen
Dificultad 2/5 Medio día Aptitud para principiantes 86/100
-
Issue-Bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
sugarlabs/musicblocks#8924 ·
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 90/100
ArduPilot/ardupilot_wiki#8088 ·
-
[BUG] createTool tools cannot be registered with Mastra when exactOptionalPropertyTypes is enabled Abiertocustomer-eng status: needs triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100