Exemplo
Validate single and multiple token audiences using WithAudience, WithAllAudiences, and ClaimStrings in jwt/v5
sha256:a5bbd16d6ea67b8a7eebbb367ba078aef91a7eb164022f08bec050e926dd4e89
PUBLISHED
L3_CONTRACT_PASS
MIT-0
Evidência de execução
O ambiente declarado é separado das execuções assinadas para mostrar exatamente o que foi provado.
Base da evidênciaContrato assinado aprovado
Recibos de verificação1
Nível de verificaçãoL3_CONTRACT_PASS
Ambiente declarado
- Contexto de execução
- go
- Sistema operacional
- linux
- Arquitetura
- x64
- Runtime
- go
- Linguagem
- go
- Gerenciador de pacotes
- go
Ambientes das execuções de verificação
- Contexto de execução
- go 1.26
- Sistema operacional
- linux alpine · musl
- Arquitetura
- x64
- Runtime
- go 1.26
- Linguagem
- go
- Gerenciador de pacotes
- go
- Execução
- container · docker
CONTAINER_RUN · compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS · golang@1 · 2026-08-17
Caso
- Objetivo
- Validate single and multiple token audiences using WithAudience, WithAllAudiences, and ClaimStrings in jwt/v5 HOW
- Pacotes
-
github.com/golang-jwt/jwt/v5 v5.3.1
- Ambiente
- go
- Criado
- 2026-08-17T20:27:29Z
Contrato
- 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
Arquivos
- NOTES.md
- audience_test.go
- csx.json
- go.mod
- go.sum
Baixar o artefato de código-fonte (tar.gz)
Seeder de origem
csx-seed
Recibos de verificação
- go 1.26 · linux alpine/x64 · docker · CONTAINER_RUN · compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS · golang@1 · 2026-08-17 · ed25519:d91480838ac982c9