Skip to content

Commit 972cf1e

Browse files
committed
Add GitHub review flow to TrustGate
1 parent 3514916 commit 972cf1e

10 files changed

Lines changed: 862 additions & 619 deletions

File tree

backend/src/github.rs

Lines changed: 178 additions & 152 deletions
Large diffs are not rendered by default.

backend/src/main.rs

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,9 @@ async fn main() {
5454
.route("/auth/generate-key", post(gen_key))
5555
.route("/health", get(health))
5656
.route("/startup/checks", get(startup_checks_route))
57+
.route("/rule-packs", get(pipeline::rule_packs))
5758
.route("/rules", get(list_rules).post(save_rules))
5859
.route("/rules/*repo", delete(delete_rules))
59-
.route("/rule-packs", get(pipeline::rule_packs))
6060
.route("/review", post(pipeline::review))
6161
.route("/review/github/pr", post(pipeline::review_github_pr))
6262
.route("/webhooks/github", post(pipeline::github_webhook))
@@ -111,9 +111,14 @@ async fn health() -> Json<serde_json::Value> {
111111
"config_errors": errors,
112112
"db_path": db::db_path(),
113113
"mode": "review-first",
114-
"github_token_ready": crate::github::github_token().is_some(),
115-
"github_webhook_ready": crate::github::webhook_secret().is_some(),
116-
"github_public_url": std::env::var("TRUSTGATE_PUBLIC_URL").ok().filter(|value| !value.trim().is_empty()),
114+
"github": {
115+
"token_configured": github::github_token_configured(),
116+
"webhook_secret_configured": github::webhook_secret_configured(),
117+
"public_url_configured": std::env::var("TRUSTGATE_PUBLIC_URL")
118+
.ok()
119+
.map(|value| !value.trim().is_empty())
120+
.unwrap_or(false),
121+
}
117122
}))
118123
}
119124

0 commit comments

Comments
 (0)