forked from mirror/jwt
jwt: Fix Verify methods documentation (#83)
This commit is contained in:
parent
eac9e9edf2
commit
c9ab96ba53
12
claims.go
12
claims.go
|
@ -63,14 +63,14 @@ func (c *StandardClaims) VerifyAudience(cmp string, req bool) bool {
|
|||
return verifyAud([]string{c.Audience}, cmp, req)
|
||||
}
|
||||
|
||||
// VerifyExpiresAt compares the exp claim against cmp.
|
||||
// If required is false, this method will return true if the value matches or is unset
|
||||
// VerifyExpiresAt compares the exp claim against cmp (cmp <= exp).
|
||||
// If req is false, it will return true, if exp is unset.
|
||||
func (c *StandardClaims) VerifyExpiresAt(cmp int64, req bool) bool {
|
||||
return verifyExp(c.ExpiresAt, cmp, req)
|
||||
}
|
||||
|
||||
// VerifyIssuedAt compares the iat claim against cmp.
|
||||
// If required is false, this method will return true if the value matches or is unset
|
||||
// VerifyIssuedAt compares the iat claim against cmp (cmp >= iat).
|
||||
// If req is false, it will return true, if iat is unset.
|
||||
func (c *StandardClaims) VerifyIssuedAt(cmp int64, req bool) bool {
|
||||
return verifyIat(c.IssuedAt, cmp, req)
|
||||
}
|
||||
|
@ -81,8 +81,8 @@ func (c *StandardClaims) VerifyIssuer(cmp string, req bool) bool {
|
|||
return verifyIss(c.Issuer, cmp, req)
|
||||
}
|
||||
|
||||
// VerifyNotBefore compares the nbf claim against cmp.
|
||||
// If required is false, this method will return true if the value matches or is unset
|
||||
// VerifyNotBefore compares the nbf claim against cmp (cmp >= nbf).
|
||||
// If req is false, it will return true, if nbf is unset.
|
||||
func (c *StandardClaims) VerifyNotBefore(cmp int64, req bool) bool {
|
||||
return verifyNbf(c.NotBefore, cmp, req)
|
||||
}
|
||||
|
|
|
@ -31,8 +31,8 @@ func (m MapClaims) VerifyAudience(cmp string, req bool) bool {
|
|||
return verifyAud(aud, cmp, req)
|
||||
}
|
||||
|
||||
// VerifyExpiresAt compares the exp claim against cmp.
|
||||
// If required is false, this method will return true if the value matches or is unset
|
||||
// VerifyExpiresAt compares the exp claim against cmp (cmp <= exp).
|
||||
// If req is false, it will return true, if exp is unset.
|
||||
func (m MapClaims) VerifyExpiresAt(cmp int64, req bool) bool {
|
||||
exp, ok := m["exp"]
|
||||
if !ok {
|
||||
|
@ -48,8 +48,8 @@ func (m MapClaims) VerifyExpiresAt(cmp int64, req bool) bool {
|
|||
return false
|
||||
}
|
||||
|
||||
// VerifyIssuedAt compares the iat claim against cmp.
|
||||
// If required is false, this method will return true if the value matches or is unset
|
||||
// VerifyIssuedAt compares the exp claim against cmp (cmp >= iat).
|
||||
// If req is false, it will return true, if iat is unset.
|
||||
func (m MapClaims) VerifyIssuedAt(cmp int64, req bool) bool {
|
||||
iat, ok := m["iat"]
|
||||
if !ok {
|
||||
|
@ -72,8 +72,8 @@ func (m MapClaims) VerifyIssuer(cmp string, req bool) bool {
|
|||
return verifyIss(iss, cmp, req)
|
||||
}
|
||||
|
||||
// VerifyNotBefore compares the nbf claim against cmp.
|
||||
// If required is false, this method will return true if the value matches or is unset
|
||||
// VerifyNotBefore compares the nbf claim against cmp (cmp >= nbf).
|
||||
// If req is false, it will return true, if nbf is unset.
|
||||
func (m MapClaims) VerifyNotBefore(cmp int64, req bool) bool {
|
||||
nbf, ok := m["nbf"]
|
||||
if !ok {
|
||||
|
|
Loading…
Reference in New Issue