@oneuptime/common 10.0.31 → 10.0.33
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Models/AnalyticsModels/ExceptionInstance.ts +29 -4
- package/Models/AnalyticsModels/Log.ts +110 -4
- package/Models/AnalyticsModels/Metric.ts +16 -9
- package/Models/AnalyticsModels/MonitorLog.ts +4 -2
- package/Models/AnalyticsModels/Span.ts +79 -6
- package/Models/DatabaseModels/Index.ts +8 -0
- package/Models/DatabaseModels/LogDropFilter.ts +480 -0
- package/Models/DatabaseModels/LogPipeline.ts +412 -0
- package/Models/DatabaseModels/LogPipelineProcessor.ts +430 -0
- package/Models/DatabaseModels/LogScrubRule.ts +516 -0
- package/Server/API/TelemetryAPI.ts +261 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1773402621107-MigrationName.ts +131 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1773414578773-MigrationName.ts +79 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1773500000000-MigrationName.ts +41 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1773676206197-MigrationName.ts +57 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/Index.ts +4 -0
- package/Server/Services/AnalyticsDatabaseService.ts +61 -0
- package/Server/Services/LogAggregationService.ts +238 -1
- package/Server/Services/LogDropFilterService.ts +10 -0
- package/Server/Services/LogPipelineProcessorService.ts +10 -0
- package/Server/Services/LogPipelineService.ts +10 -0
- package/Server/Services/LogScrubRuleService.ts +10 -0
- package/Server/Services/TelemetryAttributeService.ts +4 -6
- package/Server/Utils/AnalyticsDatabase/Statement.ts +15 -1
- package/Server/Utils/AnalyticsDatabase/StatementGenerator.ts +126 -11
- package/Tests/Server/Services/LogAggregationService.test.ts +3 -2
- package/Types/AnalyticsDatabase/AnalyticsTableName.ts +9 -0
- package/Types/AnalyticsDatabase/TableColumnType.ts +4 -0
- package/Types/Date.ts +22 -0
- package/Types/Log/LogDropFilterAction.ts +6 -0
- package/Types/Log/LogPipelineProcessorType.ts +44 -0
- package/Types/Log/LogScrubAction.ts +7 -0
- package/Types/Log/LogScrubPatternType.ts +10 -0
- package/Types/Permission.ts +174 -0
- package/UI/Components/LogsViewer/LogsViewer.tsx +152 -4
- package/UI/Components/LogsViewer/components/KeyboardShortcutsHelp.tsx +92 -0
- package/UI/Components/LogsViewer/components/LogDetailsPanel.tsx +332 -117
- package/UI/Components/LogsViewer/components/LogSearchBar.tsx +294 -274
- package/UI/Components/LogsViewer/components/LogsAnalyticsView.tsx +513 -234
- package/UI/Components/LogsViewer/components/LogsFilterCard.tsx +37 -29
- package/UI/Components/LogsViewer/components/LogsTable.tsx +6 -1
- package/UI/Components/LogsViewer/components/LogsViewerToolbar.tsx +106 -0
- package/UI/Utils/LogExport.ts +160 -0
- package/build/dist/Models/AnalyticsModels/ExceptionInstance.js +28 -4
- package/build/dist/Models/AnalyticsModels/ExceptionInstance.js.map +1 -1
- package/build/dist/Models/AnalyticsModels/Log.js +97 -4
- package/build/dist/Models/AnalyticsModels/Log.js.map +1 -1
- package/build/dist/Models/AnalyticsModels/Metric.js +16 -9
- package/build/dist/Models/AnalyticsModels/Metric.js.map +1 -1
- package/build/dist/Models/AnalyticsModels/MonitorLog.js +4 -2
- package/build/dist/Models/AnalyticsModels/MonitorLog.js.map +1 -1
- package/build/dist/Models/AnalyticsModels/Span.js +73 -6
- package/build/dist/Models/AnalyticsModels/Span.js.map +1 -1
- package/build/dist/Models/DatabaseModels/Index.js +8 -0
- package/build/dist/Models/DatabaseModels/Index.js.map +1 -1
- package/build/dist/Models/DatabaseModels/LogDropFilter.js +508 -0
- package/build/dist/Models/DatabaseModels/LogDropFilter.js.map +1 -0
- package/build/dist/Models/DatabaseModels/LogPipeline.js +438 -0
- package/build/dist/Models/DatabaseModels/LogPipeline.js.map +1 -0
- package/build/dist/Models/DatabaseModels/LogPipelineProcessor.js +452 -0
- package/build/dist/Models/DatabaseModels/LogPipelineProcessor.js.map +1 -0
- package/build/dist/Models/DatabaseModels/LogScrubRule.js +545 -0
- package/build/dist/Models/DatabaseModels/LogScrubRule.js.map +1 -0
- package/build/dist/Server/API/TelemetryAPI.js +155 -0
- package/build/dist/Server/API/TelemetryAPI.js.map +1 -1
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1773402621107-MigrationName.js +52 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1773402621107-MigrationName.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1773414578773-MigrationName.js +34 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1773414578773-MigrationName.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1773500000000-MigrationName.js +22 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1773500000000-MigrationName.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1773676206197-MigrationName.js +26 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1773676206197-MigrationName.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/Index.js +4 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/Index.js.map +1 -1
- package/build/dist/Server/Services/AnalyticsDatabaseService.js +30 -0
- package/build/dist/Server/Services/AnalyticsDatabaseService.js.map +1 -1
- package/build/dist/Server/Services/LogAggregationService.js +188 -1
- package/build/dist/Server/Services/LogAggregationService.js.map +1 -1
- package/build/dist/Server/Services/LogDropFilterService.js +9 -0
- package/build/dist/Server/Services/LogDropFilterService.js.map +1 -0
- package/build/dist/Server/Services/LogPipelineProcessorService.js +9 -0
- package/build/dist/Server/Services/LogPipelineProcessorService.js.map +1 -0
- package/build/dist/Server/Services/LogPipelineService.js +9 -0
- package/build/dist/Server/Services/LogPipelineService.js.map +1 -0
- package/build/dist/Server/Services/LogScrubRuleService.js +9 -0
- package/build/dist/Server/Services/LogScrubRuleService.js.map +1 -0
- package/build/dist/Server/Services/TelemetryAttributeService.js +4 -6
- package/build/dist/Server/Services/TelemetryAttributeService.js.map +1 -1
- package/build/dist/Server/Utils/AnalyticsDatabase/Statement.js +13 -1
- package/build/dist/Server/Utils/AnalyticsDatabase/Statement.js.map +1 -1
- package/build/dist/Server/Utils/AnalyticsDatabase/StatementGenerator.js +89 -2
- package/build/dist/Server/Utils/AnalyticsDatabase/StatementGenerator.js.map +1 -1
- package/build/dist/Tests/Server/Services/LogAggregationService.test.js +3 -2
- package/build/dist/Tests/Server/Services/LogAggregationService.test.js.map +1 -1
- package/build/dist/Types/AnalyticsDatabase/AnalyticsTableName.js +10 -0
- package/build/dist/Types/AnalyticsDatabase/AnalyticsTableName.js.map +1 -0
- package/build/dist/Types/AnalyticsDatabase/TableColumnType.js +4 -0
- package/build/dist/Types/AnalyticsDatabase/TableColumnType.js.map +1 -1
- package/build/dist/Types/Date.js +16 -0
- package/build/dist/Types/Date.js.map +1 -1
- package/build/dist/Types/Log/LogDropFilterAction.js +7 -0
- package/build/dist/Types/Log/LogDropFilterAction.js.map +1 -0
- package/build/dist/Types/Log/LogPipelineProcessorType.js +9 -0
- package/build/dist/Types/Log/LogPipelineProcessorType.js.map +1 -0
- package/build/dist/Types/Log/LogScrubAction.js +8 -0
- package/build/dist/Types/Log/LogScrubAction.js.map +1 -0
- package/build/dist/Types/Log/LogScrubPatternType.js +11 -0
- package/build/dist/Types/Log/LogScrubPatternType.js.map +1 -0
- package/build/dist/Types/Permission.js +152 -0
- package/build/dist/Types/Permission.js.map +1 -1
- package/build/dist/UI/Components/LogsViewer/LogsViewer.js +124 -11
- package/build/dist/UI/Components/LogsViewer/LogsViewer.js.map +1 -1
- package/build/dist/UI/Components/LogsViewer/components/KeyboardShortcutsHelp.js +36 -0
- package/build/dist/UI/Components/LogsViewer/components/KeyboardShortcutsHelp.js.map +1 -0
- package/build/dist/UI/Components/LogsViewer/components/LogDetailsPanel.js +114 -4
- package/build/dist/UI/Components/LogsViewer/components/LogDetailsPanel.js.map +1 -1
- package/build/dist/UI/Components/LogsViewer/components/LogSearchBar.js +17 -5
- package/build/dist/UI/Components/LogsViewer/components/LogSearchBar.js.map +1 -1
- package/build/dist/UI/Components/LogsViewer/components/LogsAnalyticsView.js +229 -122
- package/build/dist/UI/Components/LogsViewer/components/LogsAnalyticsView.js.map +1 -1
- package/build/dist/UI/Components/LogsViewer/components/LogsFilterCard.js +5 -4
- package/build/dist/UI/Components/LogsViewer/components/LogsFilterCard.js.map +1 -1
- package/build/dist/UI/Components/LogsViewer/components/LogsTable.js +4 -1
- package/build/dist/UI/Components/LogsViewer/components/LogsTable.js.map +1 -1
- package/build/dist/UI/Components/LogsViewer/components/LogsViewerToolbar.js +28 -0
- package/build/dist/UI/Components/LogsViewer/components/LogsViewerToolbar.js.map +1 -1
- package/build/dist/UI/Utils/LogExport.js +129 -0
- package/build/dist/UI/Utils/LogExport.js.map +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,516 @@
|
|
|
1
|
+
import Project from "./Project";
|
|
2
|
+
import User from "./User";
|
|
3
|
+
import BaseModel from "./DatabaseBaseModel/DatabaseBaseModel";
|
|
4
|
+
import Route from "../../Types/API/Route";
|
|
5
|
+
import ColumnAccessControl from "../../Types/Database/AccessControl/ColumnAccessControl";
|
|
6
|
+
import TableAccessControl from "../../Types/Database/AccessControl/TableAccessControl";
|
|
7
|
+
import TableBillingAccessControl from "../../Types/Database/AccessControl/TableBillingAccessControl";
|
|
8
|
+
import ColumnLength from "../../Types/Database/ColumnLength";
|
|
9
|
+
import ColumnType from "../../Types/Database/ColumnType";
|
|
10
|
+
import CrudApiEndpoint from "../../Types/Database/CrudApiEndpoint";
|
|
11
|
+
import EnableDocumentation from "../../Types/Database/EnableDocumentation";
|
|
12
|
+
import TableColumn from "../../Types/Database/TableColumn";
|
|
13
|
+
import TableColumnType from "../../Types/Database/TableColumnType";
|
|
14
|
+
import TableMetadata from "../../Types/Database/TableMetadata";
|
|
15
|
+
import TenantColumn from "../../Types/Database/TenantColumn";
|
|
16
|
+
import IconProp from "../../Types/Icon/IconProp";
|
|
17
|
+
import ObjectID from "../../Types/ObjectID";
|
|
18
|
+
import Permission from "../../Types/Permission";
|
|
19
|
+
import { PlanType } from "../../Types/Billing/SubscriptionPlan";
|
|
20
|
+
import { Column, Entity, Index, JoinColumn, ManyToOne } from "typeorm";
|
|
21
|
+
|
|
22
|
+
@EnableDocumentation()
|
|
23
|
+
@TableBillingAccessControl({
|
|
24
|
+
create: PlanType.Free,
|
|
25
|
+
read: PlanType.Free,
|
|
26
|
+
update: PlanType.Free,
|
|
27
|
+
delete: PlanType.Free,
|
|
28
|
+
})
|
|
29
|
+
@TenantColumn("projectId")
|
|
30
|
+
@CrudApiEndpoint(new Route("/log-scrub-rule"))
|
|
31
|
+
@Entity({
|
|
32
|
+
name: "LogScrubRule",
|
|
33
|
+
})
|
|
34
|
+
@TableMetadata({
|
|
35
|
+
tableName: "LogScrubRule",
|
|
36
|
+
singularName: "Log Scrub Rule",
|
|
37
|
+
pluralName: "Log Scrub Rules",
|
|
38
|
+
icon: IconProp.ShieldCheck,
|
|
39
|
+
tableDescription:
|
|
40
|
+
"Configure rules to automatically detect and scrub sensitive data (PII) from logs at ingest time.",
|
|
41
|
+
})
|
|
42
|
+
@TableAccessControl({
|
|
43
|
+
create: [
|
|
44
|
+
Permission.ProjectOwner,
|
|
45
|
+
Permission.ProjectAdmin,
|
|
46
|
+
Permission.CreateProjectLogScrubRule,
|
|
47
|
+
],
|
|
48
|
+
read: [
|
|
49
|
+
Permission.ProjectOwner,
|
|
50
|
+
Permission.ProjectAdmin,
|
|
51
|
+
Permission.ProjectMember,
|
|
52
|
+
Permission.ReadProjectLogScrubRule,
|
|
53
|
+
Permission.ReadAllProjectResources,
|
|
54
|
+
],
|
|
55
|
+
delete: [
|
|
56
|
+
Permission.ProjectOwner,
|
|
57
|
+
Permission.ProjectAdmin,
|
|
58
|
+
Permission.DeleteProjectLogScrubRule,
|
|
59
|
+
],
|
|
60
|
+
update: [
|
|
61
|
+
Permission.ProjectOwner,
|
|
62
|
+
Permission.ProjectAdmin,
|
|
63
|
+
Permission.EditProjectLogScrubRule,
|
|
64
|
+
],
|
|
65
|
+
})
|
|
66
|
+
export default class LogScrubRule extends BaseModel {
|
|
67
|
+
@ColumnAccessControl({
|
|
68
|
+
create: [
|
|
69
|
+
Permission.ProjectOwner,
|
|
70
|
+
Permission.ProjectAdmin,
|
|
71
|
+
Permission.CreateProjectLogScrubRule,
|
|
72
|
+
],
|
|
73
|
+
read: [
|
|
74
|
+
Permission.ProjectOwner,
|
|
75
|
+
Permission.ProjectAdmin,
|
|
76
|
+
Permission.ProjectMember,
|
|
77
|
+
Permission.ReadProjectLogScrubRule,
|
|
78
|
+
Permission.ReadAllProjectResources,
|
|
79
|
+
],
|
|
80
|
+
update: [],
|
|
81
|
+
})
|
|
82
|
+
@TableColumn({
|
|
83
|
+
manyToOneRelationColumn: "projectId",
|
|
84
|
+
type: TableColumnType.Entity,
|
|
85
|
+
modelType: Project,
|
|
86
|
+
title: "Project",
|
|
87
|
+
description: "Relation to the project this log scrub rule belongs to.",
|
|
88
|
+
})
|
|
89
|
+
@ManyToOne(
|
|
90
|
+
() => {
|
|
91
|
+
return Project;
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
eager: false,
|
|
95
|
+
nullable: true,
|
|
96
|
+
onDelete: "CASCADE",
|
|
97
|
+
orphanedRowAction: "nullify",
|
|
98
|
+
},
|
|
99
|
+
)
|
|
100
|
+
@JoinColumn({ name: "projectId" })
|
|
101
|
+
public project?: Project = undefined;
|
|
102
|
+
|
|
103
|
+
@ColumnAccessControl({
|
|
104
|
+
create: [
|
|
105
|
+
Permission.ProjectOwner,
|
|
106
|
+
Permission.ProjectAdmin,
|
|
107
|
+
Permission.CreateProjectLogScrubRule,
|
|
108
|
+
],
|
|
109
|
+
read: [
|
|
110
|
+
Permission.ProjectOwner,
|
|
111
|
+
Permission.ProjectAdmin,
|
|
112
|
+
Permission.ProjectMember,
|
|
113
|
+
Permission.ReadProjectLogScrubRule,
|
|
114
|
+
Permission.ReadAllProjectResources,
|
|
115
|
+
],
|
|
116
|
+
update: [],
|
|
117
|
+
})
|
|
118
|
+
@Index()
|
|
119
|
+
@TableColumn({
|
|
120
|
+
type: TableColumnType.ObjectID,
|
|
121
|
+
required: true,
|
|
122
|
+
canReadOnRelationQuery: true,
|
|
123
|
+
title: "Project ID",
|
|
124
|
+
description: "ID of the project this log scrub rule belongs to.",
|
|
125
|
+
})
|
|
126
|
+
@Column({
|
|
127
|
+
type: ColumnType.ObjectID,
|
|
128
|
+
nullable: false,
|
|
129
|
+
transformer: ObjectID.getDatabaseTransformer(),
|
|
130
|
+
})
|
|
131
|
+
public projectId?: ObjectID = undefined;
|
|
132
|
+
|
|
133
|
+
@ColumnAccessControl({
|
|
134
|
+
create: [
|
|
135
|
+
Permission.ProjectOwner,
|
|
136
|
+
Permission.ProjectAdmin,
|
|
137
|
+
Permission.CreateProjectLogScrubRule,
|
|
138
|
+
],
|
|
139
|
+
read: [
|
|
140
|
+
Permission.ProjectOwner,
|
|
141
|
+
Permission.ProjectAdmin,
|
|
142
|
+
Permission.ProjectMember,
|
|
143
|
+
Permission.ReadProjectLogScrubRule,
|
|
144
|
+
Permission.ReadAllProjectResources,
|
|
145
|
+
],
|
|
146
|
+
update: [
|
|
147
|
+
Permission.ProjectOwner,
|
|
148
|
+
Permission.ProjectAdmin,
|
|
149
|
+
Permission.EditProjectLogScrubRule,
|
|
150
|
+
],
|
|
151
|
+
})
|
|
152
|
+
@TableColumn({
|
|
153
|
+
required: true,
|
|
154
|
+
type: TableColumnType.Name,
|
|
155
|
+
canReadOnRelationQuery: true,
|
|
156
|
+
title: "Name",
|
|
157
|
+
description: "Friendly name for this scrub rule.",
|
|
158
|
+
})
|
|
159
|
+
@Column({
|
|
160
|
+
nullable: false,
|
|
161
|
+
type: ColumnType.Name,
|
|
162
|
+
length: ColumnLength.Name,
|
|
163
|
+
})
|
|
164
|
+
public name?: string = undefined;
|
|
165
|
+
|
|
166
|
+
@ColumnAccessControl({
|
|
167
|
+
create: [
|
|
168
|
+
Permission.ProjectOwner,
|
|
169
|
+
Permission.ProjectAdmin,
|
|
170
|
+
Permission.CreateProjectLogScrubRule,
|
|
171
|
+
],
|
|
172
|
+
read: [
|
|
173
|
+
Permission.ProjectOwner,
|
|
174
|
+
Permission.ProjectAdmin,
|
|
175
|
+
Permission.ProjectMember,
|
|
176
|
+
Permission.ReadProjectLogScrubRule,
|
|
177
|
+
Permission.ReadAllProjectResources,
|
|
178
|
+
],
|
|
179
|
+
update: [
|
|
180
|
+
Permission.ProjectOwner,
|
|
181
|
+
Permission.ProjectAdmin,
|
|
182
|
+
Permission.EditProjectLogScrubRule,
|
|
183
|
+
],
|
|
184
|
+
})
|
|
185
|
+
@TableColumn({
|
|
186
|
+
required: false,
|
|
187
|
+
type: TableColumnType.LongText,
|
|
188
|
+
canReadOnRelationQuery: true,
|
|
189
|
+
title: "Description",
|
|
190
|
+
description: "Description of what this scrub rule does.",
|
|
191
|
+
})
|
|
192
|
+
@Column({
|
|
193
|
+
nullable: true,
|
|
194
|
+
type: ColumnType.LongText,
|
|
195
|
+
length: ColumnLength.LongText,
|
|
196
|
+
})
|
|
197
|
+
public description?: string = undefined;
|
|
198
|
+
|
|
199
|
+
@ColumnAccessControl({
|
|
200
|
+
create: [
|
|
201
|
+
Permission.ProjectOwner,
|
|
202
|
+
Permission.ProjectAdmin,
|
|
203
|
+
Permission.CreateProjectLogScrubRule,
|
|
204
|
+
],
|
|
205
|
+
read: [
|
|
206
|
+
Permission.ProjectOwner,
|
|
207
|
+
Permission.ProjectAdmin,
|
|
208
|
+
Permission.ProjectMember,
|
|
209
|
+
Permission.ReadProjectLogScrubRule,
|
|
210
|
+
Permission.ReadAllProjectResources,
|
|
211
|
+
],
|
|
212
|
+
update: [
|
|
213
|
+
Permission.ProjectOwner,
|
|
214
|
+
Permission.ProjectAdmin,
|
|
215
|
+
Permission.EditProjectLogScrubRule,
|
|
216
|
+
],
|
|
217
|
+
})
|
|
218
|
+
@TableColumn({
|
|
219
|
+
required: true,
|
|
220
|
+
type: TableColumnType.ShortText,
|
|
221
|
+
canReadOnRelationQuery: true,
|
|
222
|
+
title: "Pattern Type",
|
|
223
|
+
description:
|
|
224
|
+
"The type of sensitive data pattern to detect: email, creditCard, ssn, phoneNumber, ipAddress, or custom.",
|
|
225
|
+
})
|
|
226
|
+
@Column({
|
|
227
|
+
nullable: false,
|
|
228
|
+
type: ColumnType.ShortText,
|
|
229
|
+
length: ColumnLength.ShortText,
|
|
230
|
+
})
|
|
231
|
+
public patternType?: string = undefined;
|
|
232
|
+
|
|
233
|
+
@ColumnAccessControl({
|
|
234
|
+
create: [
|
|
235
|
+
Permission.ProjectOwner,
|
|
236
|
+
Permission.ProjectAdmin,
|
|
237
|
+
Permission.CreateProjectLogScrubRule,
|
|
238
|
+
],
|
|
239
|
+
read: [
|
|
240
|
+
Permission.ProjectOwner,
|
|
241
|
+
Permission.ProjectAdmin,
|
|
242
|
+
Permission.ProjectMember,
|
|
243
|
+
Permission.ReadProjectLogScrubRule,
|
|
244
|
+
Permission.ReadAllProjectResources,
|
|
245
|
+
],
|
|
246
|
+
update: [
|
|
247
|
+
Permission.ProjectOwner,
|
|
248
|
+
Permission.ProjectAdmin,
|
|
249
|
+
Permission.EditProjectLogScrubRule,
|
|
250
|
+
],
|
|
251
|
+
})
|
|
252
|
+
@TableColumn({
|
|
253
|
+
required: false,
|
|
254
|
+
type: TableColumnType.LongText,
|
|
255
|
+
canReadOnRelationQuery: true,
|
|
256
|
+
title: "Custom Regex",
|
|
257
|
+
description:
|
|
258
|
+
"A custom regular expression pattern to match. Only used when patternType is 'custom'.",
|
|
259
|
+
})
|
|
260
|
+
@Column({
|
|
261
|
+
nullable: true,
|
|
262
|
+
type: ColumnType.LongText,
|
|
263
|
+
length: ColumnLength.LongText,
|
|
264
|
+
})
|
|
265
|
+
public customRegex?: string = undefined;
|
|
266
|
+
|
|
267
|
+
@ColumnAccessControl({
|
|
268
|
+
create: [
|
|
269
|
+
Permission.ProjectOwner,
|
|
270
|
+
Permission.ProjectAdmin,
|
|
271
|
+
Permission.CreateProjectLogScrubRule,
|
|
272
|
+
],
|
|
273
|
+
read: [
|
|
274
|
+
Permission.ProjectOwner,
|
|
275
|
+
Permission.ProjectAdmin,
|
|
276
|
+
Permission.ProjectMember,
|
|
277
|
+
Permission.ReadProjectLogScrubRule,
|
|
278
|
+
Permission.ReadAllProjectResources,
|
|
279
|
+
],
|
|
280
|
+
update: [
|
|
281
|
+
Permission.ProjectOwner,
|
|
282
|
+
Permission.ProjectAdmin,
|
|
283
|
+
Permission.EditProjectLogScrubRule,
|
|
284
|
+
],
|
|
285
|
+
})
|
|
286
|
+
@TableColumn({
|
|
287
|
+
required: true,
|
|
288
|
+
type: TableColumnType.ShortText,
|
|
289
|
+
canReadOnRelationQuery: true,
|
|
290
|
+
title: "Scrub Action",
|
|
291
|
+
description:
|
|
292
|
+
"How to scrub matched data: 'mask' partially hides it, 'hash' replaces with a hash, 'redact' removes entirely.",
|
|
293
|
+
})
|
|
294
|
+
@Column({
|
|
295
|
+
nullable: false,
|
|
296
|
+
type: ColumnType.ShortText,
|
|
297
|
+
length: ColumnLength.ShortText,
|
|
298
|
+
default: "redact",
|
|
299
|
+
})
|
|
300
|
+
public scrubAction?: string = undefined;
|
|
301
|
+
|
|
302
|
+
@ColumnAccessControl({
|
|
303
|
+
create: [
|
|
304
|
+
Permission.ProjectOwner,
|
|
305
|
+
Permission.ProjectAdmin,
|
|
306
|
+
Permission.CreateProjectLogScrubRule,
|
|
307
|
+
],
|
|
308
|
+
read: [
|
|
309
|
+
Permission.ProjectOwner,
|
|
310
|
+
Permission.ProjectAdmin,
|
|
311
|
+
Permission.ProjectMember,
|
|
312
|
+
Permission.ReadProjectLogScrubRule,
|
|
313
|
+
Permission.ReadAllProjectResources,
|
|
314
|
+
],
|
|
315
|
+
update: [
|
|
316
|
+
Permission.ProjectOwner,
|
|
317
|
+
Permission.ProjectAdmin,
|
|
318
|
+
Permission.EditProjectLogScrubRule,
|
|
319
|
+
],
|
|
320
|
+
})
|
|
321
|
+
@TableColumn({
|
|
322
|
+
required: true,
|
|
323
|
+
type: TableColumnType.ShortText,
|
|
324
|
+
canReadOnRelationQuery: true,
|
|
325
|
+
title: "Fields to Scrub",
|
|
326
|
+
description:
|
|
327
|
+
"Which log fields to scrub: 'body' (log message only), 'attributes' (attribute values only), or 'both'.",
|
|
328
|
+
})
|
|
329
|
+
@Column({
|
|
330
|
+
nullable: false,
|
|
331
|
+
type: ColumnType.ShortText,
|
|
332
|
+
length: ColumnLength.ShortText,
|
|
333
|
+
default: "both",
|
|
334
|
+
})
|
|
335
|
+
public fieldsToScrub?: string = undefined;
|
|
336
|
+
|
|
337
|
+
@ColumnAccessControl({
|
|
338
|
+
create: [
|
|
339
|
+
Permission.ProjectOwner,
|
|
340
|
+
Permission.ProjectAdmin,
|
|
341
|
+
Permission.CreateProjectLogScrubRule,
|
|
342
|
+
],
|
|
343
|
+
read: [
|
|
344
|
+
Permission.ProjectOwner,
|
|
345
|
+
Permission.ProjectAdmin,
|
|
346
|
+
Permission.ProjectMember,
|
|
347
|
+
Permission.ReadProjectLogScrubRule,
|
|
348
|
+
Permission.ReadAllProjectResources,
|
|
349
|
+
],
|
|
350
|
+
update: [
|
|
351
|
+
Permission.ProjectOwner,
|
|
352
|
+
Permission.ProjectAdmin,
|
|
353
|
+
Permission.EditProjectLogScrubRule,
|
|
354
|
+
],
|
|
355
|
+
})
|
|
356
|
+
@Index()
|
|
357
|
+
@TableColumn({
|
|
358
|
+
required: true,
|
|
359
|
+
type: TableColumnType.Boolean,
|
|
360
|
+
canReadOnRelationQuery: true,
|
|
361
|
+
title: "Enabled",
|
|
362
|
+
description: "Whether this scrub rule is active.",
|
|
363
|
+
defaultValue: true,
|
|
364
|
+
})
|
|
365
|
+
@Column({
|
|
366
|
+
nullable: false,
|
|
367
|
+
type: ColumnType.Boolean,
|
|
368
|
+
default: true,
|
|
369
|
+
})
|
|
370
|
+
public isEnabled?: boolean = undefined;
|
|
371
|
+
|
|
372
|
+
@ColumnAccessControl({
|
|
373
|
+
create: [
|
|
374
|
+
Permission.ProjectOwner,
|
|
375
|
+
Permission.ProjectAdmin,
|
|
376
|
+
Permission.CreateProjectLogScrubRule,
|
|
377
|
+
],
|
|
378
|
+
read: [
|
|
379
|
+
Permission.ProjectOwner,
|
|
380
|
+
Permission.ProjectAdmin,
|
|
381
|
+
Permission.ProjectMember,
|
|
382
|
+
Permission.ReadProjectLogScrubRule,
|
|
383
|
+
Permission.ReadAllProjectResources,
|
|
384
|
+
],
|
|
385
|
+
update: [
|
|
386
|
+
Permission.ProjectOwner,
|
|
387
|
+
Permission.ProjectAdmin,
|
|
388
|
+
Permission.EditProjectLogScrubRule,
|
|
389
|
+
],
|
|
390
|
+
})
|
|
391
|
+
@TableColumn({
|
|
392
|
+
title: "Sort Order",
|
|
393
|
+
required: false,
|
|
394
|
+
type: TableColumnType.Number,
|
|
395
|
+
canReadOnRelationQuery: true,
|
|
396
|
+
description:
|
|
397
|
+
"Determines the evaluation order of this rule relative to others.",
|
|
398
|
+
defaultValue: 0,
|
|
399
|
+
})
|
|
400
|
+
@Column({
|
|
401
|
+
type: ColumnType.Number,
|
|
402
|
+
nullable: false,
|
|
403
|
+
default: 0,
|
|
404
|
+
})
|
|
405
|
+
public sortOrder?: number = undefined;
|
|
406
|
+
|
|
407
|
+
@ColumnAccessControl({
|
|
408
|
+
create: [],
|
|
409
|
+
read: [
|
|
410
|
+
Permission.ProjectOwner,
|
|
411
|
+
Permission.ProjectAdmin,
|
|
412
|
+
Permission.ProjectMember,
|
|
413
|
+
Permission.ReadProjectLogScrubRule,
|
|
414
|
+
Permission.ReadAllProjectResources,
|
|
415
|
+
],
|
|
416
|
+
update: [],
|
|
417
|
+
})
|
|
418
|
+
@TableColumn({
|
|
419
|
+
manyToOneRelationColumn: "createdByUserId",
|
|
420
|
+
type: TableColumnType.Entity,
|
|
421
|
+
modelType: User,
|
|
422
|
+
title: "Created By User",
|
|
423
|
+
description: "Relation to the user who created this log scrub rule.",
|
|
424
|
+
})
|
|
425
|
+
@ManyToOne(
|
|
426
|
+
() => {
|
|
427
|
+
return User;
|
|
428
|
+
},
|
|
429
|
+
{
|
|
430
|
+
eager: false,
|
|
431
|
+
nullable: true,
|
|
432
|
+
onDelete: "SET NULL",
|
|
433
|
+
orphanedRowAction: "nullify",
|
|
434
|
+
},
|
|
435
|
+
)
|
|
436
|
+
@JoinColumn({ name: "createdByUserId" })
|
|
437
|
+
public createdByUser?: User = undefined;
|
|
438
|
+
|
|
439
|
+
@ColumnAccessControl({
|
|
440
|
+
create: [],
|
|
441
|
+
read: [
|
|
442
|
+
Permission.ProjectOwner,
|
|
443
|
+
Permission.ProjectAdmin,
|
|
444
|
+
Permission.ProjectMember,
|
|
445
|
+
Permission.ReadProjectLogScrubRule,
|
|
446
|
+
Permission.ReadAllProjectResources,
|
|
447
|
+
],
|
|
448
|
+
update: [],
|
|
449
|
+
})
|
|
450
|
+
@TableColumn({
|
|
451
|
+
type: TableColumnType.ObjectID,
|
|
452
|
+
title: "Created By User ID",
|
|
453
|
+
description: "ID of the user who created this log scrub rule.",
|
|
454
|
+
})
|
|
455
|
+
@Column({
|
|
456
|
+
type: ColumnType.ObjectID,
|
|
457
|
+
nullable: true,
|
|
458
|
+
transformer: ObjectID.getDatabaseTransformer(),
|
|
459
|
+
})
|
|
460
|
+
public createdByUserId?: ObjectID = undefined;
|
|
461
|
+
|
|
462
|
+
@ColumnAccessControl({
|
|
463
|
+
create: [],
|
|
464
|
+
read: [
|
|
465
|
+
Permission.ProjectOwner,
|
|
466
|
+
Permission.ProjectAdmin,
|
|
467
|
+
Permission.ProjectMember,
|
|
468
|
+
Permission.ReadProjectLogScrubRule,
|
|
469
|
+
Permission.ReadAllProjectResources,
|
|
470
|
+
],
|
|
471
|
+
update: [],
|
|
472
|
+
})
|
|
473
|
+
@TableColumn({
|
|
474
|
+
manyToOneRelationColumn: "deletedByUserId",
|
|
475
|
+
type: TableColumnType.Entity,
|
|
476
|
+
modelType: User,
|
|
477
|
+
title: "Deleted By User",
|
|
478
|
+
description: "Relation to the user who deleted this log scrub rule.",
|
|
479
|
+
})
|
|
480
|
+
@ManyToOne(
|
|
481
|
+
() => {
|
|
482
|
+
return User;
|
|
483
|
+
},
|
|
484
|
+
{
|
|
485
|
+
eager: false,
|
|
486
|
+
nullable: true,
|
|
487
|
+
onDelete: "SET NULL",
|
|
488
|
+
orphanedRowAction: "nullify",
|
|
489
|
+
},
|
|
490
|
+
)
|
|
491
|
+
@JoinColumn({ name: "deletedByUserId" })
|
|
492
|
+
public deletedByUser?: User = undefined;
|
|
493
|
+
|
|
494
|
+
@ColumnAccessControl({
|
|
495
|
+
create: [],
|
|
496
|
+
read: [
|
|
497
|
+
Permission.ProjectOwner,
|
|
498
|
+
Permission.ProjectAdmin,
|
|
499
|
+
Permission.ProjectMember,
|
|
500
|
+
Permission.ReadProjectLogScrubRule,
|
|
501
|
+
Permission.ReadAllProjectResources,
|
|
502
|
+
],
|
|
503
|
+
update: [],
|
|
504
|
+
})
|
|
505
|
+
@TableColumn({
|
|
506
|
+
type: TableColumnType.ObjectID,
|
|
507
|
+
title: "Deleted By User ID",
|
|
508
|
+
description: "ID of the user who deleted this log scrub rule.",
|
|
509
|
+
})
|
|
510
|
+
@Column({
|
|
511
|
+
type: ColumnType.ObjectID,
|
|
512
|
+
nullable: true,
|
|
513
|
+
transformer: ObjectID.getDatabaseTransformer(),
|
|
514
|
+
})
|
|
515
|
+
public deletedByUserId?: ObjectID = undefined;
|
|
516
|
+
}
|