Crate jacquard_identity

Crate jacquard_identity 

Source
Expand description

Identity resolution for the AT Protocol

Jacquard’s handle-to-DID and DID-to-document resolution with configurable fallback chains.

§Quick start

use jacquard_identity::{PublicResolver, resolver::IdentityResolver};
use jacquard_common::types::string::Handle;

let resolver = PublicResolver::default();

// Resolve handle to DID
let did = resolver.resolve_handle(&Handle::new("alice.bsky.social")?).await?;

// Fetch DID document
let doc_response = resolver.resolve_did_doc(&did).await?;
let doc = doc_response.parse()?;  // Borrow from response buffer

§Resolution fallback order

Handle → DID (configurable via resolver::HandleStep):

  1. DNS TXT record at _atproto.{handle} (if dns feature enabled)
  2. HTTPS well-known at https://{handle}/.well-known/atproto-did
  3. PDS XRPC com.atproto.identity.resolveHandle (if PDS configured)
  4. Public API fallback (https://public.api.bsky.app)
  5. Slingshot resolveHandle (if configured)

DID → Document (configurable via resolver::DidStep):

  1. did:web HTTPS well-known
  2. PLC directory HTTP (for did:plc)
  3. PDS XRPC com.atproto.identity.resolveDid (if PDS configured)
  4. Slingshot mini-doc (partial document)

§Customization

use jacquard_identity::JacquardResolver;
use jacquard_identity::resolver::{ResolverOptions, PlcSource};

let opts = ResolverOptions {
    plc_source: PlcSource::slingshot_default(),
    public_fallback_for_handle: true,
    validate_doc_id: true,
    ..Default::default()
};

let resolver = JacquardResolver::new(reqwest::Client::new(), opts);
#[cfg(feature = "dns")]
let resolver = resolver.with_system_dns();  // Enable DNS TXT resolution

§Response types

Resolution methods return wrapper types that own the response buffer, allowing zero-copy parsing:

Both support .parse() for borrowing and validation.

Modules§

lexicon_resolver
Lexicon schema resolution via DNS and XRPC
resolver
Identity resolution: handle → DID and DID → document, with smart fallbacks.

Structs§

JacquardResolver
Default resolver implementation with configurable fallback order.
MiniDocResponse
Slingshot mini-doc JSON response wrapper

Enums§

IdentityWarning
Warnings produced during identity checks that are not fatal

Functions§

slingshot_resolver_default
Build a resolver configured to use Slingshot (https://slingshot.microcosm.blue) for PLC and mini-doc fallbacks, unauthenticated by default.

Type Aliases§

PublicResolver
Resolver specialized for unauthenticated/public flows using reqwest and stateless XRPC