bitwarden_auth/login/models/
key_connector_user_decryption_option.rs1use serde::{Deserialize, Serialize};
2
3use crate::login::api::response::KeyConnectorUserDecryptionOptionApiResponse;
4
5#[derive(Serialize, Deserialize, Debug, Clone, PartialEq)]
7#[serde(rename_all = "camelCase")]
8#[cfg_attr(feature = "uniffi", derive(uniffi::Record))]
9#[cfg_attr(
10 feature = "wasm",
11 derive(tsify::Tsify),
12 tsify(into_wasm_abi, from_wasm_abi)
13)]
14pub struct KeyConnectorUserDecryptionOption {
15 pub key_connector_url: String,
17}
18
19impl From<KeyConnectorUserDecryptionOptionApiResponse> for KeyConnectorUserDecryptionOption {
20 fn from(api: KeyConnectorUserDecryptionOptionApiResponse) -> Self {
21 Self {
22 key_connector_url: api.key_connector_url,
23 }
24 }
25}
26
27#[cfg(test)]
28mod tests {
29 use super::*;
30
31 #[test]
32 fn test_key_connector_conversion() {
33 let api = KeyConnectorUserDecryptionOptionApiResponse {
34 key_connector_url: "https://key-connector.example.com".to_string(),
35 };
36
37 let domain: KeyConnectorUserDecryptionOption = api.clone().into();
38
39 assert_eq!(domain.key_connector_url, api.key_connector_url);
40 }
41}