-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patherrors.go
More file actions
53 lines (36 loc) · 2.17 KB
/
errors.go
File metadata and controls
53 lines (36 loc) · 2.17 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
package keysmith
import "errors"
var (
// ErrInvalidKey is returned when the provided API key is not valid.
ErrInvalidKey = errors.New("keysmith: invalid API key")
// ErrKeyInactive is returned when the key is not in an active state.
ErrKeyInactive = errors.New("keysmith: key is not active")
// ErrKeyExpired is returned when the key has expired.
ErrKeyExpired = errors.New("keysmith: key has expired")
// ErrKeyRevoked is returned when the key has been permanently revoked.
ErrKeyRevoked = errors.New("keysmith: key has been revoked")
// ErrKeySuspended is returned when the key is temporarily suspended.
ErrKeySuspended = errors.New("keysmith: key is suspended")
// ErrRateLimited is returned when the key exceeds its rate limit.
ErrRateLimited = errors.New("keysmith: rate limit exceeded")
// ErrQuotaExceeded is returned when the key exceeds its usage quota.
ErrQuotaExceeded = errors.New("keysmith: usage quota exceeded")
// ErrInvalidStateTransition is returned for illegal key state changes.
ErrInvalidStateTransition = errors.New("keysmith: invalid state transition")
// ErrPolicyInUse is returned when deleting a policy assigned to active keys.
ErrPolicyInUse = errors.New("keysmith: policy is assigned to active keys")
// ErrPolicyNotFound is returned when a policy cannot be found.
ErrPolicyNotFound = errors.New("keysmith: policy not found")
// ErrKeyNotFound is returned when a key cannot be found.
ErrKeyNotFound = errors.New("keysmith: key not found")
// ErrScopeNotFound is returned when a scope cannot be found.
ErrScopeNotFound = errors.New("keysmith: scope not found")
// ErrScopeNotAllowed is returned when a scope is not permitted by the policy.
ErrScopeNotAllowed = errors.New("keysmith: scope not allowed by policy")
// ErrIPNotAllowed is returned when the IP address is not in the allowlist.
ErrIPNotAllowed = errors.New("keysmith: IP address not allowed")
// ErrOriginNotAllowed is returned when the origin is not in the allowlist.
ErrOriginNotAllowed = errors.New("keysmith: origin not allowed")
// ErrRotationNotFound is returned when a rotation record cannot be found.
ErrRotationNotFound = errors.New("keysmith: rotation record not found")
)