Add init_db script for async database initialization and extensive tests for session management

- Added `init_db.py` to handle async database initialization with the creation of the first superuser if configured.
- Introduced comprehensive tests for session management APIs, including session listing, revocation, and cleanup.
- Enhanced CRUD session logic with UUID utilities and improved error handling.
This commit is contained in:
Felipe Cardoso
2025-11-01 06:10:01 +01:00
parent b8d3248a48
commit a1b11fadcb
3 changed files with 460 additions and 0 deletions

View File

@@ -2,6 +2,7 @@
Async CRUD operations for user sessions using SQLAlchemy 2.0 patterns.
"""
import logging
import uuid
from datetime import datetime, timezone, timedelta
from typing import List, Optional
from uuid import UUID