added new configuration flag to skip audit

This commit is contained in:
Yuli Stremovsky
2023-12-20 20:12:02 +02:00
parent 2da89ffb98
commit f1bb37c4d1
11 changed files with 42 additions and 36 deletions

View File

@@ -38,7 +38,10 @@ func auditApp(title string, record string, app string, mode string, identity str
return &auditEvent{Title: title, Mode: mode, Who: identity, Record: record, Status: "ok", When: int32(time.Now().Unix())}
}
func (event auditEvent) submit(db *dbcon) {
func (event auditEvent) submit(db *dbcon, conf Config) {
if conf.Generic.DisableAudit == true {
return
}
bdoc := bson.M{}
atoken, _ := uuid.GenerateUUID()
bdoc["atoken"] = atoken