Update dependencies (#5518)
This commit is contained in:
22
vendor/github.com/form3tech-oss/jwt-go/map_claims.go
generated
vendored
22
vendor/github.com/form3tech-oss/jwt-go/map_claims.go
generated
vendored
@@ -13,15 +13,23 @@ type MapClaims map[string]interface{}
|
||||
// Compares the aud claim against cmp.
|
||||
// If required is false, this method will return true if the value matches or is unset
|
||||
func (m MapClaims) VerifyAudience(cmp string, req bool) bool {
|
||||
aud, ok := m["aud"].([]string)
|
||||
if !ok {
|
||||
strAud, ok := m["aud"].(string)
|
||||
if !ok {
|
||||
return false
|
||||
var aud []string
|
||||
switch v := m["aud"].(type) {
|
||||
case []string:
|
||||
aud = v
|
||||
case []interface{}:
|
||||
for _, a := range v {
|
||||
vs, ok := a.(string)
|
||||
if !ok {
|
||||
return false
|
||||
}
|
||||
aud = append(aud, vs)
|
||||
}
|
||||
aud = append(aud, strAud)
|
||||
case string:
|
||||
aud = append(aud, v)
|
||||
default:
|
||||
return false
|
||||
}
|
||||
|
||||
return verifyAud(aud, cmp, req)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user