Skip to content

Remove User.api_v2_token property - #3084

Open
casds-FDXS wants to merge 1 commit into
python:mainfrom
casds-FDXS:fix-3047-remove-api-v2-token
Open

Remove User.api_v2_token property#3084
casds-FDXS wants to merge 1 commit into
python:mainfrom
casds-FDXS:fix-3047-remove-api-v2-token

Conversation

@casds-FDXS

Copy link
Copy Markdown

Description

  • Remove the User.api_v2_token property that returned the plaintext DRF API token.
  • Remove the now-unused Token import from the user model.
  • Update the download API tests to query the DRF Token model explicitly when constructing the authorization header.

This preserves the existing test authentication behavior while removing the plaintext token access path from the general-purpose User model.

Testing:

  • docker compose run --rm web uv run python manage.py test apps.downloads.tests.test_views

    • 78 tests passed.
  • docker compose run --rm web uv run ruff format --check apps/users/models.py apps/downloads/tests/test_views.py

    • 2 files already formatted.
  • docker compose run --rm web uv run ruff check --ignore EXE002 apps/users/models.py apps/downloads/tests/test_views.py

    • All checks passed.

Closes

@casds-FDXS
casds-FDXS requested a review from JacobCoffee as a code owner August 6, 2026 18:29
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.

Hardening: [low-priority] Remove User.api_v2_token property (returns plaintext API token)

1 participant