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

Method validate_signer

atomic-repository/src/git_binding/codec.rs:372–386  ·  view source on GitHub ↗
(&self)

Source from the content-addressed store, hash-verified

370 }
371
372 fn validate_signer(&self) -> Result<(), BindingEncodeError> {
373 let public_key = PublicKey::from_bytes(&self.signer.verifying_key).map_err(|error| {
374 BindingEncodeError::SignerMismatch {
375 did: self.signer.did.clone(),
376 reason: error.to_string(),
377 }
378 })?;
379 if !atomic_canonical::did::did_matches_public_key(&self.signer.did, &public_key) {
380 return Err(BindingEncodeError::SignerMismatch {
381 did: self.signer.did.clone(),
382 reason: "the DID does not resolve to the verifying key".to_string(),
383 });
384 }
385 Ok(())
386 }
387}
388
389fn validate_view_hint(hint: Option<&str>) -> Result<(), BindingEncodeError> {

Callers 1

validateMethod · 0.80

Calls 2

did_matches_public_keyFunction · 0.85
cloneMethod · 0.45

Tested by

no test coverage detected