Files
content-ingestion-agent/app/governance.py

7 lines
331 B
Python

from .domain.models import Document
from .settings import Settings
def authorize(document: Document, settings: Settings) -> tuple[bool, str]:
allowed = not settings.allowed_repositories or document.source.repository in settings.allowed_repositories
return (allowed, "approved" if allowed else "repository is not allowed")