Update dependencies and fix some warnings

This commit is contained in:
Daniel García
2019-04-11 15:32:38 +02:00
parent d89bd707a8
commit 621f607297
7 changed files with 98 additions and 49 deletions

135
Cargo.lock generated

File diff suppressed because it is too large Load Diff

View File

@ -23,7 +23,7 @@ rocket = { version = "0.4.0", features = ["tls"], default-features = false }
rocket_contrib = "0.4.0"
# HTTP client
reqwest = "0.9.13"
reqwest = "0.9.14"
# multipart/form-data support
multipart = { version = "0.16.1", features = ["server"], default-features = false }

View File

@ -1 +1 @@
nightly-2019-03-14
nightly-2019-04-11

View File

@ -787,7 +787,6 @@ fn _duo_api_request(method: &str, path: &str, params: &str) -> EmptyResult {
use std::str::FromStr;
use chrono::Utc;
use reqwest::{header::*, Client, Method};
let ik = CONFIG.duo_ikey().unwrap();

View File

@ -2,7 +2,7 @@
// PBKDF2 derivation
//
use ring::{digest, pbkdf2};
use ring::{digest, pbkdf2, hmac};
static DIGEST_ALG: &digest::Algorithm = &digest::SHA256;
const OUTPUT_LEN: usize = digest::SHA256_OUTPUT_LEN;
@ -24,7 +24,6 @@ pub fn verify_password_hash(secret: &[u8], salt: &[u8], previous: &[u8], iterati
//
pub fn hmac_sign(key: &str, data:&str) -> String {
use data_encoding::HEXLOWER;
use ring::{digest, hmac};
let key = hmac::SigningKey::new(&digest::SHA1, key.as_bytes());
let signature = hmac::sign(&key, data.as_bytes());

View File

@ -72,9 +72,7 @@ use crate::error::MapResult;
/// Database methods
impl Cipher {
pub fn to_json(&self, host: &str, user_uuid: &str, conn: &DbConn) -> Value {
use super::Attachment;
use crate::util::format_date;
use serde_json;
let attachments = Attachment::find_by_cipher(&self.uuid, conn);
let attachments_json: Vec<Value> = attachments.iter().map(|c| c.to_json(host)).collect();

View File

@ -113,8 +113,6 @@ use crate::error::MapResult;
/// Database methods
impl User {
pub fn to_json(&self, conn: &DbConn) -> Value {
use super::{TwoFactor, UserOrganization};
let orgs = UserOrganization::find_by_user(&self.uuid, conn);
let orgs_json: Vec<Value> = orgs.iter().map(|c| c.to_json(&conn)).collect();
let twofactor_enabled = !TwoFactor::find_by_user(&self.uuid, conn).is_empty();