Skip to content

Commit 43413ac

Browse files
committed
replaced interface{} to any in KeyFunc
1 parent 048854f commit 43413ac

File tree

2 files changed

+14
-14
lines changed

2 files changed

+14
-14
lines changed

parser_test.go

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -22,29 +22,29 @@ var (
2222
jwtTestEC256PublicKey crypto.PublicKey
2323
jwtTestEC256PrivateKey crypto.PrivateKey
2424
paddedKey crypto.PublicKey
25-
defaultKeyFunc jwt.Keyfunc = func(t *jwt.Token) (interface{}, error) { return jwtTestDefaultKey, nil }
26-
ecdsaKeyFunc jwt.Keyfunc = func(t *jwt.Token) (interface{}, error) { return jwtTestEC256PublicKey, nil }
27-
paddedKeyFunc jwt.Keyfunc = func(t *jwt.Token) (interface{}, error) { return paddedKey, nil }
28-
emptyKeyFunc jwt.Keyfunc = func(t *jwt.Token) (interface{}, error) { return nil, nil }
29-
errorKeyFunc jwt.Keyfunc = func(t *jwt.Token) (interface{}, error) { return nil, errKeyFuncError }
25+
defaultKeyFunc jwt.Keyfunc = func(t *jwt.Token) (any, error) { return jwtTestDefaultKey, nil }
26+
ecdsaKeyFunc jwt.Keyfunc = func(t *jwt.Token) (any, error) { return jwtTestEC256PublicKey, nil }
27+
paddedKeyFunc jwt.Keyfunc = func(t *jwt.Token) (any, error) { return paddedKey, nil }
28+
emptyKeyFunc jwt.Keyfunc = func(t *jwt.Token) (any, error) { return nil, nil }
29+
errorKeyFunc jwt.Keyfunc = func(t *jwt.Token) (any, error) { return nil, errKeyFuncError }
3030
nilKeyFunc jwt.Keyfunc = nil
31-
multipleZeroKeyFunc jwt.Keyfunc = func(t *jwt.Token) (interface{}, error) { return []interface{}{}, nil }
32-
multipleEmptyKeyFunc jwt.Keyfunc = func(t *jwt.Token) (interface{}, error) {
31+
multipleZeroKeyFunc jwt.Keyfunc = func(t *jwt.Token) (any, error) { return []interface{}{}, nil }
32+
multipleEmptyKeyFunc jwt.Keyfunc = func(t *jwt.Token) (any, error) {
3333
return jwt.VerificationKeySet{Keys: []jwt.VerificationKey{nil, nil}}, nil
3434
}
35-
multipleVerificationKeysFunc jwt.Keyfunc = func(t *jwt.Token) (interface{}, error) {
35+
multipleVerificationKeysFunc jwt.Keyfunc = func(t *jwt.Token) (any, error) {
3636
return []jwt.VerificationKey{jwtTestDefaultKey, jwtTestEC256PublicKey}, nil
3737
}
38-
multipleLastKeyFunc jwt.Keyfunc = func(t *jwt.Token) (interface{}, error) {
38+
multipleLastKeyFunc jwt.Keyfunc = func(t *jwt.Token) (any, error) {
3939
return jwt.VerificationKeySet{Keys: []jwt.VerificationKey{jwtTestEC256PublicKey, jwtTestDefaultKey}}, nil
4040
}
41-
multipleFirstKeyFunc jwt.Keyfunc = func(t *jwt.Token) (interface{}, error) {
41+
multipleFirstKeyFunc jwt.Keyfunc = func(t *jwt.Token) (any, error) {
4242
return jwt.VerificationKeySet{Keys: []jwt.VerificationKey{jwtTestDefaultKey, jwtTestEC256PublicKey}}, nil
4343
}
44-
multipleAltTypedKeyFunc jwt.Keyfunc = func(t *jwt.Token) (interface{}, error) {
44+
multipleAltTypedKeyFunc jwt.Keyfunc = func(t *jwt.Token) (any, error) {
4545
return jwt.VerificationKeySet{Keys: []jwt.VerificationKey{jwtTestDefaultKey, jwtTestDefaultKey}}, nil
4646
}
47-
emptyVerificationKeySetFunc jwt.Keyfunc = func(t *jwt.Token) (interface{}, error) {
47+
emptyVerificationKeySetFunc jwt.Keyfunc = func(t *jwt.Token) (any, error) {
4848
return jwt.VerificationKeySet{}, nil
4949
}
5050
)

token.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ import (
1111
// Token. This allows you to use properties in the Header of the token (such as
1212
// `kid`) to identify which key to use.
1313
//
14-
// The returned interface{} may be a single key or a VerificationKeySet containing
14+
// The returned any may be a single key or a VerificationKeySet containing
1515
// multiple keys.
16-
type Keyfunc func(*Token) (interface{}, error)
16+
type Keyfunc func(*Token) (any, error)
1717

1818
// VerificationKey represents a public or secret key for verifying a token's signature.
1919
type VerificationKey interface {

0 commit comments

Comments
 (0)