@@ -59,8 +59,8 @@ type Validator struct {
59
59
// []string will disable auds checking.
60
60
expectedAuds []string
61
61
62
- // expectedAudsMatchAll specifies whether all expected audiences must match all auds from claim
63
- expectedAudsMatchAll bool
62
+ // matchAllAud specifies whether all expected audiences must match all auds from claim
63
+ matchAllAud bool
64
64
65
65
// expectedIss contains the issuer this token expects. Supplying an empty
66
66
// string will disable iss checking.
@@ -134,10 +134,10 @@ func (v *Validator) Validate(claims Claims) error {
134
134
}
135
135
136
136
// If we have expected audiences, we also require the audiences claim
137
- if len (v .expectedAuds ) != 0 {
138
- if err := v .verifyAudiences (claims , v .expectedAuds , true , v .expectedAudsMatchAll ); err != nil {
139
- errs = append (errs , err )
140
- }
137
+ if len (v .expectedAuds ) > 0 {
138
+ if err := v .verifyAudiences (claims , v .expectedAuds , true , v .matchAllAud ); err != nil {
139
+ errs = append (errs , err )
140
+ }
141
141
}
142
142
143
143
// If we have an expected issuer, we also require the issuer claim
@@ -331,7 +331,7 @@ func (v *Validator) verifyAudiences(claims Claims, cmps []string, required bool,
331
331
332
332
matchFound := false
333
333
334
- // Label to break out of both loops if a match is found
334
+ // Label to break out of both loops if a match is found
335
335
outer:
336
336
337
337
// Check all aud values
0 commit comments