-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtypes_audit_event.go
128 lines (108 loc) · 4.73 KB
/
types_audit_event.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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
package streamer
import (
"time"
"gorm.io/datatypes"
)
type With string
const (
Saml With = "saml"
TwoFactor With = "two-factor"
TwoFactorViaWebauthnDevice With = "two-factor-via-webauthn-device"
)
type AuditEvent struct {
ID uint64 `gorm:"primary_key" json:"-"`
CorrelationID string `gorm:"type:varchar(64)" json:"correlation_id"`
Severity string `json:"severity"`
Time time.Time `json:"time"`
AuthorID int64 `json:"author_id"`
AuthorName string `json:"author_name"`
EntityID int64 `json:"entity_id"`
EntityType AuthorClass `json:"entity_type"`
IPAddress string `json:"ip_address"`
With *With `json:"with,omitempty"`
TargetID *int64 `json:"target_id"`
TargetType AuthorClass `json:"target_type"`
TargetDetails *string `json:"target_details"`
EntityPath string `json:"entity_path"`
Remove *Add `json:"remove,omitempty"`
Add *Add `json:"add,omitempty"`
// Details *Details `json:"details,omitempty"`
// PushAccessLevels []MergeAccessLevelElement `json:"push_access_levels,omitempty"`
// MergeAccessLevels []MergeAccessLevelElement `json:"merge_access_levels,omitempty"`
AllowForcePush *bool `json:"allow_force_push,omitempty"`
CodeOwnerApprovalRequired *bool `json:"code_owner_approval_required,omitempty"`
AuthorClass *AuthorClass `json:"author_class,omitempty"`
CustomMessage *string `json:"custom_message,omitempty"`
As *As `json:"as,omitempty"`
MemberID *int64 `json:"member_id,omitempty"`
Change *Change `json:"change,omitempty"`
From *string `json:"from,omitempty"`
To *string `json:"to,omitempty"`
Action *string `json:"action,omitempty"`
ExpiryFrom *string `json:"expiry_from"`
ExpiryTo *string `json:"expiry_to"`
MetaCallerID string `json:"meta.caller_id"`
MetaRemoteIP string `json:"meta.remote_ip"`
MetaFeatureCategory string `json:"meta.feature_category"`
MetaClientID string `json:"meta.client_id"`
MetaUser string `json:"meta.user,omitempty"`
MetaUserID int `json:"meta.user_id,omitempty"`
OriginalData datatypes.JSON
}
// type Details struct {
// // PushAccessLevels []MergeAccessLevelElement `json:"push_access_levels,omitempty"`
// // MergeAccessLevels []MergeAccessLevelElement `json:"merge_access_levels,omitempty"`
// AllowForcePush *bool `json:"allow_force_push,omitempty"`
// CodeOwnerApprovalRequired *bool `json:"code_owner_approval_required,omitempty"`
// AuthorName string `json:"author_name"`
// AuthorClass AuthorClass `json:"author_class"`
// TargetID int64 `json:"target_id"`
// TargetType AuthorClass `json:"target_type"`
// TargetDetails string `json:"target_details"`
// CustomMessage string `json:"custom_message"`
// IPAddress string `json:"ip_address"`
// EntityPath string `json:"entity_path"`
// Change *Change `json:"change,omitempty"`
// From *string `json:"from,omitempty"`
// To *string `json:"to,omitempty"`
// Action *string `json:"action,omitempty"`
// Add *Add `json:"add,omitempty"`
// }
type Add string
const (
CiGroupVariable Add = "ci_group_variable"
Email Add = "email"
Group Add = "group"
Project Add = "project"
User Add = "user"
UserAccess Add = "user_access"
)
type As string
const (
Developer As = "Developer"
Guest As = "Guest"
Owner As = "Owner"
)
type AuthorClass string
const (
AuthorClassCiGroupVariable AuthorClass = "Ci::GroupVariable"
AuthorClassEmail AuthorClass = "Email"
AuthorClassGroup AuthorClass = "Group"
AuthorClassProject AuthorClass = "Project"
AuthorClassUser AuthorClass = "User"
CiRunner AuthorClass = "Ci::Runner"
PersonalAccessToken AuthorClass = "PersonalAccessToken"
ProtectedBranch AuthorClass = "ProtectedBranch"
)
type Change string
const (
AccessLevel Change = "access_level"
AllowedToPush Change = "allowed to push"
EmailAddress Change = "email address"
Name Change = "name"
)
type MergeAccessLevelElement string
const (
Maintainers MergeAccessLevelElement = "Maintainers"
)
type Severity string