File tree 12 files changed +29
-1
lines changed
mysql/2023-10-21-221242_add_cipher_key
postgresql/2023-10-21-221242_add_cipher_key
sqlite/2023-10-21-221242_add_cipher_key
12 files changed +29
-1
lines changed Original file line number Diff line number Diff line change
1
+ ALTER TABLE ciphers
2
+ ADD COLUMN " key" TEXT ;
Original file line number Diff line number Diff line change
1
+ ALTER TABLE ciphers
2
+ ADD COLUMN " key" TEXT ;
Original file line number Diff line number Diff line change
1
+ ALTER TABLE ciphers
2
+ ADD COLUMN " key" TEXT ;
Original file line number Diff line number Diff line change @@ -206,6 +206,8 @@ pub struct CipherData {
206
206
// TODO: Some of these might appear all the time, no need for Option
207
207
OrganizationId : Option < String > ,
208
208
209
+ Key : Option < String > ,
210
+
209
211
/*
210
212
Login = 1,
211
213
SecureNote = 2,
@@ -483,6 +485,7 @@ pub async fn update_cipher_from_data(
483
485
None => err ! ( "Data missing" ) ,
484
486
} ;
485
487
488
+ cipher. key = data. Key ;
486
489
cipher. name = data. Name ;
487
490
cipher. notes = data. Notes ;
488
491
cipher. fields = data. Fields . map ( |f| _clean_cipher_data ( f) . to_string ( ) ) ;
Original file line number Diff line number Diff line change @@ -194,7 +194,12 @@ fn version() -> Json<&'static str> {
194
194
fn config ( ) -> Json < Value > {
195
195
let domain = crate :: CONFIG . domain ( ) ;
196
196
Json ( json ! ( {
197
- "version" : crate :: VERSION ,
197
+ // Note: The clients use this version to handle backwards compatibility concerns
198
+ // This means they expect a version that closely matches the Bitwarden server version
199
+ // We should make sure that we keep this updated when we support the new server features
200
+ // Version history:
201
+ // - Individual cipher key encryption: 2023.9.1
202
+ "version" : "2023.9.1" ,
198
203
"gitHash" : option_env!( "GIT_REV" ) ,
199
204
"server" : {
200
205
"name" : "Vaultwarden" ,
@@ -207,6 +212,12 @@ fn config() -> Json<Value> {
207
212
"notifications" : format!( "{domain}/notifications" ) ,
208
213
"sso" : "" ,
209
214
} ,
215
+ "featureStates" : {
216
+ // Any feature flags that we want the clients to use
217
+ // Can check the enabled ones at:
218
+ // https://vault.bitwarden.com/api/config
219
+ "autofill-v2" : true
220
+ } ,
210
221
"object" : "config" ,
211
222
} ) )
212
223
}
Original file line number Diff line number Diff line change @@ -23,6 +23,8 @@ db_object! {
23
23
pub user_uuid: Option <String >,
24
24
pub organization_uuid: Option <String >,
25
25
26
+ pub key: Option <String >,
27
+
26
28
/*
27
29
Login = 1,
28
30
SecureNote = 2,
@@ -62,6 +64,8 @@ impl Cipher {
62
64
user_uuid : None ,
63
65
organization_uuid : None ,
64
66
67
+ key : None ,
68
+
65
69
atype,
66
70
name,
67
71
@@ -203,6 +207,7 @@ impl Cipher {
203
207
"DeletedDate" : self . deleted_at. map_or( Value :: Null , |d| Value :: String ( format_date( & d) ) ) ,
204
208
"Reprompt" : self . reprompt. unwrap_or( RepromptType :: None as i32 ) ,
205
209
"OrganizationId" : self . organization_uuid,
210
+ "Key" : self . key,
206
211
"Attachments" : attachments_json,
207
212
// We have UseTotp set to true by default within the Organization model.
208
213
// This variable together with UsersGetPremium is used to show or hide the TOTP counter.
Original file line number Diff line number Diff line change @@ -15,6 +15,7 @@ table! {
15
15
updated_at -> Datetime ,
16
16
user_uuid -> Nullable <Text >,
17
17
organization_uuid -> Nullable <Text >,
18
+ key -> Nullable <Text >,
18
19
atype -> Integer ,
19
20
name -> Text ,
20
21
notes -> Nullable <Text >,
Original file line number Diff line number Diff line change @@ -15,6 +15,7 @@ table! {
15
15
updated_at -> Timestamp ,
16
16
user_uuid -> Nullable <Text >,
17
17
organization_uuid -> Nullable <Text >,
18
+ key -> Nullable <Text >,
18
19
atype -> Integer ,
19
20
name -> Text ,
20
21
notes -> Nullable <Text >,
Original file line number Diff line number Diff line change @@ -15,6 +15,7 @@ table! {
15
15
updated_at -> Timestamp ,
16
16
user_uuid -> Nullable <Text >,
17
17
organization_uuid -> Nullable <Text >,
18
+ key -> Nullable <Text >,
18
19
atype -> Integer ,
19
20
name -> Text ,
20
21
notes -> Nullable <Text >,
You can’t perform that action at this time.
0 commit comments