Skip to content

Commit 7478fd4

Browse files
committed
Merge remote-tracking branch 'origin/main' into feat/multisig-support
2 parents 99344bc + 0f5468b commit 7478fd4

File tree

4 files changed

+7
-13
lines changed

4 files changed

+7
-13
lines changed

fplus-http-server/src/main.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ async fn main() -> std::io::Result<()> {
3333
.service(router::health)
3434
.service(router::application::create)
3535
.service(
36-
web::scope("/api")
37-
.wrap(VerifierAuth) // Apply GitHubAuth to all routes under "/api"
36+
web::scope("/verifier")
37+
.wrap(VerifierAuth)
3838
.service(router::application::trigger)
3939
.service(router::application::propose)
4040
.service(router::application::approve)

fplus-http-server/src/middleware/verifier_auth.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,8 @@ use actix_web::{
5555
let query: Result<web::Query<RepoQuery>, _> = web::Query::from_query(query_string);
5656
let RepoQuery { owner, repo, github_username } = match query {
5757
Ok(q) => q.into_inner(),
58-
Err(_) => {
58+
Err(e) => {
59+
println!("{}", e);
5960
return Box::pin(async {
6061
return Err(actix_web::error::ErrorBadRequest("Wrong query string format"));
6162
});

fplus-http-server/src/router/application.rs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use actix_web::{get, post, web, HttpResponse, Responder};
22
use fplus_lib::core::{
3-
application::file::VerifierInput, ApplicationQueryParams, CompleteGovernanceReviewInfo, CompleteNewApplicationProposalInfo, CreateApplicationInfo, DcReachedInfo, GithubQueryParams, LDNApplication, RefillInfo, ValidationPullRequestData, VerifierActionsQueryParams
3+
application::file::VerifierInput, ApplicationQueryParams, CompleteNewApplicationProposalInfo, CreateApplicationInfo, DcReachedInfo, GithubQueryParams, LDNApplication, RefillInfo, ValidationPullRequestData, VerifierActionsQueryParams
44
};
55

66
#[post("/application")]
@@ -28,10 +28,8 @@ pub async fn single(query: web::Query<ApplicationQueryParams>) -> impl Responder
2828

2929
#[post("/application/trigger")]
3030
pub async fn trigger(
31-
query: web::Query<ApplicationQueryParams>,
32-
info: web::Json<CompleteGovernanceReviewInfo>,
31+
query: web::Query<VerifierActionsQueryParams>,
3332
) -> impl Responder {
34-
let CompleteGovernanceReviewInfo { actor} = info.into_inner();
3533
let ldn_application = match LDNApplication::load(query.id.clone(), query.owner.clone(), query.repo.clone()).await {
3634
Ok(app) => app,
3735
Err(e) => {
@@ -40,7 +38,7 @@ pub async fn trigger(
4038
};
4139
dbg!(&ldn_application);
4240
match ldn_application
43-
.complete_governance_review(actor, query.owner.clone(), query.repo.clone())
41+
.complete_governance_review(query.github_username.clone(), query.owner.clone(), query.repo.clone())
4442
.await
4543
{
4644
Ok(app) => HttpResponse::Ok().body(serde_json::to_string_pretty(&app).unwrap()),

fplus-lib/src/core/mod.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -66,11 +66,6 @@ pub struct LDNApplication {
6666
pub branch_name: String,
6767
}
6868

69-
#[derive(Debug, Serialize, Deserialize)]
70-
pub struct CompleteGovernanceReviewInfo {
71-
pub actor: String,
72-
}
73-
7469
#[derive(Deserialize, Debug)]
7570
pub struct RefillInfo {
7671
pub id: String,

0 commit comments

Comments
 (0)