GitHub

EventLogServerAuthorizationService

API reference for EventLogServerAuthorizationService.

Who may write, read and authenticate.

Functions

authorize_write

authorize_write(*, public_key, store_id, entries) -> Effect[None, EventLogServerAuthError]

Succeeds when public_key may write entries to the (resolved) store store_id; fails with EventLogServerAuthError to refuse the write.

ParameterTypeDescription
public_keystr
store_idStoreId
entriesSequence[Entry]

Returns Effect[None, EventLogServerAuthError]

@abstractmethod
def authorize_write(
    self, *, public_key: str, store_id: StoreId, entries: Sequence[Entry]
) -> Effect[None, EventLogServerAuthError]:
    """Succeeds when ``public_key`` may write ``entries`` to the
    (resolved) store ``store_id``; fails with
    ``EventLogServerAuthError`` to refuse the write."""

authorize_read

authorize_read(*, public_key, store_id) -> Effect[None, EventLogServerAuthError]

Succeeds when public_key may read the (resolved) store store_id's changes; fails with EventLogServerAuthError to refuse.

ParameterTypeDescription
public_keystr
store_idStoreId

Returns Effect[None, EventLogServerAuthError]

@abstractmethod
def authorize_read(
    self, *, public_key: str, store_id: StoreId
) -> Effect[None, EventLogServerAuthError]:
    """Succeeds when ``public_key`` may read the (resolved) store
    ``store_id``'s changes; fails with ``EventLogServerAuthError`` to
    refuse."""

authorize_identity

authorize_identity(*, public_key, signing_public_key) -> Effect[None, EventLogServerAuthError]

Whether public_key may authenticate. public_key is an identifier, not a secret: the server binds the first signing key that authenticates for it and rejects any other afterwards. To reject other keys on first use too, record each identity's key with event_log_session_auth.derive_signing_public_key and compare it with signing_public_key, the key presented.

ParameterTypeDescription
public_keystr
signing_public_keybytes

Returns Effect[None, EventLogServerAuthError]

@abstractmethod
def authorize_identity(
    self, *, public_key: str, signing_public_key: bytes
) -> Effect[None, EventLogServerAuthError]:
    """Whether ``public_key`` may authenticate. ``public_key`` is an
    identifier, not a secret: the server binds the first signing key
    that authenticates for it and rejects any other afterwards. To
    reject other keys on first use too, record each identity's key with
    ``event_log_session_auth.derive_signing_public_key`` and compare it
    with ``signing_public_key``, the key presented."""