The verified owner key every shared conversation authority files under.
One derivation for the local SQLite owner and the PostgreSQL owner, so a
principal that one refuses the other refuses too.
Bases: SymfonicError
No verified ownership, or an unsupported invocation family.
conversation_owner(principal: Any) -> ConversationOwner
Refuse any identity that did not originate in a principal verifier.
Source code in src/symfonic/platform/conversation_identity.py
| def conversation_owner(principal: Any) -> ConversationOwner:
"""Refuse any identity that did not originate in a principal verifier."""
if (
not isinstance(principal, AuthenticatedPrincipal)
or principal.derivation.get("verified") is not True
or principal.derivation.get("principal_from_verifier") is not True
or not principal.principal_id
):
raise ConversationRefused("verified conversation principal required")
tenant, sub, namespace = owner_scope(principal.scope)
return ConversationOwner(tenant, sub, str(principal.principal_id), namespace)
|