1
0
Fork 0
mirror of https://github.com/dani-garcia/vaultwarden.git synced 2025-09-29 21:11:18 +00:00

Improvements and error handling

This commit is contained in:
Timshel 2024-09-12 15:18:39 +02:00
commit fefa55cad4
69 changed files with 2744 additions and 627 deletions

View file

@ -27,7 +27,7 @@ pub enum OrgPolicyType {
MasterPassword = 1,
PasswordGenerator = 2,
SingleOrg = 3,
RequireSso = 4,
// RequireSso = 4, // Not supported
PersonalOwnership = 5,
DisableSend = 6,
SendOptions = 7,
@ -77,12 +77,11 @@ impl OrgPolicy {
}
pub fn to_json(&self) -> Value {
let data_json: Value = serde_json::from_str(&self.data).unwrap_or(Value::Null);
json!({
"id": self.uuid,
"organizationId": self.org_uuid,
"type": self.atype,
"data": data_json,
"data": serde_json::from_str(&self.data).unwrap_or(Value::Null),
"enabled": self.enabled,
"object": "policy",
})