Skip to content

Commit

Permalink
Audit document revocation (#7007)
Browse files Browse the repository at this point in the history
  • Loading branch information
bbrks authored Jul 23, 2024
1 parent 0f05fda commit 9f54f2f
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
16 changes: 15 additions & 1 deletion base/audit_events.go
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ const (
AuditIDDocumentMetadataRead AuditID = 55004
AuditIDDocumentImport AuditID = 55005
AuditIDDocumentResync AuditID = 55006
AuditIDDocumentRevoke AuditID = 55007
// Document attachments events
AuditIDAttachmentCreate AuditID = 55010
AuditIDAttachmentRead AuditID = 55011
Expand Down Expand Up @@ -1114,7 +1115,20 @@ var AuditEvents = events{
FilteringPermitted: true,
EventType: eventTypeData,
},

AuditIDDocumentRevoke: {
Name: "Revoke document",
Description: "A document revocation request was sent to a client",
MandatoryFields: AuditFields{
AuditFieldDocID: "document id",
AuditFieldDocVersion: "revision ID",
},
mandatoryFieldGroups: []fieldGroup{
fieldGroupKeyspace,
},
EnabledByDefault: false,
FilteringPermitted: true,
EventType: eventTypeData,
},
AuditIDAttachmentCreate: {
Name: "Create attachment",
Description: "A new attachment was created",
Expand Down
4 changes: 4 additions & 0 deletions db/changes.go
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,10 @@ func (db *DatabaseCollectionWithUser) buildRevokedFeed(ctx context.Context, ch c
return

case feed <- &change:
base.Audit(ctx, base.AuditIDDocumentRevoke, base.AuditFields{
base.AuditFieldDocID: logEntry.DocID,
base.AuditFieldDocVersion: logEntry.RevID,
})
sentChanges++
}
}
Expand Down

0 comments on commit 9f54f2f

Please sign in to comment.