Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| bec47f8c7d |
@@ -2,6 +2,7 @@ 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()
|
||||||
@@ -174,10 +175,17 @@ pub fn build_router() -> Router {
|
|||||||
"/api/v1/pentest/stats",
|
"/api/v1/pentest/stats",
|
||||||
get(handlers::pentest::pentest_stats),
|
get(handlers::pentest::pentest_stats),
|
||||||
)
|
)
|
||||||
// Webhook routes live on the separate webhook server (port 3002,
|
// Webhook endpoints (proxied through dashboard)
|
||||||
// see crate::webhooks::server). The M7.2-C tenant-in-URL form is
|
.route(
|
||||||
// `/webhook/{tenant_id}/{platform}/{repo_id}` and the handlers
|
"/webhook/github/{repo_id}",
|
||||||
// expect a (tenant_id, repo_id) path tuple. Anything mounting
|
post(webhooks::github::handle_github_webhook),
|
||||||
// them here on the API server would mismatch the handler
|
)
|
||||||
// signature, so the routes are not exported.
|
.route(
|
||||||
|
"/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