eventlog: always use AuditSource objects as source field

This commit is contained in:
Girish Ramakrishnan
2023-08-26 08:18:58 +05:30
parent 246c45c1bc
commit d2c702f890
9 changed files with 34 additions and 19 deletions

View File

@@ -111,7 +111,7 @@ function postProcess(record) {
// never throws, only logs because previously code did not take a callback
async function add(action, source, data) {
assert.strictEqual(typeof action, 'string');
assert.strictEqual(typeof source, 'object');
assert.strictEqual(typeof source, 'object'); // an AuditSource
assert.strictEqual(typeof data, 'object');
const id = uuid.v4();
@@ -123,7 +123,7 @@ async function add(action, source, data) {
// never throws, only logs because previously code did not take a callback
async function upsertLoginEvent(action, source, data) {
assert.strictEqual(typeof action, 'string');
assert.strictEqual(typeof source, 'object');
assert.strictEqual(typeof source, 'object'); // an AuditSource
assert.strictEqual(typeof data, 'object');
// can't do a real sql upsert, for frequent eventlog entries we only have to do 2 queries once a day