mirror of
https://github.com/logos-messaging/libchat.git
synced 2026-05-16 23:19:39 +00:00
Add trait comments
This commit is contained in:
parent
a8e83ccaa7
commit
e56c9578c0
@ -22,11 +22,26 @@ use crate::{
|
|||||||
types::{AddressedEncryptedPayload, ContentData},
|
types::{AddressedEncryptedPayload, ContentData},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/// Provides the identity information needed to participate in an MLS group.
|
||||||
|
///
|
||||||
|
/// Implementors must also implement [`OpenMlsSigner`] so they can sign MLS
|
||||||
|
/// messages. The two methods here supply what [`MlsContext::get_credential`]
|
||||||
|
/// needs to build a [`CredentialWithKey`]: `friendly_name` becomes the
|
||||||
|
/// `BasicCredential` label and `public_key` becomes the signature-verification key.
|
||||||
pub trait IdentityProvider: OpenMlsSigner {
|
pub trait IdentityProvider: OpenMlsSigner {
|
||||||
fn friendly_name(&self) -> String;
|
fn friendly_name(&self) -> String;
|
||||||
fn public_key(&self) -> &Ed25519VerifyingKey;
|
fn public_key(&self) -> &Ed25519VerifyingKey;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Connects the MLS protocol engine to app-level identity and transport.
|
||||||
|
///
|
||||||
|
/// `GroupV1Convo` is generic over this trait so the MLS logic stays
|
||||||
|
/// independent of how identities are stored or how invites are delivered.
|
||||||
|
/// Implementors supply:
|
||||||
|
/// - a [`LibcruxProvider`] for MLS crypto operations
|
||||||
|
/// - an [`IdentityProvider`] for signing and credential construction
|
||||||
|
/// - [`invite_user`] — the app-specific logic for routing a [`Welcome`]
|
||||||
|
/// message to a new member's inbox
|
||||||
pub trait MlsContext {
|
pub trait MlsContext {
|
||||||
type IDENT: IdentityProvider;
|
type IDENT: IdentityProvider;
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user