Skip to content

fix: remove unused jwt dependency (duplicate of python-jose)

Rajuldev Vandana requested to merge fix/remove-unused-jwt into develop

Merge Request

Overview

This MR removes the unused jwt dependency from the project to eliminate duplication and reduce unnecessary dependency overhead. The project already uses python-jose for JWT operations, making the standalone jwt package redundant.

What does this MR do and why?

fix: remove unused jwt dependency (duplicate of python-jose)

  • The project had both python-jose and jwt dependencies serving the same purpose.
  • The codebase exclusively uses python-jose (from jose import jwt) for JWT handling.
  • Keeping both increases security risk and dependency footprint.
  • This MR removes the unused jwt package to improve maintainability and reduce attack surface.

Changes Made

  • Removed jwt>=1.4.0 from pyproject.toml
  • Verified no usage of import jwt across the codebase
  • Retained python-jose[cryptography]>=3.3.0 for JWT functionality
  • Synced environment using uv sync to remove unused dependency

Technical Details

  • Root Cause: Duplicate dependency (jwt) existed but was not used anywhere in the codebase.
  • Fix: Removed the redundant dependency after verifying all JWT operations use python-jose.
  • Ensures consistent and secure JWT handling using a single library.

Type of Change

  • 🐛 Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • 💥 Breaking change (fix or feature that would cause existing functionality to change)
  • 📝 Documentation update
  • ️ Refactor (no functional changes)
  • Performance improvement
  • 🧪 Test update
  • 🔧 Configuration change
  • 🚨 Security fix
  • 🗑️ Deprecation (removing deprecated code)

Related Issues / References

Screenshots or Screen Recordings

  • N/A (Dependency cleanup)

How to Validate Locally

  1. Checkout this branch
  2. Install dependencies:
    uv sync
  3. Verify jwt is removed:
    pip list | grep jwt
  4. Run tests:
    uv run pytest
    

Testing Done

Unit tests added/updated API endpoint tests passing

Test Commands Run:

  • uv run pytest tests/test_core/test_auth.py
  • uv run pytest tests/test_middleware/test_auth_middleware.py
  • uv run pytest
Edited by Rajuldev Vandana

Merge request reports

Loading