Files
ad/molodetz/docs_api/account.py
T

30 lines
1.8 KiB
Python
Raw Normal View History

2026-10-05 09:36:20 +02:00
# retoor <retoor@molodetz.nl>
from molodetz.docs_api.registry import endpoint, field
GROUP = {
"slug": "account",
"title": "Account",
"description": "Session login, API key, notifications. No JWT, no OAuth.",
2026-10-05 09:36:20 +02:00
"endpoints": [
endpoint("GET", "/auth/login", "Login page", sample={"errors": [], "next": "/admin"}),
2026-10-05 09:36:20 +02:00
endpoint(
"POST",
"/auth/login",
"Log in",
"Sets an httponly session cookie (7 days, 30 with remember me).",
2026-10-05 09:36:20 +02:00
fields=[field("username", required=True, example="{{username}}"), field("password", required=True, type="password"), field("remember", type="boolean")],
sample={"ok": True, "redirect": "/admin", "data": None},
interactive=False,
),
endpoint("POST", "/auth/logout", "Log out", sample={"ok": True, "redirect": "/", "data": None}, interactive=False),
endpoint("GET", "/profile/api-key", "View API key", auth="member", sample={"api_key": "{{api_key}}"}),
endpoint("POST", "/profile/api-key/regenerate", "Renew API key", auth="member", destructive=True, sample={"ok": True, "redirect": "/profile/api-key", "data": {"api_key": "..."}}, interactive=False),
endpoint("POST", "/profile/avatar/regenerate", "Renew avatar", auth="member", destructive=True, sample={"ok": True}, interactive=False),
endpoint("GET", "/notifications", "Notifications", auth="member", sample={"notifications": [], "unread": 0}),
endpoint("POST", "/notifications/read", "Mark all read", auth="member", sample={"ok": True, "redirect": "/notifications"}),
endpoint("GET", "/terms", "Terms", sample={"title": "Terms"}),
endpoint("POST", "/terms/accept", "Accept terms", auth="member", sample={"ok": True, "redirect": "/"}),
2026-10-05 09:36:20 +02:00
endpoint("GET", "/privacy", "Privacy", sample={"title": "Privacy"}),
],
}