59 lines
1.1 KiB
Python
59 lines
1.1 KiB
Python
from enum import Enum, auto
|
|
|
|
class StrEnum(str, Enum):
|
|
pass
|
|
|
|
BASE_SCOPES =(
|
|
"",
|
|
"accounts",
|
|
"blocks",
|
|
"bookmarks",
|
|
"favourites",
|
|
"filters",
|
|
"follows",
|
|
"lists",
|
|
"mutes",
|
|
"notifictions",
|
|
"search",
|
|
"statuses",
|
|
)
|
|
|
|
ADMIN_SCOPES = (
|
|
"",
|
|
"accounts",
|
|
"canonical_email_blocks",
|
|
"domin_allows",
|
|
"domain_blocks",
|
|
"email_domain_blocks",
|
|
"ip_blocks",
|
|
"reports"
|
|
)
|
|
|
|
EXTRA_SCOPES = (
|
|
"follow",
|
|
"push",
|
|
"crypto"
|
|
)
|
|
|
|
SCOPES = tuple(
|
|
item for tup in (
|
|
(":".join(["read", scope]) for scope in BASE_SCOPES),
|
|
(":".join(["write", scope]) for scope in BASE_SCOPES),
|
|
(":".join(["admin", "read", scope]) for scope in ADMIN_SCOPES),
|
|
(":".join(["admin", "write", scope]) for scope in ADMIN_SCOPES),
|
|
EXTRA_SCOPES
|
|
) for item in tup
|
|
)
|
|
|
|
#
|
|
# class SCOPES(StrEnum):
|
|
# read = BASE_SCOPES()
|
|
# write = BASE_SCOPES()
|
|
# follow = auto()
|
|
# push = auto()
|
|
# crypto = auto()
|
|
#
|
|
# class admin(StrEnum):
|
|
# read = ADMIN_SCOPES
|
|
# write = ADMIN_SCOPES
|