pub trait RecordResolver: Send + Sync {
// Required methods
fn resolve_record<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
did: &'life1 str,
collection: &'life2 str,
rkey: &'life3 str,
) -> Pin<Box<dyn Future<Output = Result<Option<RecordCarData>>> + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait;
fn resolve_repo<'life0, 'life1, 'async_trait>(
&'life0 self,
did: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<RecordCarData>>> + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
// Provided methods
fn resolve_verifying_key<'life0, 'life1, 'async_trait>(
&'life0 self,
_did: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<VerifyingKey>>> + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait { ... }
fn resolve_verifying_keys<'life0, 'life1, 'async_trait>(
&'life0 self,
did: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<PublishedAtprotoKeys>>> + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait { ... }
}Expand description
Trait for resolving atproto records/repos from the node’s local PDS.
Decouples DiscoveryService from hyprstream-pds (a pure crypto/metadata
crate with no networking) and from the per-account record stores held by the
main hyprstream crate. The main crate provides a PdsRecordResolver that
builds CAR proofs via hyprstream_pds::car::build_record_proof_car.
IMPORTANT: a resolver MUST NOT perform access control — confidentiality is enforced by the DiscoveryService handler’s Casbin check on the target DID/collection before the resolver is consulted. The resolver only answers “does this record exist, and what is its signed CAR proof”.
Required Methods§
Sourcefn resolve_record<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
did: &'life1 str,
collection: &'life2 str,
rkey: &'life3 str,
) -> Pin<Box<dyn Future<Output = Result<Option<RecordCarData>>> + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
fn resolve_record<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
did: &'life1 str,
collection: &'life2 str,
rkey: &'life3 str,
) -> Pin<Box<dyn Future<Output = Result<Option<RecordCarData>>> + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Resolve a single record to a CAR proof. collection is the NSID
(e.g. ai.hyprstream.model), rkey the TID record key. Returns
Ok(None) when the DID/collection/rkey does not name a stored record.
Sourcefn resolve_repo<'life0, 'life1, 'async_trait>(
&'life0 self,
did: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<RecordCarData>>> + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn resolve_repo<'life0, 'life1, 'async_trait>(
&'life0 self,
did: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<RecordCarData>>> + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Resolve a full repo CAR for a DID (commit + MST + all records).
Returns Ok(None) when no repo is stored for the DID.
Provided Methods§
Sourcefn resolve_verifying_key<'life0, 'life1, 'async_trait>(
&'life0 self,
_did: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<VerifyingKey>>> + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn resolve_verifying_key<'life0, 'life1, 'async_trait>(
&'life0 self,
_did: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<VerifyingKey>>> + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Resolve the DID’s #atproto P-256 verifying key — the key a repo CAR’s
commit is signed by — or Ok(None) when this resolver cannot establish
one.
This is the signature-verification seam for verified-by-construction
ingest: PlacementIndex::ingest_did requires a key and verifies the
ingested repo CAR’s commit signature against it before any record
enters the index. A failed resolution, including Ok(None), is rejected
at that trust boundary; it never authorizes an unverified fallback.
The default keeps non-participating resolvers source-compatible while
preserving fail-closed ingest.
Sourcefn resolve_verifying_keys<'life0, 'life1, 'async_trait>(
&'life0 self,
did: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<PublishedAtprotoKeys>>> + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn resolve_verifying_keys<'life0, 'life1, 'async_trait>(
&'life0 self,
did: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<PublishedAtprotoKeys>>> + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Resolve every bounded #atproto verification slot currently published
for did. Implementations that only know one trusted active key retain
the fail-closed default through RecordResolver::resolve_verifying_key.