aiohttp-security/demo/dictionary_auth/users.py

16 lines
301 B
Python
Raw Permalink Normal View History

2020-12-18 17:58:38 +00:00
from typing import NamedTuple, Tuple
class User(NamedTuple):
username: str
password: str
permissions: Tuple[str, ...]
user_map = {
user.username: user for user in [
User('devin', 'password', ('public',)),
User('jack', 'password', ('public', 'protected',)),
]
}