Skip to content

fediverse_pasture.data_provider.models

ActorData

Bases: BaseModel

Represents an Actor

Source code in fediverse_pasture/data_provider/models.py
class ActorData(BaseModel):
    """Represents an Actor"""

    actor_name: str
    """The name of the actor used in the actor_id"""
    key_pairs: List[ActorKeyPair] = []
    """List of keys"""
    user_part: str | None = None
    """User as part of the acct-uri for webfinger, None means webfinger lookup is not possible"""

    summary: str = ""
    """Summary part of actor profile"""

    requires_signed_get_for_actor: bool = False
    """If true, validates the signature on `GET /actor`"""
    requires_signed_post_for_inbox: bool = False
    """If true, validates the signature on `POST /inbox`"""

actor_name: str instance-attribute

The name of the actor used in the actor_id

key_pairs: List[ActorKeyPair] = [] class-attribute instance-attribute

List of keys

requires_signed_get_for_actor: bool = False class-attribute instance-attribute

If true, validates the signature on GET /actor

requires_signed_post_for_inbox: bool = False class-attribute instance-attribute

If true, validates the signature on POST /inbox

summary: str = '' class-attribute instance-attribute

Summary part of actor profile

user_part: str | None = None class-attribute instance-attribute

User as part of the acct-uri for webfinger, None means webfinger lookup is not possible

ActorKeyPair

Bases: BaseModel

Represents a key pair for the actor

Source code in fediverse_pasture/data_provider/models.py
class ActorKeyPair(BaseModel):
    """Represents a key pair for the actor"""

    name: str
    """Name of the key used in the key id in the form `key_id = f"{actor_id}#{name}"`"""
    public: str
    """The PEM encoded public key"""
    private: str
    """The PEM encoded private key"""

name: str instance-attribute

Name of the key used in the key id in the form key_id = f"{actor_id}#{name}"

private: str instance-attribute

The PEM encoded private key

public: str instance-attribute

The PEM encoded public key