Skip to content

CBG-5328: Add audit events for document channel history compaction#8276

Open
RIT3shSapata wants to merge 5 commits into
CBG-5327from
CBG-5328
Open

CBG-5328: Add audit events for document channel history compaction#8276
RIT3shSapata wants to merge 5 commits into
CBG-5327from
CBG-5328

Conversation

@RIT3shSapata
Copy link
Copy Markdown
Contributor

CBG-5328

Describe your PR here...

  • Added audit events to document channel history compaction
  • Added test coverage

Pre-review checklist

  • Removed debug logging (fmt.Print, log.Print, ...)
  • Logging sensitive data? Make sure it's tagged (e.g. base.UD(docID), base.MD(dbName))
  • Updated relevant information in the API specifications (such as endpoint descriptions, schemas, ...) in docs/api

Dependencies (if applicable)

Integration Tests

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds audit logging for document channel history read and compaction operations, fitting into the existing REST handler and audit event framework.

Changes:

  • Added new audit event IDs and descriptors for document channel history read/compact operations.
  • Emits audit events from the corresponding admin REST handlers.
  • Added audit tests covering GET history and POST compaction requests.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
base/audit_events.go Defines new document channel history audit event metadata.
rest/doc_api.go Emits audit events from channel history handlers.
rest/audit_test.go Adds test coverage for the new audit events.
Comments suppressed due to low confidence (1)

base/audit_events.go:1183

  • The new audit event name is inconsistent with the surrounding sentence-case, action-oriented audit event names (for example, "Read document metadata" and "Delete document") and uses an awkward noun phrase/capitalization. This is user-visible in audit configuration and logs, so consider renaming it to a clearer action phrase such as a document channel history compaction/read event.
	AuditIDDocumentChannelHistoryCompact: {
		Name:        "Document Channel history compact",
		Description: "A document channel history was compacted by a client",

Comment thread base/audit_events.go Outdated
Comment on lines +1164 to +1166
AuditIDDocumentChannelHistory: {
Name: "Document Channel history",
Description: "A document channel history was sent to a client",
Comment thread rest/doc_api.go Outdated
Comment thread base/audit_events.go Outdated
Comment thread base/audit_events.go Outdated
Comment thread base/audit_events.go Outdated
FilteringPermitted: true,
EventType: eventTypeData,
},
AuditIDDocumentChannelHistory: {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this deserve its own audit event vs. using AuditIDDocumentMetadataRead?

Comment thread base/audit_events.go Outdated
Copy link
Copy Markdown
Collaborator

@adamcfraser adamcfraser left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM - should wait to merge until parent is merged.

@RIT3shSapata RIT3shSapata force-pushed the CBG-5327 branch 2 times, most recently from 89e5580 to 82affc4 Compare May 26, 2026 14:04
…verage

# Conflicts:
#	rest/doc_api.go

# Conflicts:
#	rest/doc_api.go
- replaced audit event for reading channel history with document metadata read
- updated description of the event
- added channels and sequence into the audit event for document channel history compaction

# Conflicts:
#	base/audit_events_fields.go
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants