Skip to content

Commit c435f38

Browse files
authored
#129: Added VerifyIssuer method to RegisteredClaims (#130)
1 parent a725c1f commit c435f38

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

claims.go

+6
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,12 @@ func (c *RegisteredClaims) VerifyNotBefore(cmp time.Time, req bool) bool {
113113
return verifyNbf(&c.NotBefore.Time, cmp, req)
114114
}
115115

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

0 commit comments

Comments
 (0)