Update the API to use new naming matching database.

This commit is contained in:
Leo Vasanko
2026-01-27 02:22:29 +00:00
parent db104d762b
commit 2413a32bda
12 changed files with 40 additions and 40 deletions
+3 -3
View File
@@ -99,7 +99,7 @@ async def admin_list_orgs(request: Request, auth=AUTH_COOKIE):
def role_to_dict(r):
return {
"uuid": str(r.uuid),
"org_uuid": str(r.org_uuid),
"org": str(r.org),
"display_name": r.display_name,
"permissions": r.permissions,
}
@@ -600,7 +600,7 @@ async def admin_get_user_detail(
aaguids.add(aaguid_str)
creds.append(
{
"credential_uuid": str(c.uuid),
"credential": str(c.uuid),
"aaguid": aaguid_str,
"created_at": (
c.created_at.astimezone(timezone.utc)
@@ -656,7 +656,7 @@ async def admin_get_user_detail(
sessions_payload.append(
{
"id": entry.key,
"credential_uuid": str(entry.credential_uuid),
"credential": str(entry.credential),
"host": entry.host,
"ip": entry.ip,
"user_agent": useragent.compact_user_agent(entry.user_agent),
+1 -1
View File
@@ -268,5 +268,5 @@ async def api_set_session(
session.set_session_cookie(response, auth.credentials)
return {
"message": "Session cookie set successfully",
"user_uuid": str(user.user_uuid),
"user": str(user.user),
}
+1 -1
View File
@@ -179,7 +179,7 @@ async def websocket_remote_auth_request(ws: WebSocket):
):
response = {
"status": "authenticated",
"user_uuid": str(result_data["user_uuid"]),
"user": str(result_data["user_uuid"]),
}
if result_data.get("session_token"):
response["session_token"] = result_data["session_token"]
+3 -3
View File
@@ -93,8 +93,8 @@ async def websocket_register_add(
assert isinstance(auth, str) and len(auth) == 16
await ws.send_json(
{
"user_uuid": str(user.uuid),
"credential_uuid": str(credential.uuid),
"user": str(user.uuid),
"credential": str(credential.uuid),
"session_token": auth,
"message": "New credential added successfully",
}
@@ -164,7 +164,7 @@ async def websocket_authenticate(ws: WebSocket, auth=AUTH_COOKIE):
await ws.send_json(
{
"user_uuid": str(stored_cred.user),
"user": str(stored_cred.user),
"session_token": token,
}
)