chore: bump rauth; adds account deletion

closes #159
This commit is contained in:
Paul Makles
2022-06-09 16:00:59 +01:00
parent 80af18761f
commit f8b5c25c17
6 changed files with 26 additions and 7 deletions

12
Cargo.lock generated
View File

@@ -2505,7 +2505,7 @@ dependencies = [
[[package]]
name = "rauth"
version = "1.0.0"
source = "git+https://github.com/insertish/rauth?rev=1fe2187ad30231b6ba6432167ba0d929e97ffcc2#1fe2187ad30231b6ba6432167ba0d929e97ffcc2"
source = "git+https://github.com/insertish/rauth?rev=e71d54eba4712b6c6a8a4354ad9fa39677714e1f#e71d54eba4712b6c6a8a4354ad9fa39677714e1f"
dependencies = [
"async-std",
"async-trait",
@@ -2986,15 +2986,23 @@ dependencies = [
[[package]]
name = "rocket_rauth"
version = "1.0.0"
source = "git+https://github.com/insertish/rauth?rev=1fe2187ad30231b6ba6432167ba0d929e97ffcc2#1fe2187ad30231b6ba6432167ba0d929e97ffcc2"
source = "git+https://github.com/insertish/rauth?rev=e71d54eba4712b6c6a8a4354ad9fa39677714e1f#e71d54eba4712b6c6a8a4354ad9fa39677714e1f"
dependencies = [
"async-std",
"base32",
"chrono",
"iso8601-timestamp",
"mongodb",
"okapi",
"rauth",
"regex",
"reqwest",
"rocket",
"rocket_empty",
"rocket_okapi",
"schemars",
"serde",
"serde_json",
]
[[package]]

View File

@@ -52,7 +52,7 @@ mobc-redis = { version = "0.7.0", default-features = false, features = ["async-s
# web
rocket = { version = "0.5.0-rc.2", default-features = false, features = ["json"] }
rocket_empty = { git = "https://github.com/insertish/rocket_empty", branch = "master" }
rocket_rauth = { git = "https://github.com/insertish/rauth", rev = "1fe2187ad30231b6ba6432167ba0d929e97ffcc2" }
rocket_rauth = { git = "https://github.com/insertish/rauth", rev = "e71d54eba4712b6c6a8a4354ad9fa39677714e1f" }
# spec generation
schemars = "0.8.8"

View File

@@ -84,7 +84,7 @@ rocket_empty = { optional = true, git = "https://github.com/insertish/rocket_emp
rocket_cors = { optional = true, git = "https://github.com/lawliet89/rocket_cors", rev = "5843861a88958c16bfaa0b40f0d8910772bcd2f6" }
# rAuth
rauth = { git = "https://github.com/insertish/rauth", rev = "1fe2187ad30231b6ba6432167ba0d929e97ffcc2", features = [ "async-std-runtime" ] }
rauth = { git = "https://github.com/insertish/rauth", rev = "e71d54eba4712b6c6a8a4354ad9fa39677714e1f", features = [ "async-std-runtime" ] }
# Sentry
sentry = "0.25.0"

View File

@@ -0,0 +1,5 @@
You requested to have your account deleted, if you did not perform this action please take measures to secure your account immediately.
Confirm here: {{url}}
Sent by Revolt.

View File

@@ -55,16 +55,16 @@ impl<'r> OpenApiFromRequest<'r> for User {
_required: bool,
) -> rocket_okapi::Result<RequestHeaderInput> {
let mut requirements = schemars::Map::new();
requirements.insert("Api Key".to_owned(), vec![]);
requirements.insert("Session Token".to_owned(), vec![]);
Ok(RequestHeaderInput::Security(
"Api Key".to_owned(),
"Session Token".to_owned(),
SecurityScheme {
data: SecuritySchemeData::ApiKey {
name: "x-session-token".to_owned(),
location: "header".to_owned(),
},
description: Some("Session Token".to_owned()),
description: Some("Used to authenticate as a user.".to_owned()),
extensions: schemars::Map::new(),
},
requirements,

View File

@@ -34,6 +34,12 @@ pub fn config() -> Config {
url: format!("{}/login/reset/", *APP_URL),
html: None,
},
deletion: Template {
title: "Confirm account deletion.".into(),
text: include_str!(crate::asset!("templates/deletion.txt")).into(),
url: format!("{}/delete/", *APP_URL),
html: None,
},
welcome: None,
},
}