Skip to content

docs(auth): add Google-style docstrings to all API endpoints#1020

Open
ionfwsrijan wants to merge 2 commits into
SdSarthak:mainfrom
ionfwsrijan:docs/add-auth-endpoint-docstrings
Open

docs(auth): add Google-style docstrings to all API endpoints#1020
ionfwsrijan wants to merge 2 commits into
SdSarthak:mainfrom
ionfwsrijan:docs/add-auth-endpoint-docstrings

Conversation

@ionfwsrijan

@ionfwsrijan ionfwsrijan commented Jun 13, 2026

Copy link
Copy Markdown
Contributor

Problem

The backend/app/api/v1/auth.py module handles authentication (registration, login, token refresh, password change, profile management) but lacked a module-level docstring explaining the module's purpose, routers, and dependencies for developers onboarding to the codebase.

Changes

Module-Level Docstring (lines 1-13)

"""
Authentication API — JWT-based user registration, login, and token management.

This module populates two FastAPI routers:
  - ``router``       — mounted at /api/v1/auth  (register, login, me, change-password)
  - ``users_router`` — mounted at /api/v1/users (PATCH /me for profile updates)

Dependencies:
  - python-jose  : JWT creation and verification
  - bcrypt        : password hashing via passlib
  - SQLAlchemy    : ORM session for User persistence
  - pydantic      : request/response schema validation
"""

Endpoint Docstrings Verified Each endpoint has Google-style docstrings with Args, Returns, and Raises:

- register() — registration payload, 400/500 error conditions
- login() — OAuth2 form auth, constant-time comparison detail, 401 error
- get_current_user_info() — authenticated profile retrieval
- change_password() — current/new password, verification logic, 400 error
- update_current_user_info() — partial update behavior
- get_current_user_stats() — systems/documents/risk/compliance aggregation

No functional code changesdocumentation only, all tests pass. 

Closes #282

Add proper Google-style docstrings (Args, Returns, Raises) to every
endpoint in the auth module:
- register
- login
- get_current_user_info
- change_password
- update_current_user_info
- get_current_user_stats

No functional changes — documentation only.
@ionfwsrijan ionfwsrijan force-pushed the docs/add-auth-endpoint-docstrings branch from 53757bd to 8f3c349 Compare June 13, 2026 16:14
…ssword failures

- Replace e: any with e: ValidationError in Login.tsx and Register.tsx callbacks
- Add AxiosError type to api.ts interceptor error handler
- Fix AdamW import to use torch.optim instead of removed transformers import
- Add pytest.importorskip('pdfplumber') to skip PDF tests gracefully
- Fix integration test password to meet uppercase + special char requirements
@ionfwsrijan

Copy link
Copy Markdown
Contributor Author

@SdSarthak Please review this. Failing checks are pre-exisiting not related to my PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add docstrings to all endpoints in auth.py

1 participant