Skip to main content

IdentityInventoryReadModel

Trait IdentityInventoryReadModel 

Source
pub trait IdentityInventoryReadModel: Send + Sync {
    // Required methods
    fn upsert_derived<'life0, 'async_trait>(
        &'life0 self,
        identity: InventoryEntry,
        label: SecurityLabel,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn query_page<'life0, 'life1, 'life2, 'life3, 'async_trait>(
        &'life0 self,
        viewer: &'life1 SecurityContext,
        filter: Option<&'life2 str>,
        after: Option<&'life3 str>,
        limit: usize,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<InventoryEntry>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait,
             'life3: 'async_trait;
    fn get<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        viewer: Option<&'life1 SecurityContext>,
        did: &'life2 str,
    ) -> Pin<Box<dyn Future<Output = Result<Option<InventoryEntry>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait;

    // Provided methods
    fn query<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        viewer: &'life1 SecurityContext,
        filter: Option<&'life2 str>,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<InventoryEntry>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait { ... }
    fn list<'life0, 'life1, 'async_trait>(
        &'life0 self,
        viewer: &'life1 SecurityContext,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<InventoryEntry>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait { ... }
}
Expand description

Non-authoritative inventory read model consumed by federation intake.

A pglite/Postgres implementation can replace the in-memory implementation without changing resolution or tenant-safety logic.

Required Methods§

Source

fn upsert_derived<'life0, 'async_trait>( &'life0 self, identity: InventoryEntry, label: SecurityLabel, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Insert or refresh one derived projection and its trusted object label.

The projection must already come from federation intake or an authority-owned hosted-account source. Implementations must revalidate tenant/kind invariants and reject [UNAUTHENTICATED_DID_SENTINEL].

Source

fn query_page<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, viewer: &'life1 SecurityContext, filter: Option<&'life2 str>, after: Option<&'life3 str>, limit: usize, ) -> Pin<Box<dyn Future<Output = Result<Vec<InventoryEntry>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait,

Query one deterministic, post-clearance page.

after is an exclusive DID cursor over the stable DID ordering. The caller must enforce a finite limit; implementations apply it after clearance and filter predicates and never compute a pre-filter total.

Source

fn get<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, viewer: Option<&'life1 SecurityContext>, did: &'life2 str, ) -> Pin<Box<dyn Future<Output = Result<Option<InventoryEntry>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Fetch one entry without revealing whether a filtered object exists.

None means absent, no caller clearance, or above caller clearance. Wire adapters must map every None case to the same 404-style result.

Provided Methods§

Source

fn query<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, viewer: &'life1 SecurityContext, filter: Option<&'life2 str>, ) -> Pin<Box<dyn Future<Output = Result<Vec<InventoryEntry>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Query only entries dominated by the viewer’s verified clearance.

Filtering happens inside the read model before any response is built. The return shape intentionally has no total/hidden-count field: callers can observe only this post-filter vector’s length. Implementations must never return [UNAUTHENTICATED_DID_SENTINEL] as a real host.

Source

fn list<'life0, 'life1, 'async_trait>( &'life0 self, viewer: &'life1 SecurityContext, ) -> Pin<Box<dyn Future<Output = Result<Vec<InventoryEntry>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

List all entries visible to this viewer.

Implementors§