Skip to content

feat(api): let admins fetch alerts and sequences across organizations#633

Open
MateoLostanlen wants to merge 2 commits into
mainfrom
feat/admin-cross-org-listing
Open

feat(api): let admins fetch alerts and sequences across organizations#633
MateoLostanlen wants to merge 2 commits into
mainfrom
feat/admin-cross-org-listing

Conversation

@MateoLostanlen

Copy link
Copy Markdown
Member
  • Alert and sequence list endpoints (unlabeled/latest, all/fromdate, alerts/export) were hard-scoped to the caller's organization; admins now see all organizations, matching the existing behavior of the camera and detection listings.
  • The FWI risk-score filter is skipped for admins (it is resolved per organization); the risk_score override param is ignored for them and documented as such.
  • Non-admin behavior is unchanged and covered by updated risk-filter tests plus new cross-organization tests.

)
for url in ("/sequences/unlabeled/latest", "/sequences/unlabeled/latest?risk_score=low"):
response = await async_client.get(url, headers=auth)
assert response.status_code == 200, print(response.__dict__)
pytest.user_table[0]["id"], pytest.user_table[0]["role"].split(), pytest.user_table[0]["organization_id"]
)
response = await async_client.get("/sequences/unlabeled/latest", headers=admin_auth)
assert response.status_code == 200, print(response.__dict__)
pytest.user_table[1]["id"], pytest.user_table[1]["role"].split(), pytest.user_table[1]["organization_id"]
)
response = await async_client.get("/sequences/unlabeled/latest", headers=agent_auth)
assert response.status_code == 200, print(response.__dict__)
@codecov

codecov Bot commented Jul 11, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.97%. Comparing base (096889d) to head (e702657).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #633      +/-   ##
==========================================
- Coverage   93.44%   90.97%   -2.48%     
==========================================
  Files          59        3      -56     
  Lines        3053      133    -2920     
==========================================
- Hits         2853      121    -2732     
+ Misses        200       12     -188     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant