Skip to content

#163 - add accountId and userToken filter to SSE endpoint - #209

Open
xsalefter wants to merge 4 commits into
masterfrom
new-platform-163
Open

xsalefter wants to merge 4 commits into
masterfrom
new-platform-163

Conversation

@xsalefter

Copy link
Copy Markdown
Contributor

This PR will replace this draft PR: #203 .

Original ticket: #163 : Clients can now narrow the log stream with accountId and userToken query parameters, and can optionally send their tenant API key and secret to see only their own tenant's entries. Filters combine with AND, and a malformed or missing combination gets a clear 400,  401 or 403 before the stream opens.

A well-formed request that simply matches nothing stays connected and sends heartbeats. Along the way we found and fixed a quiet bug: a heartbeat sent before any log entry used to throw and silently stop the heartbeat task. The PR also updates the HTML demo.

Copilot AI balanced review requested due to automatic review settings October 20, 2026 11:21

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Endpoint tests leave a scheduler running after teardown and can miss unwanted entries in filtered streams.

2 open issues
What changed in this PR

Adds account and token filtering to the logger’s SSE endpoint for #163, with optional tenant scoping and validation before streaming.

Changes:

  • Combines tenant, account, and token filters with AND.
  • Fixes heartbeats before the first log entry and adds filtering tests.
  • Updates the HTML demo and build dependencies.
File Description
pom.xml Updates the parent version.
osgi-bundles/​bundles/​logger/​src/​test/​java/​org/​killbill/​billing/​osgi/​bundles/​logger/​TestSseParamsCriteria.java Tests matching and combined criteria.
osgi-bundles/​bundles/​logger/​src/​test/​java/​org/​killbill/​billing/​osgi/​bundles/​logger/​TestLogsSseHandler.java Tests filtering and heartbeat behavior.
osgi-bundles/​bundles/​logger/​src/​test/​java/​org/​killbill/​billing/​osgi/​bundles/​logger/​TestLogsSseFilter.java Tests validation and record ID resolution.
osgi-bundles/​bundles/​logger/​src/​test/​java/​org/​killbill/​billing/​osgi/​bundles/​logger/​TestLogsSseEndpoint.java Adds HTTP streaming integration tests.
osgi-bundles/​bundles/​logger/​src/​main/​java/​org/​killbill/​billing/​osgi/​bundles/​logger/​SseParamsCriteria.java Implements combined matching criteria.
osgi-bundles/​bundles/​logger/​src/​main/​java/​org/​killbill/​billing/​osgi/​bundles/​logger/​LogsSseHandler.java Applies filters and handles heartbeats without IDs.
osgi-bundles/​bundles/​logger/​src/​main/​java/​org/​killbill/​billing/​osgi/​bundles/​logger/​LogsSseFilter.java Validates requests and resolves filter criteria.
osgi-bundles/​bundles/​logger/​src/​main/​java/​org/​killbill/​billing/​osgi/​bundles/​logger/​Activator.java Registers request validation before streaming.
osgi-bundles/​bundles/​logger/​pom.xml Declares Jetty dependencies for endpoint tests.
osgi-bundles/​bundles/​logger/​html-sse-demo.md Documents filters and enables tenant headers.

Review effort: Balanced

Copilot AI balanced review requested due to automatic review settings October 20, 2026 12:38

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

Tenant isolation needs human verification against real server integration because the endpoint tests simulate upstream tenant validation.

No open issues 🎉

2 resolved since last review

Review effort: Balanced

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.

2 participants