MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / parse_remote_manifest

Function parse_remote_manifest

libatomic/src/daemon/services_sync_remote.rs:221–244  ·  view source on GitHub ↗

The local `parse_remote_manifest` — parse + verify, mapping failures to the remote error text.

(
    view: &str,
    text: &str,
    url: &str,
    stage: &str,
)

Source from the content-addressed store, hash-verified

219/// The local `parse_remote_manifest` — parse + verify, mapping failures to
220/// the remote error text.
221fn parse_remote_manifest(
222 view: &str,
223 text: &str,
224 url: &str,
225 stage: &str,
226) -> Result<ViewManifest, Status> {
227 let manifest = ViewManifest::parse(text).map_err(|error| {
228 sync_error(
229 stage,
230 "remote_error",
231 url,
232 format!("Invalid manifest for view '{view}' from remote: {error}"),
233 )
234 })?;
235 manifest.verify().map_err(|error| {
236 sync_error(
237 stage,
238 "remote_error",
239 url,
240 format!("Corrupt manifest for view '{view}' from remote: {error}"),
241 )
242 })?;
243 Ok(manifest)
244}
245
246/// The local `plan_view_sync` — the set-union membership model with the
247/// identity checks and the declare decision.

Callers 1

parse_advertisementFunction · 0.70

Calls 3

sync_errorFunction · 0.85
parseFunction · 0.50
verifyMethod · 0.45

Tested by

no test coverage detected