cattle_grid.activity_pub ¶
These are the methods from the cattle_grid.activity_pub package that are hopefully safe to use when building stuff, and not subject to change.
DuplicateIdentifierException ¶
actor_to_object ¶
Transform the actor to an object
Warning
The actor.identifiers needs to be fetched from the database for this to work properly
Source code in cattle_grid/activity_pub/actor/transform.py
compute_acct_uri ¶
Computes the acct uri (see RFC 7565)
Source code in cattle_grid/activity_pub/actor/helper.py
create_actor
async
¶
create_actor(
session: AsyncSession,
base_url: str,
preferred_username: str | None = None,
identifiers: dict = {},
profile: dict = {},
automatically_accept_followers: bool = False,
)
Creates a new actor in the database
Source code in cattle_grid/activity_pub/actor/__init__.py
identifier_exists
async
¶
identifier_exists(
session: AsyncSession, identifier: str
) -> bool
is_valid_requester_for_obj
async
¶
is_valid_requester_for_obj(
session: AsyncSession, requester: str, obj: dict
)
Checks if the requested is allowed to view the object