Skip to content

Refactor base CRUD dep

Overview

This merge request enhances our password management system by implementing async session support, upgrading dependencies, and standardizing error handling across the application.

Changes

Async Session Management

  • Added get_session in db_settings.py to provide an async context manager for database sessions
  • Updated password management functions (create_password, get_password, etc.) to use asynchronous sessions
  • Improved database connection handling via session injection

CRUD Operations Refactoring

  • Removed custom BaseCRUD implementation in favor of the common_crud.BaseCRUD
  • Updated PasswordsCRUD to inherit from the standardized base class with service name filtering
  • Removed obsolete test_base_crud.py file

Dependency Updates

  • Upgraded common-crud from 0.1.1 to 0.1.4
  • Updated rsa package from 4.7 to 4.9.1 for better Python compatibility
  • Adjusted path references in dependency management files

Test Improvements

  • Enhanced password API tests to verify proper session parameter passing
  • Refactored password CRUD tests to use CRUDError instead of HTTPException
  • Improved test clarity and consistency with updated error handling

Testing

All tests pass with the new implementations. The async session management has been verified to work correctly with the password CRUD operations.

Merge request reports

Loading