Skip to content

Commit c9ab96b

Browse files
authored
jwt: Fix Verify methods documentation (#83)
1 parent eac9e9e commit c9ab96b

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed

claims.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -63,14 +63,14 @@ func (c *StandardClaims) VerifyAudience(cmp string, req bool) bool {
6363
return verifyAud([]string{c.Audience}, cmp, req)
6464
}
6565

66-
// VerifyExpiresAt compares the exp claim against cmp.
67-
// If required is false, this method will return true if the value matches or is unset
66+
// VerifyExpiresAt compares the exp claim against cmp (cmp <= exp).
67+
// If req is false, it will return true, if exp is unset.
6868
func (c *StandardClaims) VerifyExpiresAt(cmp int64, req bool) bool {
6969
return verifyExp(c.ExpiresAt, cmp, req)
7070
}
7171

72-
// VerifyIssuedAt compares the iat claim against cmp.
73-
// If required is false, this method will return true if the value matches or is unset
72+
// VerifyIssuedAt compares the iat claim against cmp (cmp >= iat).
73+
// If req is false, it will return true, if iat is unset.
7474
func (c *StandardClaims) VerifyIssuedAt(cmp int64, req bool) bool {
7575
return verifyIat(c.IssuedAt, cmp, req)
7676
}
@@ -81,8 +81,8 @@ func (c *StandardClaims) VerifyIssuer(cmp string, req bool) bool {
8181
return verifyIss(c.Issuer, cmp, req)
8282
}
8383

84-
// VerifyNotBefore compares the nbf claim against cmp.
85-
// If required is false, this method will return true if the value matches or is unset
84+
// VerifyNotBefore compares the nbf claim against cmp (cmp >= nbf).
85+
// If req is false, it will return true, if nbf is unset.
8686
func (c *StandardClaims) VerifyNotBefore(cmp int64, req bool) bool {
8787
return verifyNbf(c.NotBefore, cmp, req)
8888
}

map_claims.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ func (m MapClaims) VerifyAudience(cmp string, req bool) bool {
3131
return verifyAud(aud, cmp, req)
3232
}
3333

34-
// VerifyExpiresAt compares the exp claim against cmp.
35-
// If required is false, this method will return true if the value matches or is unset
34+
// VerifyExpiresAt compares the exp claim against cmp (cmp <= exp).
35+
// If req is false, it will return true, if exp is unset.
3636
func (m MapClaims) VerifyExpiresAt(cmp int64, req bool) bool {
3737
exp, ok := m["exp"]
3838
if !ok {
@@ -48,8 +48,8 @@ func (m MapClaims) VerifyExpiresAt(cmp int64, req bool) bool {
4848
return false
4949
}
5050

51-
// VerifyIssuedAt compares the iat claim against cmp.
52-
// If required is false, this method will return true if the value matches or is unset
51+
// VerifyIssuedAt compares the exp claim against cmp (cmp >= iat).
52+
// If req is false, it will return true, if iat is unset.
5353
func (m MapClaims) VerifyIssuedAt(cmp int64, req bool) bool {
5454
iat, ok := m["iat"]
5555
if !ok {
@@ -72,8 +72,8 @@ func (m MapClaims) VerifyIssuer(cmp string, req bool) bool {
7272
return verifyIss(iss, cmp, req)
7373
}
7474

75-
// VerifyNotBefore compares the nbf claim against cmp.
76-
// If required is false, this method will return true if the value matches or is unset
75+
// VerifyNotBefore compares the nbf claim against cmp (cmp >= nbf).
76+
// If req is false, it will return true, if nbf is unset.
7777
func (m MapClaims) VerifyNotBefore(cmp int64, req bool) bool {
7878
nbf, ok := m["nbf"]
7979
if !ok {

0 commit comments

Comments
 (0)