Skip to content

feat: add HTTP audit middleware#152

Closed
gfyrag wants to merge 2 commits into
mainfrom
feat/audit-middleware
Closed

feat: add HTTP audit middleware#152
gfyrag wants to merge 2 commits into
mainfrom
feat/audit-middleware

Conversation

@gfyrag

@gfyrag gfyrag commented May 22, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Wire go-libs v5 httpaudit.Middleware into the webhooks HTTP router to publish audit events via Watermill
  • Add messagingfx.PublishModuleFromFlags (go-libs v5) as the shared publisher provider, replacing the per-module v2 publish.FXModuleFromFlags in the worker
  • Bridge v2/v5 logging via a thin loggerV5Adapter so the v5 messaging module can reuse the existing v2 logger

Test plan

  • Verify go build ./... passes (done locally)
  • Verify go vet ./... passes (done locally)
  • Run integration tests with worker mode enabled to confirm subscriber/router still work
  • Run server-only mode and confirm audit events are published to the configured topic
  • Confirm health check and info endpoints are not affected by the audit middleware

Depends on: formancehq/go-libs#604

🤖 Generated with Claude Code

@coderabbitai

coderabbitai Bot commented May 22, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

🗂️ Base branches to auto review (1)
  • main

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 05ffaa4c-ee2e-4928-8a4c-ee2afabf972a

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/audit-middleware

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

gfyrag and others added 2 commits May 22, 2026 11:01
Add go-libs/v5 alongside existing v2, and fix deprecated API calls
introduced by transitive dependency upgrades:
- bun.In() -> bun.List()
- r.AddNoPublisherHandler() -> r.AddConsumerHandler()

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Wire go-libs v5 httpaudit middleware into the webhooks HTTP router to
publish audit events via Watermill. Replace per-module v2 publish FX
wiring with a shared v5 messagingfx.PublishModuleFromFlags so the
publisher is always available for both audit and the optional worker.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@gfyrag gfyrag force-pushed the feat/audit-middleware branch from 7223bd4 to ae4abf2 Compare May 22, 2026 09:03
@gfyrag gfyrag changed the base branch from main to chore/upgrade-go-libs-v5 May 22, 2026 09:03
@gfyrag gfyrag marked this pull request as ready for review May 22, 2026 09:33
@gfyrag gfyrag requested a review from a team as a code owner May 22, 2026 09:33
Base automatically changed from chore/upgrade-go-libs-v5 to main May 22, 2026 09:37
@gfyrag

gfyrag commented May 22, 2026

Copy link
Copy Markdown
Contributor Author

Changes merged into upgrade PR #153

@gfyrag gfyrag closed this May 22, 2026
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.

3 participants