golang-jwt / jwt

Go implementation of JSON Web Tokens (JWT).

Home Page:https://golang-jwt.github.io/jwt/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

`GetID` in the `Claims` interface ?

zaakn opened this issue · comments

commented

Is there a special consideration for the absence of the GetID() function?

https://datatracker.ietf.org/doc/html/rfc7519#section-4.1.7

jwt/claims.go

Lines 9 to 16 in 8aa5d6c

type Claims interface {
GetExpirationTime() (*NumericDate, error)
GetIssuedAt() (*NumericDate, error)
GetNotBefore() (*NumericDate, error)
GetIssuer() (string, error)
GetSubject() (string, error)
GetAudience() (ClaimStrings, error)
}

That was probably an oversight on my part. The RegisteredClaims struct already has the appropriate field though.

Unfortunately, we cannot add anything to the interface without API breakage, meaning we need to reserve this for a potential v6.

I submitted #352 earlier today.