Repository navigation
feat(admin): security audit logging and outbound webhooks event system - #29
Merged
Merged
Conversation
feat(admin): implement security audit logging and outbound webhooks event system
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Executive Summary
This release branch merges verified Security Audit Logging (Task 2.23 / FR-2) and the Webhooks & Outbound Event System (Task 3.1 / FR-3) from the
devbranch intomain. The release establishes immutable audit trails across all critical authentication, session, and administrative lifecycles, and provides an enterprise-ready outbound webhook engine with cryptographic HMAC-SHA256 signature verification, SSRF protection, 24-hour dual-secret rotation grace windows, and automated exponential backoff retries.All changes have undergone automated end-to-end integration testing, code formatting, static analysis, and type checking in simulated production environments. Merging this PR elevates AuthKit's enterprise readiness, compliance posture, and external platform integrability.
Feature & Capabilities Scorecard
GET /api/v1/admin/audit-logsendpoint featuring cursor-based pagination and multi-dimensional filtering (userId,action,status,startDate,endDate).evt_<id>,type,version,timestamp,data) and wildcard*subscription matching.X-Webhook-Signature: t=...,v1=...), configurable timeouts (5s), and response body truncation (10 KB max).v1(current secret) andv1_old(previous secret) signatures.Retry-Afterheader parsing, automatic subscription disabling after 10 consecutive failures, and background queue worker recovery./api/v1/admin/webhooksfor subscription CRUD, secret rotation, live ping/test deliveries, and detailed delivery attempt audits.Database & Schema Migration
1. New Prisma Models & Indexes
Merging this release introduces three new database models:
AuditLog: Stores immutable event records with composite indexes onuserId,action,createdAt, andipAddress.WebhookSubscription: Manages endpoint URLs, active event subscriptions, failure counters, and signing secrets (secret,previousSecret,previousSecretExpiresAt).WebhookDelivery: Tracks every webhook dispatch attempt, HTTP response status codes, latencies, error codes, and sanitized payload/response records.2. Migration Execution
Run the following migration command during the production deployment pipeline:
Documentation & API Artifacts Synchronization
README.md: Updated feature capabilities and architecture descriptions to reflect audit logging and outbound webhook integrations.docs/api_endpoints.md: Expanded Section 7 (Admin) with comprehensive references for7.4 Security Audit Logs (/admin/audit-logs)and7.5 Webhooks (/admin/webhooks).docs/api-specs/AuthKit.postman_collection.json): Added theWebhooks & Outbound Eventsrequest suite inside08. Admin Controls & Role Managementwith automated test assertions.docs/api-specs/openapi.json): Exported complete OpenAPI 3.0 schemas, parameters, and response structures categorized underAdmin - Audit LogsandAdmin - Webhooks.docs/audit/2026-07-20/task.md): Updated Task 2.23 and Task 3.1 statuses toDone.QA & Sign-Off Verification
pnpm type-check(tsc --noEmit).pnpm lint(eslint) andpnpm format:check(prettier).pnpm build(tsup+ OpenAPI generation).