Skip to content

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

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

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions