main
md 47 lines 1.84 KB
Rendered Raw
1 # logout.py DOX
2
3 ## Purpose
4
5 - Own the `logout.py` API endpoint.
6 - This module clears login/session state for the current client.
7 - Keep this file-level DOX profile synchronized with `logout.py` because this directory is intentionally flat.
8
9 ## Ownership
10
11 - `logout.py` owns the runtime implementation.
12 - `logout.py.dox.md` owns durable notes about responsibilities, contracts, side effects, and verification for that implementation.
13 - Classes:
14 - `ApiLogout` (`ApiHandler`)
15 - `requires_auth(cls) -> bool`
16 - `async process(self, input: dict, request: Request) -> dict`
17
18 ## Runtime Contracts
19
20 - HTTP handlers must derive from `helpers.api.ApiHandler`; WebSocket handlers must derive from `helpers.ws.WsHandler`.
21 - Update this file whenever request payloads, authentication or CSRF requirements, response shapes, route side effects, or WebSocket event contracts change.
22 - `ApiLogout` is an `ApiHandler`.
23 - `ApiLogout` defines `process(...)`.
24 - `ApiLogout` defines `requires_auth(...)`.
25 - Observed side-effect areas: secret handling.
26 - Imported dependency areas include: `helpers.api`.
27
28 ## Key Concepts
29
30 - Important called helpers/classes observed in the source: `session.clear`, `session.pop`.
31 - Keep request/response, tool, or helper semantics documented here at the same time as source changes.
32
33 ## Work Guidance
34
35 - Preserve authentication, CSRF, loopback, and API-key checks unless the endpoint contract explicitly changes.
36 - Update frontend callers, plugin callers, and tests together when payload shape changes.
37 - Use `helpers.api.Response` for non-JSON responses, files, redirects, or status-specific replies.
38
39 ## Verification
40
41 - Run endpoint-specific or API/WebSocket tests for changed behavior; smoke-test browser callers when no focused test exists.
42 - Related tests observed by source search:
43 - `tests/test_office_document_store.py`
44
45 ## Child DOX Index
46
47 No child DOX files.