Add group foundation (#16935)

Add group foundation
This commit is contained in:
Paulus Schoutsen 2018-10-08 16:35:38 +02:00 committed by GitHub
parent dd55ff87c8
commit c3b1121d77
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 186 additions and 5 deletions

View file

@ -14,6 +14,14 @@ TOKEN_TYPE_SYSTEM = 'system'
TOKEN_TYPE_LONG_LIVED_ACCESS_TOKEN = 'long_lived_access_token'
@attr.s(slots=True)
class Group:
"""A group."""
name = attr.ib(type=str) # type: Optional[str]
id = attr.ib(type=str, factory=lambda: uuid.uuid4().hex)
@attr.s(slots=True)
class User:
"""A user."""
@ -24,6 +32,8 @@ class User:
is_active = attr.ib(type=bool, default=False)
system_generated = attr.ib(type=bool, default=False)
groups = attr.ib(type=List, factory=list, cmp=False) # type: List[Group]
# List of credentials of a user.
credentials = attr.ib(
type=list, factory=list, cmp=False