forked from pydio/cells
-
Notifications
You must be signed in to change notification settings - Fork 0
/
zapfields.go
187 lines (160 loc) · 4.91 KB
/
zapfields.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
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
/*
* Copyright (c) 2018. Abstrium SAS <team (at) pydio.com>
* This file is part of Pydio Cells.
*
* Pydio Cells is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Pydio Cells is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with Pydio Cells. If not, see <http://www.gnu.org/licenses/>.
*
* The latest code can be found at <https://pydio.com>.
*/
package common
// Define string used as keys.
const (
KEY_MSG_ID = "MsgId"
KEY_TS = "Ts"
KEY_LEVEL = "Level"
KEY_LOGGER = "Logger"
KEY_MSG = "Msg"
)
// Known audit message IDs
const (
// Login
AUDIT_LOGIN_SUCCEED = "1"
AUDIT_LOGIN_FAILED = "2"
AUDIT_LOGIN_POLICY_DENIAL = "3"
AUDIT_INVALID_JWT = "4"
AUDIT_LOCK_USER = "5"
// Tree events
AUDIT_NODE_CREATE = "11"
AUDIT_NODE_READ = "12"
AUDIT_NODE_LIST = "13"
AUDIT_NODE_UPDATE = "14"
AUDIT_NODE_DELETE = "15"
AUDIT_WS_CREATE = "16"
AUDIT_WS_UPDATE = "17"
AUDIT_WS_DELETE = "18"
AUDIT_NODE_MOVED_TO_BIN = "19"
// S3 Objects
AUDIT_OBJECT_GET = "21"
AUDIT_OBJECT_PUT = "22"
// Users, Group, Roles
AUDIT_USER_CREATE = "41"
AUDIT_USER_READ = "42"
AUDIT_USER_UPDATE = "43"
AUDIT_USER_DELETE = "44"
AUDIT_GROUP_CREATE = "46"
AUDIT_GROUP_READ = "47"
AUDIT_GROUP_UPDATE = "48"
AUDIT_GROUP_DELETE = "49"
AUDIT_ROLE_CREATE = "51"
AUDIT_ROLE_READ = "52"
AUDIT_ROLE_UPDATE = "53"
AUDIT_ROLE_DELETE = "54"
// Policies
AUDIT_POLICY_GROUP_STORE = "61"
AUDIT_POLICY_GROUP_DELETE = "62"
AUDIT_POLICY_STORE = "63"
AUDIT_POLICY_DELETE = "64"
// ShareLinks And Cells
AUDIT_CELL_CREATE = "71"
AUDIT_CELL_READ = "72"
AUDIT_CELL_UPDATE = "73"
AUDIT_CELL_DELETE = "74"
AUDIT_LINK_CREATE = "75"
AUDIT_LINK_READ = "76"
AUDIT_LINK_UPDATE = "77"
AUDIT_LINK_DELETE = "78"
)
// Known audit message IDs
const (
KEY_CONTEXT = "Context"
// Follow a given request between the various services
KEY_SPAN_UUID = "SpanUuid"
KEY_SPAN_PARENT_UUID = "SpanParentUuid"
KEY_SPAN_ROOT_UUID = "SpanRootUuid"
// Group messages for a given high level operation
KEY_OPERATION_UUID = "OperationUuid"
KEY_OPERATION_LABEL = "OperationLabel"
KEY_NODE = "Node"
KEY_NODE_UUID = "NodeUuid"
KEY_NODE_PATH = "NodePath"
KEY_WORKSPACE = "Workspace"
KEY_WORKSPACE_UUID = "WorkspaceUuid"
KEY_WORKSPACE_SCOPE = "WorkspaceScope"
KEY_CHANGE_LOG = "ChangeLog"
KEY_NODE_CHANGE_EVENT = "NodeChangeEvent"
KEY_VERSIONING_POLICY = "VersioningPolicy"
KEY_ACTIVITY_SUBSCRIPTION = "ActivitySubscription"
KEY_ACTIVITY_STREAM_REQUEST = "StreamActivitiesRequest"
KEY_ACTIVITY_POST_EVENT = "PostActivityEvent"
KEY_ACTIVITY_OBJECT = "ActivityObject"
KEY_ROLE = "Role"
KEY_ROLE_UUID = "RoleUuid"
KEY_ROLES = "Roles"
KEY_PROFILE = "Profile"
KEY_USER = "User"
KEY_USERNAME = "UserName"
KEY_USER_UUID = "UserUuid"
KEY_GROUP_PATH = "GroupPath"
KEY_CONNECTOR = "Connector"
// Should be ACL and ACLID if we use proto names, changed to stay homogeneous with the other fields
KEY_ACL = "Acl"
KEY_ACL_ID = "AclId"
// Pydio internal merged representation of all ACLs that a user has access to
KEY_ACCESS_LIST = "AccessList"
KEY_POLICY_GROUP = "PolicyGroup"
KEY_POLICY_GROUP_UUID = "PolicyGroupUuid"
KEY_POLICY = "Policy"
KEY_POLICY_ID = "PolicyId"
KEY_POLICY_REQUEST = "PolicyRequest"
// Scheduler
KEY_JOB = "Job"
KEY_JOB_ID = "JobId"
KEY_ACTION = "Action"
KEY_ACTION_ID = "ActionId"
KEY_TASK = "Task"
KEY_TASK_ID = "TaskId"
// Cells
KEY_CELL = "Cell"
KEY_CELL_UUID = "CellUuid"
KEY_LINK = "ShareLink"
KEY_LINK_UUID = "ShareLinkUuid"
// Chat
KEY_CHAT_ROOM = "ChatRoom"
KEY_CHAT_LIST_ROOM_REQ = "ChatListRoomRequest"
KEY_CHAT_LIST_MSG_REQ = "ChatListMsgRequest"
KEY_CHAT_POST_MSG_REQ = "ChatPostMsgRequest"
)
// Keys for the front end
const (
KEY_FRONT_IP = "FrontIp"
KEY_FRONT_USERID = "UserId"
KEY_FRONT_WKSID = "WorkspaceId"
KEY_FRONT_SOURCE = "Source"
KEY_FRONT_PREFIX = "Prefix"
KEY_FRONT_MESSAGE = "Message"
KEY_FRONT_NODES = "Nodes"
)
var (
LogEventLabels = map[string]string{
AUDIT_LOGIN_SUCCEED: "Login succeed",
AUDIT_LOGIN_FAILED: "Login failed",
AUDIT_NODE_CREATE: "Create Node",
AUDIT_NODE_READ: "Read Node",
AUDIT_NODE_LIST: "List Node",
AUDIT_NODE_UPDATE: "Upadate Node",
AUDIT_NODE_DELETE: "Delete Node",
AUDIT_OBJECT_GET: "Get Object",
AUDIT_OBJECT_PUT: "Put Object",
}
)