Skip to content

SI-2: Migrate whitelist context to contract-first architecture #1940

Closed

Description

@josecelano

Subissue of EPIC #1938 — REST API Contract-First Migration

Problem

The whitelist context (add_torrent_to_whitelist, remove_torrent_from_whitelist, reload_whitelist handlers) in axum-rest-api-server currently calls tracker_core::whitelist::manager::WhitelistManager directly. It has no protocol DTOs, no port trait, and no use-case service.

Per the contract-first architecture, the migration needs a whitelist command port, a runtime adapter wrapping WhitelistManager, and rewired Axum handlers.

Scope

  • Define WhitelistCommandPort trait in rest-api-application/src/ports/
  • Implement WhitelistApiService use-case in rest-api-application/src/use_cases/
  • Implement TrackerWhitelistAdapter in rest-api-runtime-adapter/src/adapters/
  • Rewire Axum handlers to dispatch through use-case
  • Update Axum state/routes to wire the new adapter

Checklist

  • WhitelistCommandPort trait defined in rest-api-application
  • WhitelistApiService use-case implemented
  • TrackerWhitelistAdapter implemented in rest-api-runtime-adapter
  • Axum handlers dispatch through use-case instead of direct WhitelistManager
  • Pre-commit checks pass
  • Pre-push checks pass

Activity

  1. self-assigned this
    on Jun 24, 2026
  2. added
    Code Cleanup / Refactoring
    - Developer -
    API
    on Jun 24, 2026
  3. added 2 commits that reference this issue on Jun 24, 2026
  4. josecelano commented on Jun 26, 2026

    @josecelano
    MemberAuthor

    Implemented via #1947

  5. added a commit that references this issue on Jun 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

- Developer -APICode Cleanup / Refactoringtask

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions