Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion api/src/api/handlers/sync_verify.rs
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,11 @@ async fn process_verification_sync(
"Verification completed for program: {} (verified: {})",
payload.program_id, res.is_verified
);

let build_signer = db
.get_build_params(&res.solana_build_id)
.await
.map(|build_params| build_params.signer)
.unwrap_or(None);
(
StatusCode::OK,
Json(
Expand All @@ -132,6 +136,7 @@ async fn process_verification_sync(
last_verified_at: Some(res.verified_at),
repo_url: build_repository_url(&verify_build_data),
commit: payload.commit_hash.clone().unwrap_or_default(),
signer: build_signer,
}
.into(),
),
Expand Down
2 changes: 2 additions & 0 deletions api/src/api/handlers/verification_status.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ pub(crate) async fn get_verification_status(
executable_hash: result.executable_hash,
repo_url: result.repo_url,
commit: result.commit,
signer: result.signer,
}
.into(),
)
Expand All @@ -57,6 +58,7 @@ pub(crate) async fn get_verification_status(
executable_hash: String::new(),
repo_url: String::new(),
commit: String::new(),
signer: None,
}
.into(),
),
Expand Down
4 changes: 4 additions & 0 deletions api/src/db/models/responses.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ pub struct VerificationResponse {
pub commit: String,
/// Timestamp of when the program was last verified
pub last_verified_at: Option<NaiveDateTime>,
/// Signer public key
pub signer: Option<String>,
}

/// Extends VerificationResponse with signer information
Expand Down Expand Up @@ -73,6 +75,8 @@ pub struct StatusResponse {
pub commit: String,
/// Timestamp of when the program was last verified
pub last_verified_at: Option<NaiveDateTime>,
/// Signer public key
pub signer: Option<String>,
}

/// Response structure for verification job status
Expand Down
4 changes: 4 additions & 0 deletions api/src/db/verification.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ impl DbClient {
repo_url: build_repository_url(&build_params),
last_verified_at: Some(res.verified_at),
commit: build_params.commit_hash.unwrap_or_default(),
signer: build_params.signer,
});
}
}
Expand Down Expand Up @@ -73,6 +74,7 @@ impl DbClient {
repo_url: build_repository_url(&build_params),
last_verified_at: Some(res.verified_at),
commit: build_params.commit_hash.unwrap_or_default(),
signer: build_params.signer,
})
}
Err(_) => {
Expand All @@ -84,6 +86,7 @@ impl DbClient {
repo_url: build_repository_url(&build_params),
last_verified_at: Some(res.verified_at),
commit: build_params.commit_hash.unwrap_or_default(),
signer: build_params.signer,
})
}
}
Expand Down Expand Up @@ -142,6 +145,7 @@ impl DbClient {
repo_url: build_repository_url(&build),
last_verified_at: Some(verified_build.verified_at),
commit: build.commit_hash.unwrap_or_default(),
signer: build.signer.clone(),
},
signer: build.signer.unwrap_or(DEFAULT_SIGNER.to_string()),
is_frozen: verified_build_with_signer.is_frozen.unwrap_or_default(),
Expand Down