#129: Added VerifyIssuer method to RegisteredClaims (#130)

This commit is contained in:
tfonfara 2021-11-24 14:27:41 +01:00 committed by GitHub
parent a725c1f60c
commit c435f38291
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 0 deletions

View File

@ -113,6 +113,12 @@ func (c *RegisteredClaims) VerifyNotBefore(cmp time.Time, req bool) bool {
return verifyNbf(&c.NotBefore.Time, cmp, req) return verifyNbf(&c.NotBefore.Time, cmp, req)
} }
// VerifyIssuer compares the iss claim against cmp.
// If required is false, this method will return true if the value matches or is unset
func (c *RegisteredClaims) VerifyIssuer(cmp string, req bool) bool {
return verifyIss(c.Issuer, cmp, req)
}
// StandardClaims are a structured version of the JWT Claims Set, as referenced at // StandardClaims are a structured version of the JWT Claims Set, as referenced at
// https://datatracker.ietf.org/doc/html/rfc7519#section-4. They do not follow the // https://datatracker.ietf.org/doc/html/rfc7519#section-4. They do not follow the
// specification exactly, since they were based on an earlier draft of the // specification exactly, since they were based on an earlier draft of the