Apply cargo fmt formatting to fix CI/CD fmt job
This commit is contained in:
@ -2,13 +2,13 @@
|
||||
//!
|
||||
//! Aggregates all endpoint routes and configures the Actix-web application.
|
||||
|
||||
use actix_web::{web, HttpResponse, http::Method};
|
||||
use actix_web::{http::Method, web, HttpResponse};
|
||||
use tracing::info;
|
||||
|
||||
use crate::packages::create_backend;
|
||||
use crate::jobs::manager::JobManager;
|
||||
use crate::packages::create_backend;
|
||||
|
||||
use super::handlers::{packages, patches, system, jobs, websocket};
|
||||
use super::handlers::{jobs, packages, patches, system, websocket};
|
||||
|
||||
/// Default service handler for unsupported HTTP methods (VULN-005)
|
||||
/// Returns 405 Method Not Allowed instead of 404 for known endpoints
|
||||
@ -25,23 +25,21 @@ pub fn configure_api_routes(
|
||||
) {
|
||||
info!("Configuring API v1 routes");
|
||||
|
||||
cfg.app_data(job_manager)
|
||||
.app_data(backend)
|
||||
.service(
|
||||
web::scope("/api/v1")
|
||||
// VULN-005: Default handler for unsupported methods returns 405 instead of 404
|
||||
.default_service(web::route().to(method_not_allowed))
|
||||
// Package Management Endpoints
|
||||
.configure(packages::configure_routes)
|
||||
// Patch Management Endpoints
|
||||
.configure(patches::configure_routes)
|
||||
// System Management Endpoints
|
||||
.configure(system::configure_routes)
|
||||
// Job Management Endpoints
|
||||
.configure(jobs::configure_routes)
|
||||
// WebSocket Endpoint
|
||||
.configure(websocket::configure_routes),
|
||||
);
|
||||
cfg.app_data(job_manager).app_data(backend).service(
|
||||
web::scope("/api/v1")
|
||||
// VULN-005: Default handler for unsupported methods returns 405 instead of 404
|
||||
.default_service(web::route().to(method_not_allowed))
|
||||
// Package Management Endpoints
|
||||
.configure(packages::configure_routes)
|
||||
// Patch Management Endpoints
|
||||
.configure(patches::configure_routes)
|
||||
// System Management Endpoints
|
||||
.configure(system::configure_routes)
|
||||
// Job Management Endpoints
|
||||
.configure(jobs::configure_routes)
|
||||
// WebSocket Endpoint
|
||||
.configure(websocket::configure_routes),
|
||||
);
|
||||
}
|
||||
|
||||
/// Health check route (outside API scope for load balancer checks)
|
||||
|
||||
Reference in New Issue
Block a user