Skip to content

fix(dashboard): honor portal endpoint filters without widening scope - #2770

Merged
mekilis merged 1 commit into
new-convoy-uifrom
smart/fix-portal-endpoint-filter-ci
Aug 3, 2026
Merged

fix(dashboard): honor portal endpoint filters without widening scope#2770
mekilis merged 1 commit into
new-convoy-uifrom
smart/fix-portal-endpoint-filter-ci

Conversation

@mekilis

@mekilis mekilis commented Aug 3, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Portal endpointId filters now intersect with the portal allowlist on event delivery list/count/batch-retry and event list/count/batch-replay paths (shared portalScopedEndpointIDs helper).
  • Empty intersections return typed empty responses instead of a []string content payload.
  • Integration tests assert: unfiltered owner scope, allowed filter narrows, outside filter returns empty (never widens).
  • Dashboard event-deliveries unused-var lint fixed so Build dashboard can pass.

Test plan

  • go test ./api/handlers/ -run TestFilterAllowedEndpointIDs
  • go test ./api/ -run 'TestPortalEventIntegrationTestSuite/(Test_GetEventDeliveriesPaged|Test_GetEventsPaged|Test_BatchRetry|Test_CountAffected)'
  • eslint on event-deliveries.component.ts
  • CI Build dashboard + api shard 3 on this PR

Note

Medium Risk
Changes portal authorization scoping for list/count/batch APIs; incorrect intersection logic could leak or hide data, though behavior is fail-closed with new integration coverage.

Overview
Portal API list/count/batch paths now resolve endpoints through portalScopedEndpointIDs, which intersects query endpointId filters with the portal allowlist instead of ignoring or inconsistently applying filters.

Events (paged list, batch-replay count, batch replay) and event deliveries (paged list, count, batch retry) all use this helper. When nothing matches, responses return typed empty payloads (e.g. empty event/delivery arrays) rather than mis-typed []string content.

Unit tests cover filterAllowedEndpointIDs; portal integration tests assert unfiltered owner scope, narrowing to an allowed endpoint, and empty results for out-of-scope endpoint filters. The dashboard event-deliveries screen shares queryParamsForCount so totals and group batch-retry use the same filter surface as list queries (lint fix included).

Reviewed by Cursor Bugbot for commit 2814dc0. Bugbot is set up for automated code reviews on this repo. Configure here.

keep query endpointId as an allowlist intersection on portal list/count/retry
paths, return typed empty pages when the intersection is empty, and cover the
contract in unit plus portal integration tests. also clear unused-var lint in
event deliveries filters.
@mekilis
mekilis merged commit ed18941 into new-convoy-ui Aug 3, 2026
30 checks passed
@mekilis
mekilis deleted the smart/fix-portal-endpoint-filter-ci branch August 3, 2026 15:13

@cursor cursor Bot 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.

Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Want higher recall? High effort reviews run extra passes and find more bugs. A team admin can switch effort levels in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 2814dc0. Configure here.

Comment thread api/handlers/event.go
}

endpointIDs, innerErr := h.getEndpoints(r, portalLink)
endpointIDs, innerErr := h.portalScopedEndpointIDs(r, portalLink, data.Filter.EndpointIDs)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Batch replay ownership filter coupling

Medium Severity

portalScopedEndpointIDs is correctly used for the query filter, but the same intersected result is also assigned to ownedEndpointIDs. Ownership checks need the full portal allowlist, so a portal batch replay filtered to one owned endpoint can skip fan-out events that also target other owned endpoints and count them as failures.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 2814dc0. Configure here.

mekilis added a commit that referenced this pull request Aug 4, 2026
* redesign dashboard

* update convoy clean design

* finish Clean UI cleanup across dashboard surfaces

Align remaining shared components, billing, auth, filters, and dialogs with Clean tokens and native pill CTAs.

Co-authored-by: Cursor <cursoragent@cursor.com>

* honor portal endpoint filters within allowed scope

Intersect requested endpoint IDs with the portal link allowlist so delivery list and count queries can filter without widening token access.

Co-authored-by: Cursor <cursoragent@cursor.com>

* update billing session

* fix(dashboard): honor portal endpoint filters without widening scope (#2770)

keep query endpointId as an allowlist intersection on portal list/count/retry
paths, return typed empty pages when the intersection is empty, and cover the
contract in unit plus portal integration tests. also clear unused-var lint in
event deliveries filters.

* feat(controlplane): forward optional referral_code on sh checkout and trial (#2769)

* feat(billing): forward optional referral_code on sh checkout and trial

pass the trimmed referral_code through to overwatch guest checkout and
self-hosted trial start so attribution can stick at signup.

* feat(billing): wire referral share ui and fix portal batch replay ownership

show the sh refer block from organisation share_url, accept optional
referral_code on checkout and trial, and keep OwnedEndpointIDs on the
full portal allowlist when filtering batch replay by endpointId.

* fix(billing): reload referral share after activation and harden portal list errors

call loadReferralShare from pollUntilBillingActive with a stale-response
token, and clear portal subscription loading failures without showing
stale rows or a false empty state.

---------

Co-authored-by: Smart Mekiliuwa <st.nonso@gmail.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
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.

1 participant