Skip to content

symfonic.platform.working_write_authority

working_write_authority

Opt-in InMemory reference authority, held until write acknowledgement.

Owner assignments are trusted composition input, never HTTP claims. This is not an adapter over the existing read-only WorkingOwnerGrant.

InMemoryWorkingWriteAuthority

InMemoryWorkingWriteAuthority(graph, owners)

Single-process reference; assignment and grants share one live lock.

Source code in src/symfonic/platform/working_write_authority.py
def __init__(self, graph, owners):
    self.graph = graph
    self._owners = dict(owners)
    self._lock = asyncio.Lock()
    self._live = {}
    for (path, session), owner in self._owners.items():
        if not all(type(value) is str and value.strip() for value in (path, session, owner)):
            raise ValueError("Working owner assignments must be nonblank strings")

assign async

assign(scope_path, session, principal_id)

Trusted server provisioning/revocation; blocked while a grant is held.

Source code in src/symfonic/platform/working_write_authority.py
async def assign(self, scope_path, session, principal_id):
    """Trusted server provisioning/revocation; blocked while a grant is held."""
    async with self._lock:
        if principal_id is None:
            self._owners.pop((scope_path, session), None)
        else:
            self._owners[(scope_path, session)] = principal_id