mirror of
https://github.com/dani-garcia/vaultwarden.wiki.git
synced 2026-10-23 01:18:09 +03:00
Compare commits
3
Commits
1f802f8e6a
...
df2cd3c869
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
df2cd3c869 | ||
|
|
0e93d15b73 | ||
|
|
d1cbd027cd |
No files matched your search
@@ -394,11 +394,15 @@
|
|||||||
## - "pm-5594-safari-account-switching": Enable account switching in Safari. (Safari >= 2026.2.0)
|
## - "pm-5594-safari-account-switching": Enable account switching in Safari. (Safari >= 2026.2.0)
|
||||||
## - "pm-32413-multi-client-password-management": Enable changing the master password directly in the client. (Desktop/Extension >= 2026.4.0)
|
## - "pm-32413-multi-client-password-management": Enable changing the master password directly in the client. (Desktop/Extension >= 2026.4.0)
|
||||||
## - "ssh-agent-v2": Enable newer SSH agent support. (Desktop >= 2026.2.1)
|
## - "ssh-agent-v2": Enable newer SSH agent support. (Desktop >= 2026.2.1)
|
||||||
|
## - "windows-desktop-autotype": Enable the autotype feature preview on Windows. (Desktop >= 2025.8.0)
|
||||||
|
## - "windows-desktop-autotype-ga": Enable the new, still in development, autotype implementation on Windows. (Desktop >= 2026.9.1)
|
||||||
|
## Only enable one of the two autotype flags, the clients disable autotype completely when both are enabled.
|
||||||
## - "pm-30529-webauthn-related-origins":
|
## - "pm-30529-webauthn-related-origins":
|
||||||
## - "pm-32009-new-item-types": Enable new item types: Bank Account, Driver's License, and Passport (Clients >= 2026.4.0)
|
## - "pm-32009-new-item-types": Enable new item types: Bank Account, Driver's License, and Passport (Clients >= 2026.4.0)
|
||||||
## - "pm-34171-card-scanner": Enable the new card scanner feature on mobile (Android >= 2026.4.1, iOS >= 2026.4.1)
|
## - "pm-34171-card-scanner": Enable the new card scanner feature on mobile (Android >= 2026.4.1, iOS >= 2026.4.1)
|
||||||
## - "enable-basic-auth-response": Enable HTTP Basic Auth autofill in the browser extension (Browser >= 2026.9.0)
|
## - "enable-basic-auth-response": Enable HTTP Basic Auth autofill in the browser extension (Browser >= 2026.9.0)
|
||||||
## - "undetermined-cipher-scenario-logic": Enable the rewritten add/update login notification triggering logic in the browser extension (Browser >= 2026.2.0)
|
## - "undetermined-cipher-scenario-logic": Enable the rewritten add/update login notification triggering logic in the browser extension (Browser >= 2026.2.0)
|
||||||
|
## - "biometrics-sdk-ipc": Enable biometric unlock over the SDK IPC framework (Desktop >= 2026.9.0, Browser >= 2026.9.0)
|
||||||
# EXPERIMENTAL_CLIENT_FEATURE_FLAGS=
|
# EXPERIMENTAL_CLIENT_FEATURE_FLAGS=
|
||||||
|
|
||||||
## Require new device emails. When a user logs in an email is required to be sent.
|
## Require new device emails. When a user logs in an email is required to be sent.
|
||||||
|
|||||||
@@ -0,0 +1 @@
|
|||||||
|
ALTER TABLE org_policies DROP COLUMN revision_date;
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
-- DATETIME (not TIMESTAMP) to match this repo's convention for revision_date
|
||||||
|
-- columns elsewhere, and to avoid MySQL's implicit session-timezone
|
||||||
|
-- conversion and 2038 range limit on TIMESTAMP.
|
||||||
|
ALTER TABLE org_policies
|
||||||
|
ADD COLUMN revision_date DATETIME NOT NULL DEFAULT '1970-01-01 00:00:00';
|
||||||
|
|
||||||
|
UPDATE org_policies SET revision_date = UTC_TIMESTAMP();
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
ALTER TABLE org_policies DROP COLUMN revision_date;
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
-- Backfill via `now() AT TIME ZONE 'utc'` rather than a DEFAULT of now():
|
||||||
|
-- assigning timestamptz now() into a naive TIMESTAMP column casts through
|
||||||
|
-- the server's TimeZone GUC, so a DEFAULT now() would store local wall-clock
|
||||||
|
-- instead of UTC on non-UTC servers, unlike every other naive-UTC timestamp
|
||||||
|
-- column in this schema.
|
||||||
|
ALTER TABLE org_policies
|
||||||
|
ADD COLUMN revision_date TIMESTAMP NOT NULL DEFAULT '1970-01-01 00:00:00';
|
||||||
|
|
||||||
|
UPDATE org_policies SET revision_date = (now() AT TIME ZONE 'utc');
|
||||||
Whitespace-only changes.
@@ -0,0 +1,6 @@
|
|||||||
|
-- SQLite forbids non-constant defaults in ALTER TABLE ... ADD COLUMN, so add
|
||||||
|
-- the column with a constant placeholder and backfill separately.
|
||||||
|
ALTER TABLE org_policies
|
||||||
|
ADD COLUMN revision_date DATETIME NOT NULL DEFAULT '1970-01-01 00:00:00';
|
||||||
|
|
||||||
|
UPDATE org_policies SET revision_date = CURRENT_TIMESTAMP;
|
||||||
@@ -1430,7 +1430,10 @@ pub const SUPPORTED_FEATURE_FLAGS: &[&str] = &[
|
|||||||
"undetermined-cipher-scenario-logic",
|
"undetermined-cipher-scenario-logic",
|
||||||
"enable-basic-auth-response",
|
"enable-basic-auth-response",
|
||||||
"ssh-agent-v2",
|
"ssh-agent-v2",
|
||||||
|
"windows-desktop-autotype",
|
||||||
|
"windows-desktop-autotype-ga",
|
||||||
// Key Management Team
|
// Key Management Team
|
||||||
|
"biometrics-sdk-ipc",
|
||||||
"windows-native-credential-sync",
|
"windows-native-credential-sync",
|
||||||
// Mobile Team
|
// Mobile Team
|
||||||
"pm-34171-card-scanner",
|
"pm-34171-card-scanner",
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
use chrono::{NaiveDateTime, Utc};
|
||||||
use derive_more::{AsRef, From};
|
use derive_more::{AsRef, From};
|
||||||
use diesel::prelude::*;
|
use diesel::prelude::*;
|
||||||
use serde::Deserialize;
|
use serde::Deserialize;
|
||||||
@@ -11,6 +12,7 @@ use crate::{
|
|||||||
schema::{org_policies, users_organizations},
|
schema::{org_policies, users_organizations},
|
||||||
},
|
},
|
||||||
error::MapResult,
|
error::MapResult,
|
||||||
|
util::format_date,
|
||||||
};
|
};
|
||||||
|
|
||||||
use super::{Membership, MembershipId, MembershipStatus, MembershipType, OrganizationId, TwoFactor, UserId};
|
use super::{Membership, MembershipId, MembershipStatus, MembershipType, OrganizationId, TwoFactor, UserId};
|
||||||
@@ -24,6 +26,7 @@ pub struct OrgPolicy {
|
|||||||
pub atype: i32,
|
pub atype: i32,
|
||||||
pub enabled: bool,
|
pub enabled: bool,
|
||||||
pub data: String,
|
pub data: String,
|
||||||
|
pub revision_date: NaiveDateTime,
|
||||||
}
|
}
|
||||||
|
|
||||||
// https://github.com/bitwarden/server/blob/9ebe16587175b1c0e9208f84397bb75d0d595510/src/Core/AdminConsole/Enums/PolicyType.cs
|
// https://github.com/bitwarden/server/blob/9ebe16587175b1c0e9208f84397bb75d0d595510/src/Core/AdminConsole/Enums/PolicyType.cs
|
||||||
@@ -46,7 +49,7 @@ pub enum OrgPolicyType {
|
|||||||
RemoveUnlockWithPin = 14,
|
RemoveUnlockWithPin = 14,
|
||||||
RestrictedItemTypes = 15,
|
RestrictedItemTypes = 15,
|
||||||
UriMatchDefaults = 16,
|
UriMatchDefaults = 16,
|
||||||
// AutotypeDefaultSetting = 17, // Not supported yet
|
AutotypeDefaultSetting = 17,
|
||||||
// AutoConfirm = 18, // Not supported (not implemented yet)
|
// AutoConfirm = 18, // Not supported (not implemented yet)
|
||||||
// BlockClaimedDomainAccountCreation = 19, // Not supported (Not AGPLv3 Licensed)
|
// BlockClaimedDomainAccountCreation = 19, // Not supported (Not AGPLv3 Licensed)
|
||||||
OrganizationUserNotification = 20,
|
OrganizationUserNotification = 20,
|
||||||
@@ -77,6 +80,7 @@ impl OrgPolicy {
|
|||||||
atype: atype as i32,
|
atype: atype as i32,
|
||||||
enabled,
|
enabled,
|
||||||
data,
|
data,
|
||||||
|
revision_date: Utc::now().naive_utc(),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -92,7 +96,7 @@ impl OrgPolicy {
|
|||||||
"type": self.atype,
|
"type": self.atype,
|
||||||
"data": data_json,
|
"data": data_json,
|
||||||
"enabled": self.enabled,
|
"enabled": self.enabled,
|
||||||
"revisionDate": null,
|
"revisionDate": format_date(&self.revision_date),
|
||||||
"object": "policy",
|
"object": "policy",
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -110,11 +114,13 @@ impl OrgPolicy {
|
|||||||
|
|
||||||
/// Database methods
|
/// Database methods
|
||||||
impl OrgPolicy {
|
impl OrgPolicy {
|
||||||
pub async fn save(&self, conn: &DbConn) -> EmptyResult {
|
pub async fn save(&mut self, conn: &DbConn) -> EmptyResult {
|
||||||
|
self.revision_date = Utc::now().naive_utc();
|
||||||
|
|
||||||
db_run! { conn:
|
db_run! { conn:
|
||||||
sqlite, mysql {
|
sqlite, mysql {
|
||||||
match diesel::replace_into(org_policies::table)
|
match diesel::replace_into(org_policies::table)
|
||||||
.values(self)
|
.values(&*self)
|
||||||
.execute(conn)
|
.execute(conn)
|
||||||
{
|
{
|
||||||
Ok(_) => Ok(()),
|
Ok(_) => Ok(()),
|
||||||
@@ -122,7 +128,7 @@ impl OrgPolicy {
|
|||||||
Err(diesel::result::Error::DatabaseError(diesel::result::DatabaseErrorKind::ForeignKeyViolation, _)) => {
|
Err(diesel::result::Error::DatabaseError(diesel::result::DatabaseErrorKind::ForeignKeyViolation, _)) => {
|
||||||
diesel::update(org_policies::table)
|
diesel::update(org_policies::table)
|
||||||
.filter(org_policies::uuid.eq(&self.uuid))
|
.filter(org_policies::uuid.eq(&self.uuid))
|
||||||
.set(self)
|
.set(&*self)
|
||||||
.execute(conn)
|
.execute(conn)
|
||||||
.map_res("Error saving org_policy")
|
.map_res("Error saving org_policy")
|
||||||
}
|
}
|
||||||
@@ -142,10 +148,10 @@ impl OrgPolicy {
|
|||||||
.map_res("Error deleting org_policy for insert")?;
|
.map_res("Error deleting org_policy for insert")?;
|
||||||
|
|
||||||
diesel::insert_into(org_policies::table)
|
diesel::insert_into(org_policies::table)
|
||||||
.values(self)
|
.values(&*self)
|
||||||
.on_conflict(org_policies::uuid)
|
.on_conflict(org_policies::uuid)
|
||||||
.do_update()
|
.do_update()
|
||||||
.set(self)
|
.set(&*self)
|
||||||
.execute(conn)
|
.execute(conn)
|
||||||
.map_res("Error saving org_policy")
|
.map_res("Error saving org_policy")
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -116,6 +116,7 @@ table! {
|
|||||||
atype -> Integer,
|
atype -> Integer,
|
||||||
enabled -> Bool,
|
enabled -> Bool,
|
||||||
data -> Text,
|
data -> Text,
|
||||||
|
revision_date -> Timestamp,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user