Skip to content

Commit 6a021bf

Browse files
committed
Updated docstrings for auth
1 parent 4860285 commit 6a021bf

File tree

2 files changed

+16
-2
lines changed

2 files changed

+16
-2
lines changed

src/auth/interface.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
1-
"""Abstract base class for authentication methods."""
1+
"""Abstract base class for all authentication method implementations.
2+
3+
Defines the abstract base class used by all authentication method implementations.
4+
Contract: subclasses must implement `__call__(request: Request) -> AuthTuple`
5+
where `AuthTuple = (UserID, UserName, Token)`.
6+
"""
27

38
from abc import ABC, abstractmethod
49

src/auth/noop_with_token.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,13 @@
1-
"""Manage authentication flow for FastAPI endpoints with no-op auth."""
1+
"""Manage authentication flow for FastAPI endpoints with no-op auth and provided user token.
2+
3+
Intended for local/dev use only — do not use in production.
4+
5+
Behavior:
6+
- Reads a user token from request headers via `auth.utils.extract_user_token`.
7+
- Reads `user_id` from query params (falls back to `DEFAULT_USER_UID`) and
8+
pairs it with `DEFAULT_USER_NAME`.
9+
- Returns a tuple: (user_id, DEFAULT_USER_NAME, user_token).
10+
"""
211

312
import logging
413

0 commit comments

Comments
 (0)