-
Notifications
You must be signed in to change notification settings - Fork 8
/
events_account.go
63 lines (50 loc) · 1.7 KB
/
events_account.go
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
package scalingo
import "fmt"
type EventLoginSuccessType struct {
Event
TypeData EventLoginSuccessTypeData `json:"type_data"`
}
type EventLoginSuccessTypeData EventSecurityTypeData
func (ev *EventLoginSuccessType) String() string {
return fmt.Sprintf("Successful login from %v", ev.TypeData.RemoteIP)
}
type EventLoginFailureType struct {
Event
TypeData EventLoginFailureTypeData `json:"type_data"`
}
type EventLoginFailureTypeData EventSecurityTypeData
func (ev *EventLoginFailureType) String() string {
return fmt.Sprintf("Failed login attempt from %v", ev.TypeData.RemoteIP)
}
type EventLoginLockType struct {
Event
TypeData EventLoginLockTypeData `json:"type_data"`
}
type EventLoginLockTypeData EventSecurityTypeData
func (ev *EventLoginLockType) String() string {
return "Account is locked"
}
type EventLoginUnlockSuccessType struct {
Event
TypeData EventLoginUnlockSuccessTypeData `json:"type_data"`
}
type EventLoginUnlockSuccessTypeData EventSecurityTypeData
func (ev *EventLoginUnlockSuccessType) String() string {
return fmt.Sprintf("Account unlocked from %v", ev.TypeData.RemoteIP)
}
type EventPasswordResetQueryType struct {
Event
TypeData EventPasswordResetQueryTypeData `json:"type_data"`
}
type EventPasswordResetQueryTypeData EventSecurityTypeData
func (ev *EventPasswordResetQueryType) String() string {
return fmt.Sprintf("Password reset process initiated from %v", ev.TypeData.RemoteIP)
}
type EventPasswordResetSuccessType struct {
Event
TypeData EventPasswordResetSuccessTypeData `json:"type_data"`
}
type EventPasswordResetSuccessTypeData EventSecurityTypeData
func (ev *EventPasswordResetSuccessType) String() string {
return fmt.Sprintf("Password changed from %v", ev.TypeData.RemoteIP)
}