merge: branch 'izzy/patch/easypwned'
fix: configure new authifier properties
This commit is contained in:
32
Cargo.lock
generated
32
Cargo.lock
generated
@@ -443,9 +443,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "authifier"
|
name = "authifier"
|
||||||
version = "1.0.10"
|
version = "1.0.13"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "edfe88c4a9fcf24b18a216b27c9766966af2a40603d24c7782237afd6ca0d5cd"
|
checksum = "ca26cb6b5ab776a1de5a8122fe6cc77fadd84fed30704c496f2aca451637877b"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"async-std",
|
"async-std",
|
||||||
"async-trait",
|
"async-trait",
|
||||||
@@ -454,7 +454,7 @@ dependencies = [
|
|||||||
"chrono",
|
"chrono",
|
||||||
"futures",
|
"futures",
|
||||||
"handlebars",
|
"handlebars",
|
||||||
"iso8601-timestamp 0.1.11",
|
"iso8601-timestamp",
|
||||||
"lazy_static",
|
"lazy_static",
|
||||||
"lettre",
|
"lettre",
|
||||||
"log",
|
"log",
|
||||||
@@ -470,6 +470,7 @@ dependencies = [
|
|||||||
"schemars",
|
"schemars",
|
||||||
"serde",
|
"serde",
|
||||||
"serde_json",
|
"serde_json",
|
||||||
|
"sha1",
|
||||||
"totp-lite",
|
"totp-lite",
|
||||||
"ulid 0.5.0",
|
"ulid 0.5.0",
|
||||||
"validator 0.15.0",
|
"validator 0.15.0",
|
||||||
@@ -3647,17 +3648,6 @@ dependencies = [
|
|||||||
"waker-fn",
|
"waker-fn",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "iso8601-timestamp"
|
|
||||||
version = "0.1.11"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "b088f3296223f11d6bd70998132653b30b6f39e6ab4be055c0bda486fa8d11c7"
|
|
||||||
dependencies = [
|
|
||||||
"generic-array 0.14.7",
|
|
||||||
"serde",
|
|
||||||
"time",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "iso8601-timestamp"
|
name = "iso8601-timestamp"
|
||||||
version = "0.2.17"
|
version = "0.2.17"
|
||||||
@@ -6095,7 +6085,7 @@ dependencies = [
|
|||||||
"futures",
|
"futures",
|
||||||
"indexmap 1.9.3",
|
"indexmap 1.9.3",
|
||||||
"isahc",
|
"isahc",
|
||||||
"iso8601-timestamp 0.2.17",
|
"iso8601-timestamp",
|
||||||
"linkify 0.8.1",
|
"linkify 0.8.1",
|
||||||
"log",
|
"log",
|
||||||
"lru 0.11.1",
|
"lru 0.11.1",
|
||||||
@@ -6140,7 +6130,7 @@ dependencies = [
|
|||||||
"env_logger",
|
"env_logger",
|
||||||
"futures",
|
"futures",
|
||||||
"impl_ops",
|
"impl_ops",
|
||||||
"iso8601-timestamp 0.2.17",
|
"iso8601-timestamp",
|
||||||
"lettre",
|
"lettre",
|
||||||
"linkify 0.6.0",
|
"linkify 0.6.0",
|
||||||
"log",
|
"log",
|
||||||
@@ -6229,7 +6219,7 @@ name = "revolt-models"
|
|||||||
version = "0.8.4"
|
version = "0.8.4"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"indexmap 1.9.3",
|
"indexmap 1.9.3",
|
||||||
"iso8601-timestamp 0.2.17",
|
"iso8601-timestamp",
|
||||||
"num_enum 0.6.1",
|
"num_enum 0.6.1",
|
||||||
"once_cell",
|
"once_cell",
|
||||||
"regex",
|
"regex",
|
||||||
@@ -6299,7 +6289,7 @@ dependencies = [
|
|||||||
"base64 0.22.1",
|
"base64 0.22.1",
|
||||||
"fcm_v1",
|
"fcm_v1",
|
||||||
"isahc",
|
"isahc",
|
||||||
"iso8601-timestamp 0.2.17",
|
"iso8601-timestamp",
|
||||||
"log",
|
"log",
|
||||||
"pretty_env_logger",
|
"pretty_env_logger",
|
||||||
"revolt-config",
|
"revolt-config",
|
||||||
@@ -6517,12 +6507,12 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "rocket_authifier"
|
name = "rocket_authifier"
|
||||||
version = "1.0.10"
|
version = "1.0.13"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "c2aa1bfaee106d088b78de7c3cc2a8ab2c9e05a0286b6b912f0b18ea656b329e"
|
checksum = "0490f4a6f0a359a9ffff9acbdf4eddf49890ec94941b8ddd88163c16f6159f5a"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"authifier",
|
"authifier",
|
||||||
"iso8601-timestamp 0.1.11",
|
"iso8601-timestamp",
|
||||||
"revolt_okapi",
|
"revolt_okapi",
|
||||||
"revolt_rocket_okapi",
|
"revolt_rocket_okapi",
|
||||||
"rocket",
|
"rocket",
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ async-std = { version = "1.8.0", features = [
|
|||||||
] }
|
] }
|
||||||
|
|
||||||
# core
|
# core
|
||||||
authifier = { version = "1.0.10" }
|
authifier = { version = "1.0.13" }
|
||||||
revolt-result = { path = "../core/result" }
|
revolt-result = { path = "../core/result" }
|
||||||
revolt-models = { path = "../core/models" }
|
revolt-models = { path = "../core/models" }
|
||||||
revolt-config = { path = "../core/config" }
|
revolt-config = { path = "../core/config" }
|
||||||
|
|||||||
@@ -54,6 +54,8 @@ authifier_shield_key = ""
|
|||||||
voso_legacy_token = ""
|
voso_legacy_token = ""
|
||||||
# Whether services are behind the Cloudflare network
|
# Whether services are behind the Cloudflare network
|
||||||
trust_cloudflare = false
|
trust_cloudflare = false
|
||||||
|
# easypwned endpoint
|
||||||
|
easypwned = ""
|
||||||
|
|
||||||
[api.security.captcha]
|
[api.security.captcha]
|
||||||
# hCaptcha configuration
|
# hCaptcha configuration
|
||||||
|
|||||||
@@ -168,6 +168,7 @@ pub struct ApiSecurity {
|
|||||||
pub voso_legacy_token: String,
|
pub voso_legacy_token: String,
|
||||||
pub captcha: ApiSecurityCaptcha,
|
pub captcha: ApiSecurityCaptcha,
|
||||||
pub trust_cloudflare: bool,
|
pub trust_cloudflare: bool,
|
||||||
|
pub easypwned: String,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Deserialize, Debug, Clone)]
|
#[derive(Deserialize, Debug, Clone)]
|
||||||
|
|||||||
@@ -97,7 +97,7 @@ web-push = "0.10.0"
|
|||||||
revolt_a2 = { version = "0.10", default-features = false, features = ["ring"] }
|
revolt_a2 = { version = "0.10", default-features = false, features = ["ring"] }
|
||||||
|
|
||||||
# Authifier
|
# Authifier
|
||||||
authifier = { version = "1.0.10", features = ["rocket_impl"] }
|
authifier = { version = "1.0.13", features = ["rocket_impl"] }
|
||||||
|
|
||||||
# RabbitMQ
|
# RabbitMQ
|
||||||
amqprs = { version = "1.7.0" }
|
amqprs = { version = "1.7.0" }
|
||||||
|
|||||||
@@ -102,6 +102,9 @@ impl Database {
|
|||||||
let config = config().await;
|
let config = config().await;
|
||||||
|
|
||||||
let mut auth_config = authifier::Config {
|
let mut auth_config = authifier::Config {
|
||||||
|
password_scanning: authifier::config::PasswordScanning::EasyPwned {
|
||||||
|
endpoint: config.api.security.easypwned,
|
||||||
|
},
|
||||||
email_verification: if !config.api.smtp.host.is_empty() {
|
email_verification: if !config.api.smtp.host.is_empty() {
|
||||||
EmailVerificationConfig::Enabled {
|
EmailVerificationConfig::Enabled {
|
||||||
smtp: SMTPSettings {
|
smtp: SMTPSettings {
|
||||||
@@ -118,6 +121,7 @@ impl Database {
|
|||||||
),
|
),
|
||||||
port: config.api.smtp.port,
|
port: config.api.smtp.port,
|
||||||
use_tls: config.api.smtp.use_tls,
|
use_tls: config.api.smtp.use_tls,
|
||||||
|
use_starttls: None,
|
||||||
},
|
},
|
||||||
expiry: Default::default(),
|
expiry: Default::default(),
|
||||||
templates: if config.production {
|
templates: if config.production {
|
||||||
@@ -134,6 +138,13 @@ impl Database {
|
|||||||
url: format!("{}/login/reset/", config.hosts.app),
|
url: format!("{}/login/reset/", config.hosts.app),
|
||||||
html: Some(include_str!("../../templates/reset.html").into()),
|
html: Some(include_str!("../../templates/reset.html").into()),
|
||||||
},
|
},
|
||||||
|
reset_existing: Template {
|
||||||
|
title: "You already have a Revolt account, reset your password."
|
||||||
|
.into(),
|
||||||
|
text: include_str!("../../templates/reset.txt").into(),
|
||||||
|
url: format!("{}/login/reset/", config.hosts.app),
|
||||||
|
html: Some(include_str!("../../templates/reset.html").into()),
|
||||||
|
},
|
||||||
deletion: Template {
|
deletion: Template {
|
||||||
title: "Confirm account deletion.".into(),
|
title: "Confirm account deletion.".into(),
|
||||||
text: include_str!("../../templates/deletion.txt").into(),
|
text: include_str!("../../templates/deletion.txt").into(),
|
||||||
@@ -156,9 +167,16 @@ impl Database {
|
|||||||
url: format!("{}/login/reset/", config.hosts.app),
|
url: format!("{}/login/reset/", config.hosts.app),
|
||||||
html: None,
|
html: None,
|
||||||
},
|
},
|
||||||
|
reset_existing: Template {
|
||||||
|
title: "Reset your password.".into(),
|
||||||
|
text: include_str!("../../templates/reset.whitelabel.txt").into(),
|
||||||
|
url: format!("{}/login/reset/", config.hosts.app),
|
||||||
|
html: None,
|
||||||
|
},
|
||||||
deletion: Template {
|
deletion: Template {
|
||||||
title: "Confirm account deletion.".into(),
|
title: "Confirm account deletion.".into(),
|
||||||
text: include_str!("../../templates/deletion.whitelabel.txt").into(),
|
text: include_str!("../../templates/deletion.whitelabel.txt")
|
||||||
|
.into(),
|
||||||
url: format!("{}/delete/", config.hosts.app),
|
url: format!("{}/delete/", config.hosts.app),
|
||||||
html: None,
|
html: None,
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -52,10 +52,11 @@ async-std = { version = "1.8.0", features = [
|
|||||||
lettre = "0.10.0-alpha.4"
|
lettre = "0.10.0-alpha.4"
|
||||||
|
|
||||||
# web
|
# web
|
||||||
|
|
||||||
rocket = { version = "0.5.1", default-features = false, features = ["json"] }
|
rocket = { version = "0.5.1", default-features = false, features = ["json"] }
|
||||||
rocket_cors = { git = "https://github.com/lawliet89/rocket_cors", rev = "072d90359b23e9b291df6b672c07c93de9c46011" }
|
rocket_cors = { git = "https://github.com/lawliet89/rocket_cors", rev = "072d90359b23e9b291df6b672c07c93de9c46011" }
|
||||||
rocket_empty = { version = "0.1.1", features = ["schema"] }
|
rocket_empty = { version = "0.1.1", features = ["schema"] }
|
||||||
rocket_authifier = { version = "1.0.10" }
|
rocket_authifier = { version = "1.0.13" }
|
||||||
rocket_prometheus = "0.10.0-rc.3"
|
rocket_prometheus = "0.10.0-rc.3"
|
||||||
|
|
||||||
# spec generation
|
# spec generation
|
||||||
@@ -66,7 +67,7 @@ revolt_rocket_okapi = { version = "0.10.0", features = ["swagger"] }
|
|||||||
amqprs = { version = "1.7.0" }
|
amqprs = { version = "1.7.0" }
|
||||||
|
|
||||||
# core
|
# core
|
||||||
authifier = "1.0.10"
|
authifier = "1.0.13"
|
||||||
revolt-config = { path = "../core/config" }
|
revolt-config = { path = "../core/config" }
|
||||||
revolt-database = { path = "../core/database", features = [
|
revolt-database = { path = "../core/database", features = [
|
||||||
"rocket-impl",
|
"rocket-impl",
|
||||||
|
|||||||
Reference in New Issue
Block a user