RegisteredClaims are a structured version of the JWT Claims Set, restricted to Registered Claim Names, as referenced at https://datatracker.ietf.org/doc/html/rfc7519#section-4.1 This type can be used on its own, but then additional private and public claims embedded in the JWT will not be parsed. T
| 10 | // |
| 11 | // See examples for how to use this with your own claim types. |
| 12 | type RegisteredClaims struct { |
| 13 | // the `iss` (Issuer) claim. See https://datatracker.ietf.org/doc/html/rfc7519#section-4.1.1 |
| 14 | Issuer string `json:"iss,omitempty"` |
| 15 | |
| 16 | // the `sub` (Subject) claim. See https://datatracker.ietf.org/doc/html/rfc7519#section-4.1.2 |
| 17 | Subject string `json:"sub,omitempty"` |
| 18 | |
| 19 | // the `aud` (Audience) claim. See https://datatracker.ietf.org/doc/html/rfc7519#section-4.1.3 |
| 20 | Audience ClaimStrings `json:"aud,omitempty"` |
| 21 | |
| 22 | // the `exp` (Expiration Time) claim. See https://datatracker.ietf.org/doc/html/rfc7519#section-4.1.4 |
| 23 | ExpiresAt *NumericDate `json:"exp,omitempty"` |
| 24 | |
| 25 | // the `nbf` (Not Before) claim. See https://datatracker.ietf.org/doc/html/rfc7519#section-4.1.5 |
| 26 | NotBefore *NumericDate `json:"nbf,omitempty"` |
| 27 | |
| 28 | // the `iat` (Issued At) claim. See https://datatracker.ietf.org/doc/html/rfc7519#section-4.1.6 |
| 29 | IssuedAt *NumericDate `json:"iat,omitempty"` |
| 30 | |
| 31 | // the `jti` (JWT ID) claim. See https://datatracker.ietf.org/doc/html/rfc7519#section-4.1.7 |
| 32 | ID string `json:"jti,omitempty"` |
| 33 | } |
| 34 | |
| 35 | // GetExpirationTime implements the Claims interface. |
| 36 | func (c RegisteredClaims) GetExpirationTime() (*NumericDate, error) { |
nothing calls this directly
no outgoing calls
no test coverage detected