Azure / Azure/data-api-builder

🥕[Bug]: JSON Schema: Redundant "required" Properties

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

Beschreibung

The `jwt.audience` and `jwt.issuer` properties are not currently marked as required. However, for the `AzureAd` provider, these properties are essential for proper authentication configuration and should be required. For other providers, such as `StaticWebApps`, `AppService`, or `Simulator`, they are unnecessary and should not trigger schema validation errors.

## Suggestion

Update the schema to include conditional validation:

**Current Schema**

```json
"authentication": {
"type": "object",
"additionalProperties": false,
"properties": {
"provider": {
"type": "string",
"description": "The name of the authentication provider",
"default": "StaticWebApps"
},
"jwt": {
"type": "object",
"additionalProperties": false,
"properties": {
"audience": {
"type": "string"
},
"issuer": {
"type": "string"
}
}
}
}
}
```

**Updated Schema**

```json
"authentication": {
"type": "object",
"properties": {
"provider": {
"type": "string",
"enum": ["StaticWebApps", "AppService", "AzureAd", "Simulator"]
},
"jwt": {
"type": "object",
"properties": {
"audience": { "type": "string" },
"issuer": { "type": "string" }
}
}
},
"required": ["provider"],
"allOf": [
{
"if": {
"properties": { "provider": { "const": "AzureAd" } }
},
"then": {
"properties": {
"jwt": {
"required": ["audience", "issuer"]
}
}
}
}
]
}
```

Beitragsleitfaden

Beitragsleitfaden öffnen

Rechercherichtung

Das Issue nennt keine Datei und keinen Test; finde zunächst das Schema der Authentifizierungskonfiguration und die Tests, die die Provider-Validierung abdecken. Bestätige, dass AzureAd sowohl jwt.audience als auch jwt.issuer erfordert, während dies für StaticWebApps, AppService und Simulator nicht gilt, und führe anschließend die relevanten Validierungstests aus.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

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

Neue Issues direkt in Ihr Postfach

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