Skip to content

SI-3: Migrate auth_key context to contract-first architecture #1941

Description

@josecelano

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

Problem

The auth_key context has 4 handlers and 7 response functions defined locally in axum-rest-api-server. It calls tracker_core::authentication::{Key, AddKeyRequest, KeysHandler} directly. Local DTOs (AuthKey, AddKeyForm, KeyParam) should live in rest-api-protocol.

Scope

  • Move AuthKey, AddKeyForm, KeyParam DTOs to rest-api-protocol/src/v1/resources/auth_key.rs
  • Define AuthKeyCommandPort trait in rest-api-application/src/ports/
  • Implement AuthKeyApiService use-case
  • Implement TrackerAuthKeyAdapter in rest-api-runtime-adapter wrapping KeysHandler + clock
  • Rewire Axum handlers to use AuthKeyApiService

Checklist

  • Protocol DTOs created and exported
  • AuthKeyCommandPort trait defined
  • AuthKeyApiService use-case implemented
  • TrackerAuthKeyAdapter implemented
  • Axum handlers dispatch through use-case
  • 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