(core) Add more audit logging data/events

Summary:
Adds a few additional audit events and enhances audit logging
to capture more data (request origin, active org, user type).

Test Plan: Server and manual tests.

Reviewers: jarek

Reviewed By: jarek

Subscribers: jarek

Differential Revision: https://phab.getgrist.com/D4348
This commit is contained in:
George Gevoian
2024-09-23 11:04:22 -04:00
parent 126db2f91a
commit 8b1d1c5d25
23 changed files with 1013 additions and 541 deletions

View File

@@ -52,10 +52,13 @@ describe('GristAuditLogger', function() {
.post('/events', {
event: {
name: 'createDocument',
user: null,
user: {type: 'unknown'},
details: {
id: 'docId',
name: 'docName',
},
context: {},
source: {},
},
timestamp,
})
@@ -64,7 +67,7 @@ describe('GristAuditLogger', function() {
auditLogger.logEventAsync(null, {
event: {
name: 'createDocument',
details: {id: 'docId'},
details: {id: 'docId', name: 'docName'},
},
timestamp,
})
@@ -80,7 +83,7 @@ describe('GristAuditLogger', function() {
auditLogger.logEventAsync(null, {
event: {
name: 'createDocument',
details: {id: 'docId'},
details: {id: 'docId', name: 'docName'},
},
}),
'received a non-200 response from https://api.getgrist.com/events: 404 Not found'
@@ -98,7 +101,7 @@ describe('GristAuditLogger', function() {
void auditLogger.logEvent(null, {
event: {
name: 'createDocument',
details: {id: 'docId'},
details: {id: 'docId', name: 'docName'},
},
});
}
@@ -106,7 +109,7 @@ describe('GristAuditLogger', function() {
auditLogger.logEventAsync(null, {
event: {
name: 'createDocument',
details: {id: 'docId'},
details: {id: 'docId', name: 'docName'},
},
}),
'exceeded the maximum number of pending audit event calls (25)'