@@ -5,27 +5,23 @@ import (
5
5
"strings"
6
6
)
7
7
8
- // Error constants
9
8
var (
10
- ErrInvalidKey = errors .New ("key is invalid" )
11
- ErrInvalidKeyType = errors .New ("key is of invalid type" )
12
- ErrHashUnavailable = errors .New ("the requested hash function is unavailable" )
13
-
9
+ ErrInvalidKey = errors .New ("key is invalid" )
10
+ ErrInvalidKeyType = errors .New ("key is of invalid type" )
11
+ ErrHashUnavailable = errors .New ("the requested hash function is unavailable" )
14
12
ErrTokenMalformed = errors .New ("token is malformed" )
15
13
ErrTokenUnverifiable = errors .New ("token is unverifiable" )
16
- ErrTokenRequiredClaimMissing = errors .New ("a required claim is missing" )
17
14
ErrTokenSignatureInvalid = errors .New ("token signature is invalid" )
18
-
19
- ErrTokenInvalidAudience = errors .New ("token has invalid audience" )
20
- ErrTokenExpired = errors .New ("token is expired" )
21
- ErrTokenUsedBeforeIssued = errors .New ("token used before issued" )
22
- ErrTokenInvalidIssuer = errors .New ("token has invalid issuer" )
23
- ErrTokenInvalidSubject = errors .New ("token has invalid subject" )
24
- ErrTokenNotValidYet = errors .New ("token is not valid yet" )
25
- ErrTokenInvalidId = errors .New ("token has invalid id" )
26
- ErrTokenInvalidClaims = errors .New ("token has invalid claims" )
27
-
28
- ErrInvalidType = errors .New ("invalid type for claim" )
15
+ ErrTokenRequiredClaimMissing = errors .New ("token is missing required claim" )
16
+ ErrTokenInvalidAudience = errors .New ("token has invalid audience" )
17
+ ErrTokenExpired = errors .New ("token is expired" )
18
+ ErrTokenUsedBeforeIssued = errors .New ("token used before issued" )
19
+ ErrTokenInvalidIssuer = errors .New ("token has invalid issuer" )
20
+ ErrTokenInvalidSubject = errors .New ("token has invalid subject" )
21
+ ErrTokenNotValidYet = errors .New ("token is not valid yet" )
22
+ ErrTokenInvalidId = errors .New ("token has invalid id" )
23
+ ErrTokenInvalidClaims = errors .New ("token has invalid claims" )
24
+ ErrInvalidType = errors .New ("invalid type for claim" )
29
25
)
30
26
31
27
// joinedError is an error type that works similar to what [errors.Join]
@@ -46,7 +42,7 @@ func (je joinedError) Error() string {
46
42
47
43
// joinErrors joins together multiple errors. Useful for scenarios where
48
44
// multiple errors next to each other occur, e.g., in claims validation.
49
- func joinErrors (errs [] error ) error {
45
+ func joinErrors (errs ... error ) error {
50
46
return & joinedError {
51
47
errs : errs ,
52
48
}
0 commit comments