Skip to content

Make the admin control domain own its handlers and explicit state #47

Description

@tiammomo

Summary

The admin control router owns paths for aliases, settings, configuration reload, Provider probes, and router status, but its handlers and state dependencies remain in the 8,000-line root routes module. Complete this domain slice so registration, handlers, and dependencies have one owner.

Actual behavior

src/routes/admin_control.rs delegates all six control endpoints to functions in src/routes.rs. The handlers extract the process-wide AppState and rely on its temporary Deref bridge, leaving the control domain's dependencies implicit and keeping configuration behavior coupled to the root HTTP shell.

Expected behavior

src/routes/admin_control.rs owns the endpoint handlers and private validation types, and extracts a dedicated Axum FromRef substate containing only the application services used by control operations. The root routes module retains shared cross-domain policy helpers and application composition only.

Steps to reproduce

Inspect src/routes/admin_control.rs and run rg -n 'admin_(aliases|create_alias|delete_alias|settings|reload_config|update_settings|test_provider|router_status)' src/routes.rs src/routes/admin_control.rs. Registrations and implementations have different owners, and the handlers extract State.

Environment

ModelPort main plus the reviewed route-composition and application-state boundary changes from Issues #44 and #46; Rust/Axum 0.8.

Acceptance criteria

  • The admin control module owns all handlers for its existing route inventory; those handlers extract an explicit control-domain substate through Axum FromRef instead of AppState; reusable cross-domain helpers remain centralized without circular module dependencies; architectural regression coverage prevents the handlers from returning to the root routes module; all focused and repository-wide checks pass; no endpoint, response schema, configuration key, persistence format, Provider behavior, dependency, or deployment change is introduced.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions