You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
OPA adapter raises TypeError, not ValueError, when a result mapper returns a dict or list #75
Checked at 986e87e. Found by rajnisht7 in review of #73.
src/agentrust_telemetry/adapters/opa.py:38 checks the mapper's return value with decision not in {"allow", "deny", "challenge", "not_applicable", "error"}. A set membership test needs a hashable value, so a result_mapper that returns a dict or a list raises TypeError: unhashable type instead of the adapter's own ValueError("OPA result mapper returned unsupported decision: ..."). Every other bad mapper result already gets that ValueError.
Done when
a mapper returning {} or [] raises the same ValueError as an unsupported string
a test in tests/test_adapters.py covers both, and fails on 986e87e
Activity
fix(opa): reject unhashable mapper decisions (#76)