Azure / Azure/data-api-builder
[Bug]: when include and exclude configurations are invalid, we don't catch it.
- Lenguaje dominante
- C#
- Estrellas
- 1.5k
- Forks
- 370
- Merge medio
- 3 d 22 h
- PR fusionados (30 d)
- 9
Descripción
## Invalid configuration should not `validate`.
Today this starts, passes validate and also hot reloads successfully when it should fail.
```json
"permissions": [
{
"role": "anonymous",
"actions": [
{
"action": "*",
"fields": {
"include": ["Id"],
"exclude": ["Id"]
}
}
]
}
],
```
I am also not sure this error message helps the developer debug the situation. And it should.
```json
{
"error": {
"code": "AuthorizationCheckFailed",
"message": "Authorization Failure: Access Not Allowed.",
"status": 403
}
}
```
This implies we are asking for a field that is not available, but we are actually just asking for the entity. It's confusing.
Can we append to the error message? `include and exclude field configuration is invalid.`
Guía de contribución
Línea de trabajo
Empieza reproduciendo la configuración de permisos JSON con el mismo campo tanto en include como en exclude y, a continuación, sigue las rutas de validación y hot-reload que la aceptan. Compara la respuesta AuthorizationCheckFailed resultante con el error de configuración más claro solicitado; se considera terminado cuando las configuraciones no válidas fallan la validación y el mensaje identifica el conflicto entre include y exclude.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- csharp
- Área
- api, authorization
- Tipo de issue
- Error
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Estado de actividad
- Estancado
- Claridad
- Bastante claro
- Aptitud para principiantes
- 42/100