Exemple
github.com/golang-jwt/jwt/v5 5.3.0: Verify a JWT with golang-jwt v5 and tell an expired token apart from a forged one
Échantillon vérifié pour golang github.com/golang-jwt/jwt/v5 5.3.0: Verify a JWT with golang-jwt v5 and tell an expired token apart from a forged one. Le…
sha256:b81445cb9097d69ddb4ec5db96e99cdac25b5cbebc29977426ca6bbd778260c9
Ce réseau offre une seule chose : un échantillon qui compile. Il l'a exécuté dans un bac à sable et conservé le reçu signé. Il ne note rien et ne garantit rien : si le même code compile chez vous, il ne l'a pas mesuré.
Combien de clés de signature distinctes ont déposé un reçu de contrat réussi. Une seule, c'est l'auteur ; plus d'une signifie que quelqu'un d'autre l'a compilé aussi. Une clé est auto-générée sans identité enregistrée derrière, donc on compte des clés, pas des personnes.
MIT-0
Preuves d'exécution
L'environnement déclaré et les exécutions signées sont séparés, pour que vous voyiez exactement ce que cet échantillon a exécuté et où.
- Base de preuve
- Contrat signé réussi
- Reçus de vérification
- 2
- Clés de signature qui l’ont compilé
- 2
Environnement déclaré
go 1.26 linux x64 go 1.26 go go
Environnements des exécutions de vérification
| Environnement | Contrat | Étapes | Exécution |
|---|---|---|---|
| go 1.26 · linux alpine/x64 · docker ed25519:a2ec939a4c60e243 | PASS | compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS CONTAINER_RUN · golang@1 |
2026-08-14 |
| go 1.26 · linux alpine/x64 · docker ed25519:d91480838ac982c9 | PASS | compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS CONTAINER_RUN · golang@1 |
2026-08-17 |
Cas
MIGRATION- Objectif
- Verify a JWT with golang-jwt v5 and tell an expired token apart from a forged one
- Symboles
-
- jwt.ParseWithClaims
- jwt.RegisteredClaims
- jwt.ErrTokenExpired
- jwt.WithIssuer
- Environnement
- go 1.26
- Créé
- 2026-08-14T06:27:58Z
Contrat
- sign and verify a token with claims embedded in RegisteredClaims
- assert an expired token matches both ErrTokenExpired and ErrTokenInvalidClaims
- assert a wrong key is a signature error and not an expiry
- assert alg=none is refused without opting in
- assert issuer checking is a parser option
Fichiers
- csx.json
- go.mod
- go.sum
- src/tokens.go
- test/main.go