Skip to content

feat: structured audit log schema & storage layer#527

Open
lakhansamani wants to merge 1 commit intomainfrom
feat/audit-log-schema-storage
Open

feat: structured audit log schema & storage layer#527
lakhansamani wants to merge 1 commit intomainfrom
feat/audit-log-schema-storage

Conversation

@lakhansamani
Copy link
Copy Markdown
Contributor

Summary

  • Adds AuditLog schema with fields: actor info, action, resource, IP, user agent, metadata, timestamps
  • Implements AddAuditLog, ListAuditLogs (with filtering/pagination), DeleteAuditLogsBefore across all 6 DB providers (SQL/GORM, MongoDB, ArangoDB, Cassandra, DynamoDB, Couchbase)
  • Adds 27 audit event type constants covering auth, admin, token, and session events
  • Creates table/collection + indexes on provider initialization for all backends
  • Includes integration tests for add, list, filter, and delete operations

Related

Closes #505

Test plan

  • Run go build ./... — compiles clean
  • Run integration tests with Postgres: go test -p 1 -v -run TestAuditLogs ./internal/integration_tests/
  • Run integration tests with other DBs: TEST_DBS="mongodb,arangodb,scylladb,dynamodb,couchbase" go test -p 1 -v -run TestAuditLogs ./internal/integration_tests/
  • Verify schema migration on fresh DB

🤖 Generated with Claude Code

Add AuditLog schema with support for all 6 database providers (SQL/GORM,
MongoDB, ArangoDB, Cassandra, DynamoDB, Couchbase). Includes AddAuditLog,
ListAuditLogs (with filtering by actor_id, action, resource_type, etc),
and DeleteAuditLogsBefore for log retention. Ref: RFC #505.
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.

RFC: Structured Audit Log System

1 participant