moviewyrm/bookwyrm/activitypub/person.py

36 lines
803 B
Python
Raw Normal View History

2021-03-08 16:49:10 +00:00
""" actor serializer """
from dataclasses import dataclass, field
from typing import Dict
2020-11-30 18:32:13 +00:00
from .base_activity import ActivityObject
2021-04-15 23:35:04 +00:00
from .image import Document
2020-11-30 18:32:13 +00:00
@dataclass(init=False)
class PublicKey(ActivityObject):
2021-03-08 16:49:10 +00:00
""" public key block """
2020-11-30 18:32:13 +00:00
owner: str
publicKeyPem: str
2021-03-08 16:49:10 +00:00
type: str = "PublicKey"
2020-11-30 18:32:13 +00:00
@dataclass(init=False)
class Person(ActivityObject):
2021-03-08 16:49:10 +00:00
""" actor activitypub json """
preferredUsername: str
inbox: str
publicKey: PublicKey
2021-04-02 14:38:37 +00:00
followers: str = None
following: str = None
outbox: str = None
endpoints: Dict = None
name: str = None
summary: str = None
2021-04-15 23:35:04 +00:00
icon: Document = field(default_factory=lambda: {})
2020-10-31 20:06:22 +00:00
bookwyrmUser: bool = False
manuallyApprovesFollowers: str = False
discoverable: str = False
2021-03-08 16:49:10 +00:00
type: str = "Person"