fediverse_pasture.data_provider
DataProvider
dataclass
Provides the data about actors to various applications
Parameters:
Name | Type | Description | Default |
---|---|---|---|
one_actor
|
ActorData
|
User in one actor and as an application actor |
required |
possible_actors
|
List[ActorData]
|
The list of actors used for verify_actor |
required |
Source code in fediverse_pasture/data_provider/__init__.py
bovine_actor_for_actor_data(actor_id, data)
Builds the corresponding bovine actor and actor data
Parameters:
Name | Type | Description | Default |
---|---|---|---|
actor_id
|
str
|
The actor id to be used, e.g. |
required |
data
|
ActorData
|
The actor data |
required |
Returns:
Type | Description |
---|---|
Tuple[BovineActor, Actor]
|
A tuple, where the first object is the Actor performing actions, and the second one the data object. |
Source code in fediverse_pasture/data_provider/__init__.py
models
ActorData
Bases: BaseModel
Represents an Actor
Parameters:
Name | Type | Description | Default |
---|---|---|---|
actor_name
|
str
|
The name of the actor used in the actor_id |
required |
key_pairs
|
List[ActorKeyPair]
|
List of keys |
[]
|
user_part
|
str | None
|
User as part of the acct-uri for webfinger, None means webfinger lookup is not possible |
None
|
summary
|
str
|
Summary part of actor profile |
''
|
requires_signed_get_for_actor
|
bool
|
If true, validates the signature on |
False
|
requires_signed_post_for_inbox
|
bool
|
If true, validates the signature on |
False
|
Source code in fediverse_pasture/data_provider/models.py
ActorKeyPair
Bases: BaseModel
Represents a key pair for the actor
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name
|
str
|
Name of the key used in the key id in the form |
required |
public
|
str
|
The PEM encoded public key |
required |
private
|
str
|
The PEM encoded private key |
required |