fix: add fields for collections, policies, and sends to SyncResponse structure

This commit is contained in:
qaz741wsd856 2025-12-03 17:27:12 +00:00
parent d0ee94c103
commit 2571f9de42
2 changed files with 14 additions and 16 deletions

View file

@ -87,10 +87,13 @@ pub async fn get_sync_data(
let response = SyncResponse { let response = SyncResponse {
profile, profile,
folders, folders,
collections: Vec::new(),
policies: Vec::new(),
ciphers, ciphers,
domains: serde_json::Value::Null, // Ignored for basic implementation domains: serde_json::Value::Null, // Ignored for basic implementation
sends: Vec::new(),
object: "sync".to_string(), object: "sync".to_string(),
}; };
Ok(Json(response)) Ok(Json(response))
} }

View file

@ -3,44 +3,39 @@ use serde::Serialize;
use serde_json::Value; use serde_json::Value;
#[derive(Debug, Serialize)] #[derive(Debug, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct Profile { pub struct Profile {
#[serde(skip_serializing_if = "Option::is_none")]
pub name: Option<String>, pub name: Option<String>,
pub email: String, pub email: String,
pub id: String, pub id: String,
#[serde(rename = "masterPasswordHint")] #[serde(skip_serializing_if = "Option::is_none")]
pub master_password_hint: Option<String>, pub master_password_hint: Option<String>,
#[serde(rename = "securityStamp")]
pub security_stamp: String, pub security_stamp: String,
#[serde(rename = "Object")]
pub object: String, pub object: String,
#[serde(rename = "premiumFromOrganization")]
pub premium_from_organization: bool, pub premium_from_organization: bool,
#[serde(rename = "forcePasswordReset")]
pub force_password_reset: bool, pub force_password_reset: bool,
#[serde(rename = "emailVerified")]
pub email_verified: bool, pub email_verified: bool,
#[serde(rename = "twoFactorEnabled")]
pub two_factor_enabled: bool, pub two_factor_enabled: bool,
pub premium: bool, pub premium: bool,
#[serde(rename = "usesKeyConnector")]
pub uses_key_connector: bool, pub uses_key_connector: bool,
#[serde(rename = "creationDate")]
pub creation_date: String, pub creation_date: String,
#[serde(rename = "privateKey")]
pub private_key: String, pub private_key: String,
pub key: String, pub key: String,
} }
#[derive(Debug, Serialize)] #[derive(Debug, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct SyncResponse { pub struct SyncResponse {
#[serde(rename = "profile")]
pub profile: Profile, pub profile: Profile,
#[serde(rename = "folders")]
pub folders: Vec<FolderResponse>, pub folders: Vec<FolderResponse>,
#[serde(rename = "ciphers")] #[serde(default)]
pub collections: Vec<Value>,
#[serde(default)]
pub policies: Vec<Value>,
pub ciphers: Vec<Cipher>, pub ciphers: Vec<Cipher>,
#[serde(rename = "Domains")]
pub domains: Value, pub domains: Value,
#[serde(rename = "Object")] #[serde(default)]
pub sends: Vec<Value>,
pub object: String, pub object: String,
} }