bitwarden_uniffi/auth/
registration.rs1use bitwarden_auth::{
2 AuthClientExt,
3 registration::{
4 JitMasterPasswordRegistrationRequest, JitMasterPasswordRegistrationResponse,
5 KeyConnectorRegistrationResult, TdeRegistrationRequest, TdeRegistrationResponse,
6 },
7};
8
9use crate::error::BitwardenError;
10
11#[derive(uniffi::Object)]
12pub struct RegistrationClient(pub(crate) bitwarden_core::Client);
13
14#[uniffi::export(async_runtime = "tokio")]
15impl RegistrationClient {
16 pub async fn post_keys_for_tde_registration(
19 &self,
20 request: TdeRegistrationRequest,
21 ) -> Result<TdeRegistrationResponse, BitwardenError> {
22 Ok(self
23 .0
24 .auth_new()
25 .registration()
26 .post_keys_for_tde_registration(request)
27 .await?)
28 }
29
30 pub async fn post_keys_for_key_connector_registration(
33 &self,
34 key_connector_url: String,
35 sso_org_identifier: String,
36 ) -> Result<KeyConnectorRegistrationResult, BitwardenError> {
37 Ok(self
38 .0
39 .auth_new()
40 .registration()
41 .post_keys_for_key_connector_registration(key_connector_url, sso_org_identifier)
42 .await?)
43 }
44
45 pub async fn post_keys_for_jit_password_registration(
48 &self,
49 request: JitMasterPasswordRegistrationRequest,
50 ) -> Result<JitMasterPasswordRegistrationResponse, BitwardenError> {
51 Ok(self
52 .0
53 .auth_new()
54 .registration()
55 .post_keys_for_jit_password_registration(request)
56 .await?)
57 }
58}