fix: Resolve 75 compile errors across 13 backend files

Remove deprecated #[axum::async_trait] from 2 middleware files (native
async traits on Rust 1.88+). Fix 71 stub handlers: change return type
from ApiResult<impl IntoResponse> to ApiResult<Json<Value>> and replace
todo!() with proper JSON stub responses. Clean compile, zero errors.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Vantz Stockwell
2026-02-15 01:03:36 -05:00
parent a6db98f198
commit cb6cb8fb45
13 changed files with 157 additions and 159 deletions

View File

@@ -2,7 +2,7 @@ use std::sync::Arc;
use axum::{ use axum::{
routing::{get, post, put}, routing::{get, post, put},
Router, Json, Router,
}; };
use crate::models::error::ApiResult; use crate::models::error::ApiResult;
@@ -17,22 +17,22 @@ pub fn router() -> Router<Arc<AppState>> {
.route("/custom-domain", put(update_custom_domain)) .route("/custom-domain", put(update_custom_domain))
} }
async fn get_license_info() -> ApiResult<impl axum::response::IntoResponse> { async fn get_license_info() -> ApiResult<Json<serde_json::Value>> {
todo!() Ok(Json(serde_json::json!({"status": "not_implemented"})))
} }
async fn activate_license() -> ApiResult<impl axum::response::IntoResponse> { async fn activate_license() -> ApiResult<Json<serde_json::Value>> {
todo!() Ok(Json(serde_json::json!({"status": "not_implemented"})))
} }
async fn check_in() -> ApiResult<impl axum::response::IntoResponse> { async fn check_in() -> ApiResult<Json<serde_json::Value>> {
todo!() Ok(Json(serde_json::json!({"status": "not_implemented"})))
} }
async fn update_subdomain() -> ApiResult<impl axum::response::IntoResponse> { async fn update_subdomain() -> ApiResult<Json<serde_json::Value>> {
todo!() Ok(Json(serde_json::json!({"status": "not_implemented"})))
} }
async fn update_custom_domain() -> ApiResult<impl axum::response::IntoResponse> { async fn update_custom_domain() -> ApiResult<Json<serde_json::Value>> {
todo!() Ok(Json(serde_json::json!({"status": "not_implemented"})))
} }

View File

@@ -2,7 +2,7 @@ use std::sync::Arc;
use axum::{ use axum::{
routing::get, routing::get,
Router, Json, Router,
}; };
use crate::models::error::ApiResult; use crate::models::error::ApiResult;
@@ -14,10 +14,10 @@ pub fn router() -> Router<Arc<AppState>> {
.route("/export", get(export_logs)) .route("/export", get(export_logs))
} }
async fn query_logs() -> ApiResult<impl axum::response::IntoResponse> { async fn query_logs() -> ApiResult<Json<serde_json::Value>> {
todo!() Ok(Json(serde_json::json!({"status": "not_implemented"})))
} }
async fn export_logs() -> ApiResult<impl axum::response::IntoResponse> { async fn export_logs() -> ApiResult<Json<serde_json::Value>> {
todo!() Ok(Json(serde_json::json!({"status": "not_implemented"})))
} }

View File

@@ -2,7 +2,7 @@ use std::sync::Arc;
use axum::{ use axum::{
routing::{delete, get, post, put}, routing::{delete, get, post, put},
Router, Json, Router,
}; };
use crate::models::error::ApiResult; use crate::models::error::ApiResult;
@@ -19,30 +19,30 @@ pub fn router() -> Router<Arc<AppState>> {
.route("/rotation/{server_id}", put(update_map_rotation)) .route("/rotation/{server_id}", put(update_map_rotation))
} }
async fn list_maps() -> ApiResult<impl axum::response::IntoResponse> { async fn list_maps() -> ApiResult<Json<serde_json::Value>> {
todo!() Ok(Json(serde_json::json!({"status": "not_implemented"})))
} }
async fn upload_map() -> ApiResult<impl axum::response::IntoResponse> { async fn upload_map() -> ApiResult<Json<serde_json::Value>> {
todo!() Ok(Json(serde_json::json!({"status": "not_implemented"})))
} }
async fn get_map() -> ApiResult<impl axum::response::IntoResponse> { async fn get_map() -> ApiResult<Json<serde_json::Value>> {
todo!() Ok(Json(serde_json::json!({"status": "not_implemented"})))
} }
async fn delete_map() -> ApiResult<impl axum::response::IntoResponse> { async fn delete_map() -> ApiResult<Json<serde_json::Value>> {
todo!() Ok(Json(serde_json::json!({"status": "not_implemented"})))
} }
async fn download_map() -> ApiResult<impl axum::response::IntoResponse> { async fn download_map() -> ApiResult<Json<serde_json::Value>> {
todo!() Ok(Json(serde_json::json!({"status": "not_implemented"})))
} }
async fn get_map_rotation() -> ApiResult<impl axum::response::IntoResponse> { async fn get_map_rotation() -> ApiResult<Json<serde_json::Value>> {
todo!() Ok(Json(serde_json::json!({"status": "not_implemented"})))
} }
async fn update_map_rotation() -> ApiResult<impl axum::response::IntoResponse> { async fn update_map_rotation() -> ApiResult<Json<serde_json::Value>> {
todo!() Ok(Json(serde_json::json!({"status": "not_implemented"})))
} }

View File

@@ -2,7 +2,7 @@ use std::sync::Arc;
use axum::{ use axum::{
routing::{get, post, put}, routing::{get, post, put},
Router, Json, Router,
}; };
use crate::models::error::ApiResult; use crate::models::error::ApiResult;
@@ -16,18 +16,18 @@ pub fn router() -> Router<Arc<AppState>> {
.route("/test/pushbullet", post(test_pushbullet)) .route("/test/pushbullet", post(test_pushbullet))
} }
async fn get_notification_config() -> ApiResult<impl axum::response::IntoResponse> { async fn get_notification_config() -> ApiResult<Json<serde_json::Value>> {
todo!() Ok(Json(serde_json::json!({"status": "not_implemented"})))
} }
async fn update_notification_config() -> ApiResult<impl axum::response::IntoResponse> { async fn update_notification_config() -> ApiResult<Json<serde_json::Value>> {
todo!() Ok(Json(serde_json::json!({"status": "not_implemented"})))
} }
async fn test_discord() -> ApiResult<impl axum::response::IntoResponse> { async fn test_discord() -> ApiResult<Json<serde_json::Value>> {
todo!() Ok(Json(serde_json::json!({"status": "not_implemented"})))
} }
async fn test_pushbullet() -> ApiResult<impl axum::response::IntoResponse> { async fn test_pushbullet() -> ApiResult<Json<serde_json::Value>> {
todo!() Ok(Json(serde_json::json!({"status": "not_implemented"})))
} }

View File

@@ -2,7 +2,7 @@ use std::sync::Arc;
use axum::{ use axum::{
routing::{delete, get, post, put}, routing::{delete, get, post, put},
Router, Json, Router,
}; };
use crate::models::error::ApiResult; use crate::models::error::ApiResult;
@@ -18,26 +18,26 @@ pub fn router() -> Router<Arc<AppState>> {
.route("/{id}/discover", get(discover_panel)) .route("/{id}/discover", get(discover_panel))
} }
async fn list_panels() -> ApiResult<impl axum::response::IntoResponse> { async fn list_panels() -> ApiResult<Json<serde_json::Value>> {
todo!() Ok(Json(serde_json::json!({"status": "not_implemented"})))
} }
async fn create_panel() -> ApiResult<impl axum::response::IntoResponse> { async fn create_panel() -> ApiResult<Json<serde_json::Value>> {
todo!() Ok(Json(serde_json::json!({"status": "not_implemented"})))
} }
async fn update_panel() -> ApiResult<impl axum::response::IntoResponse> { async fn update_panel() -> ApiResult<Json<serde_json::Value>> {
todo!() Ok(Json(serde_json::json!({"status": "not_implemented"})))
} }
async fn delete_panel() -> ApiResult<impl axum::response::IntoResponse> { async fn delete_panel() -> ApiResult<Json<serde_json::Value>> {
todo!() Ok(Json(serde_json::json!({"status": "not_implemented"})))
} }
async fn test_panel() -> ApiResult<impl axum::response::IntoResponse> { async fn test_panel() -> ApiResult<Json<serde_json::Value>> {
todo!() Ok(Json(serde_json::json!({"status": "not_implemented"})))
} }
async fn discover_panel() -> ApiResult<impl axum::response::IntoResponse> { async fn discover_panel() -> ApiResult<Json<serde_json::Value>> {
todo!() Ok(Json(serde_json::json!({"status": "not_implemented"})))
} }

View File

@@ -2,7 +2,7 @@ use std::sync::Arc;
use axum::{ use axum::{
routing::{delete, get, post, put}, routing::{delete, get, post, put},
Router, Json, Router,
}; };
use crate::models::error::ApiResult; use crate::models::error::ApiResult;
@@ -18,26 +18,26 @@ pub fn router() -> Router<Arc<AppState>> {
.route("/search", get(search_umod)) .route("/search", get(search_umod))
} }
async fn list_plugins() -> ApiResult<impl axum::response::IntoResponse> { async fn list_plugins() -> ApiResult<Json<serde_json::Value>> {
todo!() Ok(Json(serde_json::json!({"status": "not_implemented"})))
} }
async fn install_plugin() -> ApiResult<impl axum::response::IntoResponse> { async fn install_plugin() -> ApiResult<Json<serde_json::Value>> {
todo!() Ok(Json(serde_json::json!({"status": "not_implemented"})))
} }
async fn update_plugin() -> ApiResult<impl axum::response::IntoResponse> { async fn update_plugin() -> ApiResult<Json<serde_json::Value>> {
todo!() Ok(Json(serde_json::json!({"status": "not_implemented"})))
} }
async fn delete_plugin() -> ApiResult<impl axum::response::IntoResponse> { async fn delete_plugin() -> ApiResult<Json<serde_json::Value>> {
todo!() Ok(Json(serde_json::json!({"status": "not_implemented"})))
} }
async fn reload_plugin() -> ApiResult<impl axum::response::IntoResponse> { async fn reload_plugin() -> ApiResult<Json<serde_json::Value>> {
todo!() Ok(Json(serde_json::json!({"status": "not_implemented"})))
} }
async fn search_umod() -> ApiResult<impl axum::response::IntoResponse> { async fn search_umod() -> ApiResult<Json<serde_json::Value>> {
todo!() Ok(Json(serde_json::json!({"status": "not_implemented"})))
} }

View File

@@ -2,7 +2,7 @@ use std::sync::Arc;
use axum::{ use axum::{
routing::get, routing::get,
Router, Json, Router,
}; };
use crate::models::error::ApiResult; use crate::models::error::ApiResult;
@@ -21,38 +21,38 @@ pub fn router() -> Router<Arc<AppState>> {
.route("/servers/{id}/store", get(get_store)) .route("/servers/{id}/store", get(get_store))
} }
async fn list_public_servers() -> ApiResult<impl axum::response::IntoResponse> { async fn list_public_servers() -> ApiResult<Json<serde_json::Value>> {
todo!() Ok(Json(serde_json::json!({"status": "not_implemented"})))
} }
async fn get_public_server() -> ApiResult<impl axum::response::IntoResponse> { async fn get_public_server() -> ApiResult<Json<serde_json::Value>> {
todo!() Ok(Json(serde_json::json!({"status": "not_implemented"})))
} }
async fn get_wipe_schedule() -> ApiResult<impl axum::response::IntoResponse> { async fn get_wipe_schedule() -> ApiResult<Json<serde_json::Value>> {
todo!() Ok(Json(serde_json::json!({"status": "not_implemented"})))
} }
async fn get_countdown() -> ApiResult<impl axum::response::IntoResponse> { async fn get_countdown() -> ApiResult<Json<serde_json::Value>> {
todo!() Ok(Json(serde_json::json!({"status": "not_implemented"})))
} }
async fn get_current_map() -> ApiResult<impl axum::response::IntoResponse> { async fn get_current_map() -> ApiResult<Json<serde_json::Value>> {
todo!() Ok(Json(serde_json::json!({"status": "not_implemented"})))
} }
async fn get_players() -> ApiResult<impl axum::response::IntoResponse> { async fn get_players() -> ApiResult<Json<serde_json::Value>> {
todo!() Ok(Json(serde_json::json!({"status": "not_implemented"})))
} }
async fn get_mods() -> ApiResult<impl axum::response::IntoResponse> { async fn get_mods() -> ApiResult<Json<serde_json::Value>> {
todo!() Ok(Json(serde_json::json!({"status": "not_implemented"})))
} }
async fn get_motd() -> ApiResult<impl axum::response::IntoResponse> { async fn get_motd() -> ApiResult<Json<serde_json::Value>> {
todo!() Ok(Json(serde_json::json!({"status": "not_implemented"})))
} }
async fn get_store() -> ApiResult<impl axum::response::IntoResponse> { async fn get_store() -> ApiResult<Json<serde_json::Value>> {
todo!() Ok(Json(serde_json::json!({"status": "not_implemented"})))
} }

View File

@@ -2,7 +2,7 @@ use std::sync::Arc;
use axum::{ use axum::{
routing::{delete, get, post, put}, routing::{delete, get, post, put},
Router, Json, Router,
}; };
use crate::models::error::ApiResult; use crate::models::error::ApiResult;
@@ -20,34 +20,34 @@ pub fn router() -> Router<Arc<AppState>> {
.route("/conflicts", get(get_conflicts)) .route("/conflicts", get(get_conflicts))
} }
async fn list_schedules() -> ApiResult<impl axum::response::IntoResponse> { async fn list_schedules() -> ApiResult<Json<serde_json::Value>> {
todo!() Ok(Json(serde_json::json!({"status": "not_implemented"})))
} }
async fn create_schedule() -> ApiResult<impl axum::response::IntoResponse> { async fn create_schedule() -> ApiResult<Json<serde_json::Value>> {
todo!() Ok(Json(serde_json::json!({"status": "not_implemented"})))
} }
async fn get_schedule() -> ApiResult<impl axum::response::IntoResponse> { async fn get_schedule() -> ApiResult<Json<serde_json::Value>> {
todo!() Ok(Json(serde_json::json!({"status": "not_implemented"})))
} }
async fn update_schedule() -> ApiResult<impl axum::response::IntoResponse> { async fn update_schedule() -> ApiResult<Json<serde_json::Value>> {
todo!() Ok(Json(serde_json::json!({"status": "not_implemented"})))
} }
async fn delete_schedule() -> ApiResult<impl axum::response::IntoResponse> { async fn delete_schedule() -> ApiResult<Json<serde_json::Value>> {
todo!() Ok(Json(serde_json::json!({"status": "not_implemented"})))
} }
async fn toggle_schedule() -> ApiResult<impl axum::response::IntoResponse> { async fn toggle_schedule() -> ApiResult<Json<serde_json::Value>> {
todo!() Ok(Json(serde_json::json!({"status": "not_implemented"})))
} }
async fn get_calendar() -> ApiResult<impl axum::response::IntoResponse> { async fn get_calendar() -> ApiResult<Json<serde_json::Value>> {
todo!() Ok(Json(serde_json::json!({"status": "not_implemented"})))
} }
async fn get_conflicts() -> ApiResult<impl axum::response::IntoResponse> { async fn get_conflicts() -> ApiResult<Json<serde_json::Value>> {
todo!() Ok(Json(serde_json::json!({"status": "not_implemented"})))
} }

View File

@@ -2,7 +2,7 @@ use std::sync::Arc;
use axum::{ use axum::{
routing::{delete, get, post, put}, routing::{delete, get, post, put},
Router, Json, Router,
}; };
use crate::models::error::ApiResult; use crate::models::error::ApiResult;
@@ -24,50 +24,50 @@ pub fn router() -> Router<Arc<AppState>> {
.route("/webhook/paypal", post(paypal_webhook)) .route("/webhook/paypal", post(paypal_webhook))
} }
async fn get_store_config() -> ApiResult<impl axum::response::IntoResponse> { async fn get_store_config() -> ApiResult<Json<serde_json::Value>> {
todo!() Ok(Json(serde_json::json!({"status": "not_implemented"})))
} }
async fn update_store_config() -> ApiResult<impl axum::response::IntoResponse> { async fn update_store_config() -> ApiResult<Json<serde_json::Value>> {
todo!() Ok(Json(serde_json::json!({"status": "not_implemented"})))
} }
async fn list_categories() -> ApiResult<impl axum::response::IntoResponse> { async fn list_categories() -> ApiResult<Json<serde_json::Value>> {
todo!() Ok(Json(serde_json::json!({"status": "not_implemented"})))
} }
async fn create_category() -> ApiResult<impl axum::response::IntoResponse> { async fn create_category() -> ApiResult<Json<serde_json::Value>> {
todo!() Ok(Json(serde_json::json!({"status": "not_implemented"})))
} }
async fn update_category() -> ApiResult<impl axum::response::IntoResponse> { async fn update_category() -> ApiResult<Json<serde_json::Value>> {
todo!() Ok(Json(serde_json::json!({"status": "not_implemented"})))
} }
async fn delete_category() -> ApiResult<impl axum::response::IntoResponse> { async fn delete_category() -> ApiResult<Json<serde_json::Value>> {
todo!() Ok(Json(serde_json::json!({"status": "not_implemented"})))
} }
async fn list_items() -> ApiResult<impl axum::response::IntoResponse> { async fn list_items() -> ApiResult<Json<serde_json::Value>> {
todo!() Ok(Json(serde_json::json!({"status": "not_implemented"})))
} }
async fn create_item() -> ApiResult<impl axum::response::IntoResponse> { async fn create_item() -> ApiResult<Json<serde_json::Value>> {
todo!() Ok(Json(serde_json::json!({"status": "not_implemented"})))
} }
async fn update_item() -> ApiResult<impl axum::response::IntoResponse> { async fn update_item() -> ApiResult<Json<serde_json::Value>> {
todo!() Ok(Json(serde_json::json!({"status": "not_implemented"})))
} }
async fn delete_item() -> ApiResult<impl axum::response::IntoResponse> { async fn delete_item() -> ApiResult<Json<serde_json::Value>> {
todo!() Ok(Json(serde_json::json!({"status": "not_implemented"})))
} }
async fn list_transactions() -> ApiResult<impl axum::response::IntoResponse> { async fn list_transactions() -> ApiResult<Json<serde_json::Value>> {
todo!() Ok(Json(serde_json::json!({"status": "not_implemented"})))
} }
async fn paypal_webhook() -> ApiResult<impl axum::response::IntoResponse> { async fn paypal_webhook() -> ApiResult<Json<serde_json::Value>> {
todo!() Ok(Json(serde_json::json!({"status": "not_implemented"})))
} }

View File

@@ -2,7 +2,7 @@ use std::sync::Arc;
use axum::{ use axum::{
routing::{delete, get, post, put}, routing::{delete, get, post, put},
Router, Json, Router,
}; };
use crate::models::error::ApiResult; use crate::models::error::ApiResult;
@@ -20,34 +20,34 @@ pub fn router() -> Router<Arc<AppState>> {
.route("/roles/{id}", delete(delete_role)) .route("/roles/{id}", delete(delete_role))
} }
async fn list_members() -> ApiResult<impl axum::response::IntoResponse> { async fn list_members() -> ApiResult<Json<serde_json::Value>> {
todo!() Ok(Json(serde_json::json!({"status": "not_implemented"})))
} }
async fn invite_member() -> ApiResult<impl axum::response::IntoResponse> { async fn invite_member() -> ApiResult<Json<serde_json::Value>> {
todo!() Ok(Json(serde_json::json!({"status": "not_implemented"})))
} }
async fn update_member_role() -> ApiResult<impl axum::response::IntoResponse> { async fn update_member_role() -> ApiResult<Json<serde_json::Value>> {
todo!() Ok(Json(serde_json::json!({"status": "not_implemented"})))
} }
async fn remove_member() -> ApiResult<impl axum::response::IntoResponse> { async fn remove_member() -> ApiResult<Json<serde_json::Value>> {
todo!() Ok(Json(serde_json::json!({"status": "not_implemented"})))
} }
async fn list_roles() -> ApiResult<impl axum::response::IntoResponse> { async fn list_roles() -> ApiResult<Json<serde_json::Value>> {
todo!() Ok(Json(serde_json::json!({"status": "not_implemented"})))
} }
async fn create_role() -> ApiResult<impl axum::response::IntoResponse> { async fn create_role() -> ApiResult<Json<serde_json::Value>> {
todo!() Ok(Json(serde_json::json!({"status": "not_implemented"})))
} }
async fn update_role() -> ApiResult<impl axum::response::IntoResponse> { async fn update_role() -> ApiResult<Json<serde_json::Value>> {
todo!() Ok(Json(serde_json::json!({"status": "not_implemented"})))
} }
async fn delete_role() -> ApiResult<impl axum::response::IntoResponse> { async fn delete_role() -> ApiResult<Json<serde_json::Value>> {
todo!() Ok(Json(serde_json::json!({"status": "not_implemented"})))
} }

View File

@@ -2,7 +2,7 @@ use std::sync::Arc;
use axum::{ use axum::{
routing::{get, post}, routing::{get, post},
Router, Json, Router,
}; };
use crate::models::error::ApiResult; use crate::models::error::ApiResult;
@@ -18,26 +18,26 @@ pub fn router() -> Router<Arc<AppState>> {
.route("/history/{id}", get(get_wipe_history_detail)) .route("/history/{id}", get(get_wipe_history_detail))
} }
async fn trigger_wipe() -> ApiResult<impl axum::response::IntoResponse> { async fn trigger_wipe() -> ApiResult<Json<serde_json::Value>> {
todo!() Ok(Json(serde_json::json!({"status": "not_implemented"})))
} }
async fn dry_run_wipe() -> ApiResult<impl axum::response::IntoResponse> { async fn dry_run_wipe() -> ApiResult<Json<serde_json::Value>> {
todo!() Ok(Json(serde_json::json!({"status": "not_implemented"})))
} }
async fn rollback_wipe() -> ApiResult<impl axum::response::IntoResponse> { async fn rollback_wipe() -> ApiResult<Json<serde_json::Value>> {
todo!() Ok(Json(serde_json::json!({"status": "not_implemented"})))
} }
async fn get_wipe_status() -> ApiResult<impl axum::response::IntoResponse> { async fn get_wipe_status() -> ApiResult<Json<serde_json::Value>> {
todo!() Ok(Json(serde_json::json!({"status": "not_implemented"})))
} }
async fn get_wipe_history() -> ApiResult<impl axum::response::IntoResponse> { async fn get_wipe_history() -> ApiResult<Json<serde_json::Value>> {
todo!() Ok(Json(serde_json::json!({"status": "not_implemented"})))
} }
async fn get_wipe_history_detail() -> ApiResult<impl axum::response::IntoResponse> { async fn get_wipe_history_detail() -> ApiResult<Json<serde_json::Value>> {
todo!() Ok(Json(serde_json::json!({"status": "not_implemented"})))
} }

View File

@@ -17,7 +17,6 @@ pub struct AuthUser {
pub role: Option<String>, pub role: Option<String>,
} }
#[axum::async_trait]
impl FromRequestParts<Arc<AppState>> for AuthUser { impl FromRequestParts<Arc<AppState>> for AuthUser {
type Rejection = http::StatusCode; type Rejection = http::StatusCode;

View File

@@ -19,7 +19,6 @@ pub struct ValidLicense {
// - Populate the modules list for downstream permission checks // - Populate the modules list for downstream permission checks
// - Return 403 Forbidden if the license is invalid, expired, or suspended // - Return 403 Forbidden if the license is invalid, expired, or suspended
#[axum::async_trait]
impl<S> FromRequestParts<S> for ValidLicense impl<S> FromRequestParts<S> for ValidLicense
where where
S: Send + Sync, S: Send + Sync,