Skip to main content

BridgeLookup

Trait BridgeLookup 

Source
pub trait BridgeLookup:
    Send
    + Sync
    + 'static {
    // Required methods
    fn find_bridge(&self, bridge_id: &str) -> Option<BridgeConnector>;
    fn resolve_did_document(&self, did: &str) -> Option<DidDocument>;
    fn find_webhook_key(&self, key_id: &str) -> Option<[u8; 32]>;
    fn expected_audience(&self) -> &str;
}
Expand description

Trait for looking up registered bridges and resolving DID documents.

Implementors provide the bridge registry and DID resolution needed by bridge_auth_middleware. This decouples the auth layer from specific storage and identity implementations.

Required Methods§

Source

fn find_bridge(&self, bridge_id: &str) -> Option<BridgeConnector>

Look up a bridge by its ID.

Returns None if no bridge with the given ID is registered.

Source

fn resolve_did_document(&self, did: &str) -> Option<DidDocument>

Resolve a DID document for the given DID string.

Returns None if the DID cannot be resolved. Implementations MAY cache resolved documents with TTL (spec section 12.10.2).

Source

fn find_webhook_key(&self, key_id: &str) -> Option<[u8; 32]>

Look up a pre-registered webhook signing public key by key ID.

Returns the Ed25519 public key bytes for the given platform key ID. Returns None if no key with that ID is registered.

Source

fn expected_audience(&self) -> &str

Returns the expected audience (node URL) for JWT validation.

Implementors§