Skip to content

Commit

Permalink
Add APIs to client to expose the internal storages so that they may b…
Browse files Browse the repository at this point in the history
…e consulted directly.
  • Loading branch information
CaioSym committed Mar 12, 2024
1 parent 2d92710 commit 8c98504
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions mls-rs/src/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -707,6 +707,27 @@ where
pub fn key_package_extensions(&self) -> ExtensionList {
self.config.key_package_extensions()
}

/// The [KeyPackageStorage](crate::KeyPackageStorage) that
/// this client was configured to use.
#[cfg_attr(all(feature = "ffi", not(test)), safer_ffi_gen::safer_ffi_gen_ignore)]
pub fn key_package_store(&self) -> <C as ClientConfig>::KeyPackageRepository {
self.config.key_package_repo()
}

/// The [PreSharedKeyStorage](crate::PreSharedKeyStorage) that
/// this client was configured to use.
#[cfg_attr(all(feature = "ffi", not(test)), safer_ffi_gen::safer_ffi_gen_ignore)]
pub fn secret_store(&self) -> <C as ClientConfig>::PskStore {
self.config.secret_store()
}

/// The [GroupStateStorage](crate::GroupStateStorage) that
/// this client was configured to use.
#[cfg_attr(all(feature = "ffi", not(test)), safer_ffi_gen::safer_ffi_gen_ignore)]
pub fn group_state_storage(&self) -> <C as ClientConfig>::GroupStateStorage {
self.config.group_state_storage()
}
}

#[cfg(test)]
Expand Down

0 comments on commit 8c98504

Please sign in to comment.