2023-10-10 22:13:47 +02:00
|
|
|
from fastapi import APIRouter
|
|
|
|
|
2023-10-11 23:45:12 +02:00
|
|
|
fake_users = [
|
|
|
|
# password foo
|
|
|
|
{'id': 1, 'username': 'admin', 'password': '$2b$12$N.i74Kle18n5Toxhas.rVOjZreVC2WM34fCidNDyhSNgxVlbKwX7i',
|
|
|
|
'permissions': ['items:read', 'items:write', 'users:read', 'users:write']
|
|
|
|
},
|
|
|
|
# password bar
|
|
|
|
{'id': 2, 'username': 'client', 'password': '$2b$12$KUgpw1m0LF/s9NS1ZB5rRO2cA5D13MqRm56ab7ik2ixftXW/aqEyq',
|
|
|
|
'permissions': ['items:read']}
|
|
|
|
]
|
|
|
|
|
2023-10-10 22:13:47 +02:00
|
|
|
router = APIRouter()
|
|
|
|
|
|
|
|
@router.get("/users/", tags=["users"])
|
|
|
|
async def read_users():
|
|
|
|
return [{"username":"toto"}]
|