Spiegel von
https://github.com/dani-garcia/vaultwarden.git
synchronisiert 2025-03-01 14:57:01 +01:00
Remove OrganizationId guard from get_master_password_policy
Dieser Commit ist enthalten in:
Ursprung
6129214538
Commit
2f4d2daec6
2 geänderte Dateien mit 9 neuen und 4 gelöschten Zeilen
|
@ -1880,15 +1880,20 @@ async fn list_policies_token(org_id: OrganizationId, token: &str, mut conn: DbCo
|
||||||
}
|
}
|
||||||
|
|
||||||
// Called during the SSO enrollment.
|
// Called during the SSO enrollment.
|
||||||
|
// Cannot use the OrganizationId guard since the Org does not exists.
|
||||||
#[get("/organizations/<org_id>/policies/master-password", rank = 1)]
|
#[get("/organizations/<org_id>/policies/master-password", rank = 1)]
|
||||||
fn get_master_password_policy(org_id: OrganizationId, _headers: Headers) -> JsonResult {
|
fn get_master_password_policy(org_id: &str, _headers: Headers) -> JsonResult {
|
||||||
let data = match CONFIG.sso_master_password_policy() {
|
let data = match CONFIG.sso_master_password_policy() {
|
||||||
Some(policy) => policy,
|
Some(policy) => policy,
|
||||||
None => "null".to_string(),
|
None => "null".to_string(),
|
||||||
};
|
};
|
||||||
|
|
||||||
let policy =
|
let policy = OrgPolicy::new(
|
||||||
OrgPolicy::new(org_id, OrgPolicyType::MasterPassword, CONFIG.sso_master_password_policy().is_some(), data);
|
OrganizationId(org_id.to_string()),
|
||||||
|
OrgPolicyType::MasterPassword,
|
||||||
|
CONFIG.sso_master_password_policy().is_some(),
|
||||||
|
data,
|
||||||
|
);
|
||||||
|
|
||||||
Ok(Json(policy.to_json()))
|
Ok(Json(policy.to_json()))
|
||||||
}
|
}
|
||||||
|
|
|
@ -1156,7 +1156,7 @@ impl OrganizationApiKey {
|
||||||
)]
|
)]
|
||||||
#[deref(forward)]
|
#[deref(forward)]
|
||||||
#[from(forward)]
|
#[from(forward)]
|
||||||
pub struct OrganizationId(String);
|
pub struct OrganizationId(pub String);
|
||||||
|
|
||||||
#[derive(
|
#[derive(
|
||||||
Clone,
|
Clone,
|
||||||
|
|
Laden …
Tabelle hinzufügen
In neuem Issue referenzieren