forked from orange-cloudfoundry/go-auth-pubtkt
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patherrors.go
More file actions
76 lines (60 loc) · 1.53 KB
/
Copy patherrors.go
File metadata and controls
76 lines (60 loc) · 1.53 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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
package pubtkt
type ErrNoTicket string
func NewErrNoTicket() error {
return ErrNoTicket("No ticket found")
}
func (e ErrNoTicket) Error() string {
return string(e)
}
type ErrNoSSl string
func NewErrNoSSl() error {
return ErrNoSSl("Request must be secured over https")
}
func (e ErrNoSSl) Error() string {
return string(e)
}
type ErrSigNotValid string
func NewErrSigNotValid(prevErrors ...error) error {
if len(prevErrors) == 0 {
return ErrSigNotValid("Signature not valid.")
}
return ErrSigNotValid("Signature not valid: " + prevErrors[0].Error())
}
func (e ErrSigNotValid) Error() string {
return string(e)
}
type ErrNoValidToken string
func NewErrNoValidToken() error {
return ErrNoValidToken("Ticket doesn't contains matching token.")
}
func (e ErrNoValidToken) Error() string {
return string(e)
}
type ErrWrongIp string
func NewErrWrongIp() error {
return ErrWrongIp("Client ip doesn't match with ip in ticket.")
}
func (e ErrWrongIp) Error() string {
return string(e)
}
type ErrValidationExpired string
func NewErrValidationExpired() error {
return ErrValidationExpired("Ticket validation expired.")
}
func (e ErrValidationExpired) Error() string {
return string(e)
}
type ErrGracePeriodExpired string
func NewErrGracePeriodExpired() error {
return ErrGracePeriodExpired("Ticket grace period expired.")
}
func (e ErrGracePeriodExpired) Error() string {
return string(e)
}
type ErrNoSig string
func NewErrNoSig() error {
return ErrNoSig("No signature found in ticket")
}
func (e ErrNoSig) Error() string {
return string(e)
}