weave-identity · resolver
Source declarations, signatures and documentation for resolver.
Source: sigil/weave/adapters/weave-identity/src/resolver.rs. SHA-256: 89935bf2a2a36a23063884013d25aaf2014f0347c0375f1f4df0eb9a2d4a4c3e.
This reference follows declared source modules, retains conditional attributes, and includes public declarations and implementation methods. Private-module re-exports and trait resolution require the compiler; this is a source reference, not a claim that every listed item is a root import. Function bodies and constant values are omitted.
resolver::IdentityDocument
An identity document containing verification information
This provides verification information for an identity without exposing the underlying document format (DID Document, X.509, etc.)
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct IdentityDocument {
/// The identity this document describes
pub identity: Identity,
/// Verification methods available for this identity
pub verification_methods: Vec<VerificationMethod>,
/// Creation timestamp
pub created: Option<DateTime<Utc>>,
/// Last update timestamp
pub updated: Option<DateTime<Utc>>,
/// Optional controller identity
pub controller: Option<Identity>,
/// Additional metadata
pub metadata: Option<serde_json::Value>
}Source line: 13.
resolver::IdentityDocument::new
Create a new identity document
pub fn new(identity: Identity) -> Self;Source line: 30.
resolver::IdentityDocument::add_verification_method
Add a verification method
pub fn add_verification_method(&mut self, method: VerificationMethod);Source line: 42.
resolver::IdentityDocument::verification_methods_for_purpose
Get verification methods for a specific purpose
pub fn verification_methods_for_purpose(&self, purpose: &str) -> Vec<&VerificationMethod>;Source line: 47.
resolver::IdentityDocument::verification_method_by_id
Find a verification method by ID
pub fn verification_method_by_id(&self, id: &str) -> Option<&VerificationMethod>;Source line: 55.
resolver::VerificationMethod
A verification method for an identity
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct VerificationMethod {
/// Unique identifier for this verification method
pub id: String,
/// The public key for verification
pub public_key: PublicKey,
/// Purpose of this verification method (e.g., "authentication", "assertion")
pub purpose: Option<String>,
/// Controller of this verification method
pub controller: Option<Identity>,
/// Additional metadata
pub metadata: Option<serde_json::Value>
}Source line: 64.
resolver::VerificationMethod::new
Create a new verification method
pub fn new(id: impl Into<String>, public_key: PublicKey) -> Self;Source line: 79.
resolver::VerificationMethod::with_purpose
Set the purpose of this verification method
pub fn with_purpose(mut self, purpose: impl Into<String>) -> Self;Source line: 90.
resolver::VerificationMethod::with_controller
Set the controller of this verification method
pub fn with_controller(mut self, controller: Identity) -> Self;Source line: 96.
resolver::IdentityResolver
Trait for resolving identities to their documents
#[async_trait]
pub trait IdentityResolver: Send + Sync {
/// Resolve an identity to its document
async fn resolve(&self, identity: &Identity) -> Result<IdentityDocument>;
/// Check if an identity exists and is valid
async fn exists(&self, identity: &Identity) -> Result<bool>;
/// Get verification methods for an identity
async fn verification_methods(&self, identity: &Identity) -> Result<Vec<VerificationMethod>> ;
/// Get a specific verification method by ID
async fn verification_method(
&self,
identity: &Identity,
method_id: &str,
) -> Result<Option<VerificationMethod>> ;
}Source line: 104.