Azure / Azure/data-api-builder

[Bug]: when include and exclude configurations are invalid, we don't catch it.

Offen
#2,720 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
usability
Vorherrschende Sprache
C#
Sterne
1.5k
Forks
370
Ø Merge
3 T. 22 Std.
Gemergte PRs (30 T.)
9

Beschreibung

## 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.`

Beitragsleitfaden

Beitragsleitfaden öffnen

Rechercherichtung

Beginne damit, die JSON-Berechtigungskonfiguration mit demselben Feld sowohl in include als auch in exclude zu reproduzieren, und verfolge anschließend die Validierungs- und Hot-Reload-Pfade, die sie akzeptieren. Vergleiche die resultierende AuthorizationCheckFailed-Antwort mit dem angeforderten klareren Konfigurationsfehler; abgeschlossen ist die Aufgabe, wenn ungültige Konfigurationen bei der Validierung fehlschlagen und die Meldung den include/exclude-Konflikt benennt.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
csharp
Bereich
api, authorization
Issue-Typ
Bug
Schwierigkeit
3/5
Geschätzter Aufwand
1-2 Tage
Aktivitätsstatus
Veraltet
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
42/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.