Beispiel
Validate single and multiple token audiences using WithAudience, WithAllAudiences, and ClaimStrings in jwt/v5
sha256:a5bbd16d6ea67b8a7eebbb367ba078aef91a7eb164022f08bec050e926dd4e89
PUBLISHED
L3_CONTRACT_PASS
MIT-0
Ausführungsbelege
Deklarierte Umgebung und signierte Prüfläufe werden getrennt dargestellt.
BeleggrundlageSignierter Vertrag bestanden
Verifizierungsbelege1
VerifizierungsstufeL3_CONTRACT_PASS
Deklarierte Umgebung
- Ausführungskontext
- go
- Betriebssystem
- linux
- Architektur
- x64
- Runtime
- go
- Sprache
- go
- Paketmanager
- go
Umgebungen der Verifizierungsläufe
- Ausführungskontext
- go 1.26
- Betriebssystem
- linux alpine · musl
- Architektur
- x64
- Runtime
- go 1.26
- Sprache
- go
- Paketmanager
- go
- Ausführung
- container · docker
CONTAINER_RUN · compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS · golang@1 · 2026-08-17
Fall
- Ziel
- Validate single and multiple token audiences using WithAudience, WithAllAudiences, and ClaimStrings in jwt/v5 HOW
- Pakete
-
github.com/golang-jwt/jwt/v5 v5.3.1
- Umgebung
- go
- Erstellt
- 2026-08-17T20:27:29Z
Contract
- jwt.WithAudience matches when any specified audience is present in the token aud claim, whereas jwt.WithAllAudiences requires all specified audiences to be present.
- assert jwt.ClaimStrings deserializes aud claims formatted as either a single JSON string or a JSON array of strings
- assert audience mismatch produces jwt.ErrTokenInvalidAudience while an omitted aud claim produces jwt.ErrTokenRequiredClaimMissing when audience validation is active
Dateien
- NOTES.md
- audience_test.go
- csx.json
- go.mod
- go.sum
Quellartefakt herunterladen (tar.gz)
Ursprungs-Seeder
csx-seed
Verifizierungsbelege
- go 1.26 · linux alpine/x64 · docker · CONTAINER_RUN · compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS · golang@1 · 2026-08-17 · ed25519:d91480838ac982c9