Support for Non-401 Error Codes from the validateFunc
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 35/100
- Tipo de issue
- Nueva funcionalidad
- Claridad
- Bastante claro
- Estado de actividad
- Estancado
- Stack tecnológico
- javascript, node.js
- Área
- authentication
Línea de trabajo
Empieza leyendo el manejo de validateFunc del plugin de cookies y compáralo con el comportamiento de validate de @hapi/basic descrito en el issue. Se considera terminado cuando la validación puede devolver un error de Boom que no sea 401, como 403 Forbidden, para una cookie no válida para la región solicitada, con pruebas que cubran el estado de la respuesta.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Support plan
- is this issue currently blocking your project? (yes/no): No
- is this issue affecting a production system? (yes/no): No
Context
- node version:
v14.17.0 - module version:
11.0.2 - environment (e.g. node, browser, native): Node
- used with (e.g. hapi application, another framework, standalone, ...): Hapi application (Hapi version =
20.2.1) - any other relevant information:
What problem are you trying to solve?
I have a system that involves multiple different "regions" of authorization, I want a cookie to only be valid for one of these "regions", and I have added validation checks into the validateFunc. I would love be able to respond to the client with a 403 Forbidden when the cookie provided is for a different "region" than that which it is trying to access.
Example:
I have "regions" 1 and 2, and an authorization cookie is used for region 1, but the user is making a request to GET /region/2 I would like to be able to throw boom.forbidden(), and it set the response code to 403 instead of the plugin only throwing 401 to the user.
Do you have a new or modified API suggestion to solve the problem?
I think a solution following a similar vein as to how @hapi/basic does it where if the validateFunc throws an error(/Boom error) it replaces the default boom.unauthorized()
From the @hapi/basic API documentation for the validate function:
- Throwing an error from this function will replace default
Boom.unauthorizederror
- Lenguaje dominante
- JavaScript
- Estrellas
- 229
- Forks
- 99
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Sin plantilla de pull request
- Leer la 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 hapijs/cookie
-
support
Dificultad 4/5 3-5 días Aptitud para principiantes 45/100
-
ttl和keepAlive功能存在bugAbiertobug
Dificultad 4/5 3-5 días Aptitud para principiantes 30/100
-
support
Dificultad 5/5 Más de una semana Aptitud para principiantes 25/100
-
support
Dificultad 5/5 Más de una semana Aptitud para principiantes 10/100
-
support
Dificultad 3/5 1-2 días Aptitud para principiantes 25/100
Todos los issues de hapijs/cookie
Issues similares
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
obsidianmd/obsidian-help#1169 ·
Los mantenedores suelen responder en 2 días
-
[docs] RELEASE.md: wrong branch name, no check that the prepare PR merged with the right subject, manual publish stepPosiblemente ocupada @albertteoh la tomó hoy. Abiertodocumentation
Dificultad 2/5 1-3 horas Aptitud para principiantes 85/100
jaegertracing/jaeger-ui#4739 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
-
documentation
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
keepassxreboot/keepassxc-browser#3159 · 1 comentario ·
-
Add: ESP 2 RSAbiertoapproved check:passed feeds:add
Dificultad 1/5 Menos de una hora Aptitud para principiantes 67/100