Updated dependencies and fixed errors

This commit is contained in:
Daniel García 2018-09-13 16:04:00 +02:00
parent a01fee0b9f
commit 928e2424c0
No known key found for this signature in database
GPG Key ID: FC8A7D14C3CD543A
4 changed files with 365 additions and 136 deletions

482
Cargo.lock generated

File diff suppressed because it is too large Load Diff

View File

@ -13,7 +13,7 @@ rocket_contrib = "0.3.16"
reqwest = "0.8.8"
# multipart/form-data support
multipart = "0.15.2"
multipart = "0.15.3"
# WebSockets library
ws = "0.7.8"
@ -25,9 +25,9 @@ rmpv = "0.4.0"
chashmap = "2.2.0"
# A generic serialization/deserialization framework
serde = "1.0.75"
serde_derive = "1.0.75"
serde_json = "1.0.26"
serde = "1.0.77"
serde_derive = "1.0.77"
serde_json = "1.0.27"
# A safe, extensible ORM and Query builder
diesel = { version = "1.3.2", features = ["sqlite", "chrono", "r2d2"] }
@ -40,7 +40,7 @@ libsqlite3-sys = { version = "0.9.3", features = ["bundled"] }
ring = { version = "= 0.11.0", features = ["rsa_signing"] }
# UUID generation
uuid = { version = "0.6.5", features = ["v4"] }
uuid = { version = "0.7.0", features = ["v4"] }
# Date and time library for Rust
chrono = "0.4.6"

View File

@ -1 +1 @@
nightly-2018-08-24
nightly-2018-09-12

View File

@ -1,9 +1,10 @@
use rocket::State;
use rocket_contrib::{Json, Value};
use CONFIG;
use db::DbConn;
use db::models::*;
use api::{PasswordData, JsonResult, EmptyResult, NumberOrString, JsonUpcase};
use api::{PasswordData, JsonResult, EmptyResult, NumberOrString, JsonUpcase, WebSocketUsers, UpdateType};
use auth::{Headers, AdminHeaders, OwnerHeaders};
use serde::{Deserialize, Deserializer};
@ -601,7 +602,7 @@ struct RelationsData {
}
#[post("/ciphers/import-organization?<query>", data = "<data>")]
fn post_org_import(query: OrgIdData, data: JsonUpcase<ImportData>, headers: Headers, conn: DbConn) -> EmptyResult {
fn post_org_import(query: OrgIdData, data: JsonUpcase<ImportData>, headers: Headers, conn: DbConn, ws: State<WebSocketUsers>) -> EmptyResult {
let data: ImportData = data.into_inner().data;
let org_id = query.organizationId;
@ -630,7 +631,7 @@ fn post_org_import(query: OrgIdData, data: JsonUpcase<ImportData>, headers: Head
// Read and create the ciphers
let ciphers: Vec<_> = data.Ciphers.into_iter().map(|cipher_data| {
let mut cipher = Cipher::new(cipher_data.Type, cipher_data.Name.clone());
update_cipher_from_data(&mut cipher, cipher_data, &headers, false, &conn).ok();
update_cipher_from_data(&mut cipher, cipher_data, &headers, false, &conn, &ws, UpdateType::SyncCipherCreate).ok();
cipher
}).collect();