Skip to content
Merged
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
169 changes: 158 additions & 11 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ publish = false
[dependencies]
anyhow = "1.0.102"
axum = "0.8.9"
bestool-canopy = "0.4.4"
bestool-canopy = "0.4.5"
bestool-kopia = { version = "0.3.4", features = ["proxy"] }
cronexpr = "1.5.0"
futures = "0.3.31"
Expand Down
28 changes: 11 additions & 17 deletions src/canopy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,7 @@
//! the integration seam tests inject a stub at, and as the place to hang
//! pgro-specific logging / retry / cache concerns later.

use bestool_canopy::{
CanopyClient, RestoreCredentials, RestoreVerification, WorklistEntry, client_builder,
};
use bestool_canopy::{CanopyClient, RestoreCredentials, WorklistEntry, client_builder};
use reqwest::Url;
use uuid::Uuid;

Expand Down Expand Up @@ -140,20 +138,16 @@ impl Client {
}

/// Report a restore outcome (signal 3, restore-verification).
pub async fn restore_verification(&self, report: &RestoreVerification<'_>) -> Result<()> {
self.inner
.restore_verification(&self.base_url, report)
.await
.map_err(|err| Error::Canopy(format!("restore_verification: {err:?}")))
}

/// Report a restore outcome with an arbitrary JSON body β€” used to include
/// the `health_details` field, which the typed [`RestoreVerification`]
/// struct doesn't carry. `body` should be the serialized verification
/// plus any extra fields. Goes to the same `POST /restore-verification`
/// endpoint via the generic request escape hatch; a non-2xx response is
/// an error carrying the status + body.
pub async fn restore_verification_json(&self, body: &serde_json::Value) -> Result<()> {
///
/// `body` is the typed [`bestool_canopy::schema::VerificationArgs`]
/// (generated from canopy's OpenAPI) β€” including the free-form
/// `health_details` the hand-written wire type doesn't carry. Sent to
/// `POST /restore-verification` via the generic request escape hatch; a
/// non-2xx response is an error carrying the status + body.
pub async fn restore_verification_typed(
&self,
body: &(impl serde::Serialize + ?Sized),
) -> Result<()> {
let resp = self
.inner
.request(
Expand Down
Loading