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

Method evaluate

atomic-config/src/lib.rs:859–869  ·  view source on GitHub ↗

Evaluate one signer against this policy. `repository_identity` is the repository's own signer DID (the stated default trust root) when one is configured. `revoked` always wins: revocation is explicit and cannot be re-trusted by listing.

(&self, signer: &str, repository_identity: Option<&str>)

Source from the content-addressed store, hash-verified

857 /// default trust root) when one is configured. `revoked` always wins:
858 /// revocation is explicit and cannot be re-trusted by listing.
859 pub fn evaluate(&self, signer: &str, repository_identity: Option<&str>) -> SignerTrust {
860 if self.revoked.iter().any(|did| did == signer) {
861 return SignerTrust::Revoked;
862 }
863 if repository_identity.is_some_and(|identity| identity == signer)
864 || self.signers.iter().any(|did| did == signer)
865 {
866 return SignerTrust::Trusted;
867 }
868 SignerTrust::Unknown
869 }
870}
871
872#[cfg(test)]

Callers

nothing calls this directly

Calls 1

iterMethod · 0.45

Tested by

no test coverage detected