1
0
mirror of https://github.com/matrix-org/matrix-authentication-service.git synced 2025-08-07 17:03:01 +03:00

Remove some unnecessary dependencies

This commit is contained in:
Quentin Gliech
2022-04-08 09:10:17 +02:00
parent 19f6cf851a
commit a3f1a880aa
6 changed files with 12 additions and 78 deletions

View File

@@ -8,7 +8,7 @@ license = "Apache-2.0"
[dependencies]
tokio = { version = "1.17.0", features = ["full"] }
futures = "0.3.21"
anyhow = { version = "1.0.56", features = ["backtrace"] }
anyhow = "1.0.56"
clap = { version = "3.1.8", features = ["derive"] }
dotenv = "0.15.0"
schemars = { version = "0.8.8", features = ["url", "chrono"] }
@@ -21,8 +21,6 @@ argon2 = { version = "0.4.0", features = ["password-hash"] }
reqwest = { version = "0.11.10", features = ["rustls-tls"], default-features = false, optional = true }
watchman_client = "0.7.2"
atty = "0.2.14"
rand = "0.8.5"
data-encoding = "2.3.2"
tracing = "0.1.32"
tracing-appender = "0.2.2"

View File

@@ -14,7 +14,6 @@
use argon2::Argon2;
use clap::Parser;
use data_encoding::BASE64;
use mas_config::{DatabaseConfig, RootConfig};
use mas_storage::{
oauth2::client::{insert_client_from_config, lookup_client_by_client_id, truncate_clients},
@@ -117,14 +116,7 @@ impl Options {
// TODO: should be moved somewhere else
let encrypted_client_secret = client_secret
.map(|client_secret| {
let nonce: [u8; 12] = rand::random();
let message = encrypter.encrypt(&nonce, client_secret.as_bytes())?;
let concat = [&nonce[..], &message[..]].concat();
let res = BASE64.encode(&concat);
anyhow::Ok(res)
})
.map(|client_secret| encrypter.encryt_to_string(client_secret.as_bytes()))
.transpose()?;
insert_client_from_config(