fix(connectors): retain exact CSV source evidence
Module Package Release / publish-packages (push) Successful in 17s

Release v0.1.27. Coordinated integrity review: GovOPlaN/govoplan-core#298.
This commit is contained in:
2026-09-08 12:19:38 +02:00
parent be16f8218e
commit 889cafaf20
17 changed files with 322 additions and 145 deletions
@@ -1,5 +1,7 @@
from __future__ import annotations
from govoplan_connectors.backend.search_principal import principal_acl_tokens as _principal_acl_tokens
from collections.abc import Mapping, Sequence
from urllib.parse import quote
@@ -288,30 +290,6 @@ def search_document(
)
def _principal_acl_tokens(principal: object) -> tuple[str, ...]:
values: list[str] = []
for prefix, attribute in (
("account", "account_id"),
("membership", "membership_id"),
("identity", "identity_id"),
):
value = getattr(principal, attribute, None)
if value:
values.append(f"{prefix}:{value}")
for prefix, attribute in (
("group", "group_ids"),
("role", "role_ids"),
("function", "function_assignment_ids"),
("scope", "scopes"),
):
values.extend(
f"{prefix}:{value}"
for value in getattr(principal, attribute, ())
if value
)
return tuple(dict.fromkeys(values))[:500]
def _has_scope(principal: object, required: str) -> bool:
check = getattr(principal, "has", None)
if callable(check):