Skip to content

feat(audit): add ListAuditEvents / ListAuditEventsPage client methods#27

Merged
mastermanas805 merged 2 commits into
masterfrom
feat/audit-log-client
Jul 8, 2026
Merged

feat(audit): add ListAuditEvents / ListAuditEventsPage client methods#27
mastermanas805 merged 2 commits into
masterfrom
feat/audit-log-client

Conversation

@mastermanas805

Copy link
Copy Markdown
Member

Summary

  • Adds audit.go implementing GET /api/v1/audit — the customer-facing audit log export endpoint
  • ListAuditEvents(ctx) — first page with default options
  • ListAuditEventsPage(ctx, opts) — paginated with full filter support (limit, kind, before, since, until)
  • AuditEvent type with all wire fields (id, kind, actor, actor_user_id, actor_email_masked, resource_id, resource_type, summary, metadata as json.RawMessage)
  • AuditEventList type with NextCursor for keyset pagination, LookbackDays, Tier
  • Tier gate surfaced via *APIError (402 upgrade_required for anonymous/free)

Test plan

  • 8 tests covering: happy path, system actor nil fields, all query params wired, zero-opts no query string, until param, 402 upgrade required, 401 unauthorized, NextCursor parsing
  • 100% statement coverage on audit.go
  • Full ./instant/ suite green (98.6% total, no regressions)

🤖 Generated with Claude Code

mastermanas805 and others added 2 commits July 8, 2026 23:00
Implements GET /api/v1/audit in the Go SDK. Supports all server-side
query params (limit, kind, before, since, until) and cursor-based
pagination via NextCursor. Eight tests covering: happy path, nil actor
fields (system actor), all query params, upgrade-required 402, 401
unauthorized, and next-cursor parsing.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@mastermanas805
mastermanas805 merged commit de1246e into master Jul 8, 2026
11 checks passed
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.

1 participant