Skip to content

Commit f943c7b

Browse files
committed
docs(e2e): clarify test_list_events_denied_on_both_query_params scope
Per Greptile review on #277: the test's previous name + docstring claimed to verify "BOTH query params are gated" by passing zero-UUIDs for both task_id and agent_id, but FastAPI evaluates the ``task_id`` Depends first and short-circuits before the agent_id gate runs. The test would still pass if the agent_id gate were removed entirely — it doesn't isolate either gate. Rename and rewrite the docstring to be honest about what it actually verifies: end-to-end route gating, no per-gate isolation. Independent isolation would require granting one resource but not the other in SpiceDB, which depends on a reachable spark-authz (out of scope today per Gap 1 in #276 — pubsec-dev runs raw SpiceDB without spark-authz).
1 parent 7773196 commit f943c7b

1 file changed

Lines changed: 8 additions & 4 deletions

File tree

scripts/spark-authz-e2e-tests/tests/test_event_authz.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,13 +56,17 @@ def test_list_events_without_agent_view_returns_404(
5656
f"{denied.text}"
5757
)
5858

59-
def test_list_events_without_task_view_returns_404(
59+
def test_list_events_denied_on_both_query_params_returns_404(
6060
self,
6161
agentex_client_b,
6262
):
63-
"""user_b lacks ``read`` on a task_id they have no relationship to →
64-
``DAuthorizedQuery`` on task_id collapses denial to 404. Symmetric
65-
with the agent-side check; verifies BOTH query params are gated.
63+
"""When user_b is denied on both ``task_id`` and ``agent_id``, the
64+
route collapses to 404. This verifies the route is gated end-to-end
65+
but does NOT isolate which gate fired: FastAPI evaluates the
66+
``task_id`` ``Depends`` first, so the ``agent_id`` gate never
67+
executes here. Isolating each gate independently would require
68+
granting one resource but not the other in SpiceDB, which depends
69+
on a reachable spark-authz (see ``authz_client`` skip behavior).
6670
"""
6771
resp = agentex_client_b.list_events(
6872
task_id="00000000-0000-0000-0000-000000000002",

0 commit comments

Comments
 (0)