docs: document the DB sink + query API that already ship, add endpoints - #1
Merged
Merged
Conversation
- Architecture diagram's "Future Sink Layer (DB / S3 / OpenSearch)" undersold reality: worker/main.py + consumers/sink.py already write into a MySQL-backed store (db/models.py, Alembic-migrated, AUDIT_DATABASE_URL), and GET /audit/events already queries it, platform-admin-gated. Updated the diagram and the Roadmap's "OpenSearch / PostgreSQL sink | Planned" line, which read as if no sink existed at all -- it's specifically additional backends beyond the MySQL one that are still open. - New "API Endpoints" section: /health, /audit/test (no auth today), and /audit/events (platform_admin-gated, with its real query params) -- the "Running" section only showed a health-check curl example before, despite the Authentication section already referencing "audit query/search endpoints" that were never documented anywhere. - Added the three DB/consumer env vars (AUDIT_DATABASE_URL, AUDIT_CONSUMER_GROUP, AUDIT_CONSUMER_NAME) that back the sink layer, missing from the Environment Variables table. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
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.
Summary
worker/main.py+consumers/sink.pyalready write into a MySQL-backed store, andGET /audit/eventsalready queries it, platform-admin-gated./health,/audit/test,/audit/events— none were documented despite the Authentication section already referencing "audit query/search endpoints."Testing
Docs-only change, verified against
api/routes_audit_events.py,audit/config.py,worker/main.py, andconsumers/sink.pydirectly.🤖 Generated with Claude Code