from fastapi import APIRouter 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']} ] router = APIRouter() @router.get("/users/", tags=["users"]) async def read_users(): return [{"username":"toto"}]