chore(agent): remove stale unscoped webhook routes from API router (#93)
CI / Check (push) Has been skipped
CI / Detect Changes (push) Successful in 4s
CI / Deploy Dashboard (push) Has been cancelled
CI / Deploy Docs (push) Has been cancelled
CI / Deploy MCP (push) Has been cancelled
CI / Deploy Agent (push) Has been cancelled
CI / Check (push) Has been skipped
CI / Detect Changes (push) Successful in 4s
CI / Deploy Dashboard (push) Has been cancelled
CI / Deploy Docs (push) Has been cancelled
CI / Deploy MCP (push) Has been cancelled
CI / Deploy Agent (push) Has been cancelled
Webhook routes live on the separate webhook server (port 3002). M7.2-C URL form is /webhook/{tenant_id}/{platform}/{repo_id}; mounting unscoped variants on the API router would mismatch handler signatures.
This commit was merged in pull request #93.
This commit is contained in:
@@ -2,7 +2,6 @@ use axum::routing::{delete, get, patch, post};
|
|||||||
use axum::Router;
|
use axum::Router;
|
||||||
|
|
||||||
use crate::api::handlers;
|
use crate::api::handlers;
|
||||||
use crate::webhooks;
|
|
||||||
|
|
||||||
pub fn build_router() -> Router {
|
pub fn build_router() -> Router {
|
||||||
Router::new()
|
Router::new()
|
||||||
@@ -175,17 +174,10 @@ pub fn build_router() -> Router {
|
|||||||
"/api/v1/pentest/stats",
|
"/api/v1/pentest/stats",
|
||||||
get(handlers::pentest::pentest_stats),
|
get(handlers::pentest::pentest_stats),
|
||||||
)
|
)
|
||||||
// Webhook endpoints (proxied through dashboard)
|
// Webhook routes live on the separate webhook server (port 3002,
|
||||||
.route(
|
// see crate::webhooks::server). The M7.2-C tenant-in-URL form is
|
||||||
"/webhook/github/{repo_id}",
|
// `/webhook/{tenant_id}/{platform}/{repo_id}` and the handlers
|
||||||
post(webhooks::github::handle_github_webhook),
|
// expect a (tenant_id, repo_id) path tuple. Anything mounting
|
||||||
)
|
// them here on the API server would mismatch the handler
|
||||||
.route(
|
// signature, so the routes are not exported.
|
||||||
"/webhook/gitlab/{repo_id}",
|
|
||||||
post(webhooks::gitlab::handle_gitlab_webhook),
|
|
||||||
)
|
|
||||||
.route(
|
|
||||||
"/webhook/gitea/{repo_id}",
|
|
||||||
post(webhooks::gitea::handle_gitea_webhook),
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user