feat: business payload logging toggle (privacy-first, default off) - #1
Merged
Conversation
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.
Business payload logging toggle (privacy-first)
Adds a platform-wide switch so operators can prove to customers that request/response bodies are not stored — and optionally enable full capture for debugging.
PayloadLogEnabled=false): zero overhead, nothing captured; the platform keeps only billing/ops metadata. Middleware fast-path:if !common.PayloadLogEnabled { c.Next(); return }.payload_logstable and viewable in a root-only Payload Logs console page (sidebar).Backend
common/constants.goPayloadLogEnabled(option template = LogConsumeEnabled; registered inmodel/option.go).model/payload_log.gomodel + migration (model/main.go).middleware/payload_log.gocapture (reuses audit.go's response-writer wrapper) mounted on the relay httpRouter.controller/payload_log.go+router/api-router.goadmin query API (/api/payload_log/).Frontend
features/payload-logs/*+ route/payload-logs(SUPER_ADMIN): switch + log table + request/response detail dialog.hooks/use-sidebar-data.ts), i18n (en+zh).Verify
go build ./...PASS ·bun install+bun run buildPASS (routeTree regenerated) ·tsgotypecheck PASS.bun run buildregenerates it.