Skip to content

Commit

Permalink
Merge pull request #222 from permitio/omer/per-11007-add-checks-all-c…
Browse files Browse the repository at this point in the history
…hecks-time-metrics-to-the-docs-with-the-new

fix factdb local role assignments filters
  • Loading branch information
omer9564 authored Dec 9, 2024
2 parents 45147fd + a5600ac commit 25c0d84
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
5 changes: 3 additions & 2 deletions horizon/enforcer/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -317,9 +317,10 @@ async def _is_allowed_factdb(
):
headers = transform_headers(request)
url = f"{sidecar_config.FACTDB_SERVICE_URL}/v1/authz{path}"
payload = None if query is None else {"input": jsonable_encoder(query)}
_encoded_query = jsonable_encoder(query)
payload = None if query is None else {"input": _encoded_query}
exc = None
if query is not None and isinstance(query, dict):
if _encoded_query is not None and isinstance(_encoded_query, dict):
_set_use_debugger(payload)
try:
logger.info(
Expand Down
7 changes: 6 additions & 1 deletion horizon/local/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,12 @@ async def legacy_list_role_assignments() -> list[RoleAssignment]:
)
return await legacy_list_role_assignments()
else:
res = await policy_store.list_facts_by_type("role_assignments")
res = await policy_store.list_facts_by_type(
"role_assignments",
page=page,
per_page=per_page,
filters=filters,
)
res_json = parse_obj_as(
list[RoleAssignmentFactDBFact], await res.json()
)
Expand Down

0 comments on commit 25c0d84

Please sign in to comment.