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]] [[package]]
name = "rauth" name = "rauth"
version = "1.0.0" 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 = [ dependencies = [
"async-std", "async-std",
"async-trait", "async-trait",
@@ -2986,15 +2986,23 @@ dependencies = [
[[package]] [[package]]
name = "rocket_rauth" name = "rocket_rauth"
version = "1.0.0" 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 = [ dependencies = [
"async-std",
"base32",
"chrono",
"iso8601-timestamp",
"mongodb",
"okapi", "okapi",
"rauth", "rauth",
"regex",
"reqwest",
"rocket", "rocket",
"rocket_empty", "rocket_empty",
"rocket_okapi", "rocket_okapi",
"schemars", "schemars",
"serde", "serde",
"serde_json",
] ]
[[package]] [[package]]

View File

@@ -52,7 +52,7 @@ mobc-redis = { version = "0.7.0", default-features = false, features = ["async-s
# web # web
rocket = { version = "0.5.0-rc.2", default-features = false, features = ["json"] } rocket = { version = "0.5.0-rc.2", default-features = false, features = ["json"] }
rocket_empty = { git = "https://github.com/insertish/rocket_empty", branch = "master" } 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 # spec generation
schemars = "0.8.8" 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" } rocket_cors = { optional = true, git = "https://github.com/lawliet89/rocket_cors", rev = "5843861a88958c16bfaa0b40f0d8910772bcd2f6" }
# rAuth # 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
sentry = "0.25.0" 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, _required: bool,
) -> rocket_okapi::Result<RequestHeaderInput> { ) -> rocket_okapi::Result<RequestHeaderInput> {
let mut requirements = schemars::Map::new(); let mut requirements = schemars::Map::new();
requirements.insert("Api Key".to_owned(), vec![]); requirements.insert("Session Token".to_owned(), vec![]);
Ok(RequestHeaderInput::Security( Ok(RequestHeaderInput::Security(
"Api Key".to_owned(), "Session Token".to_owned(),
SecurityScheme { SecurityScheme {
data: SecuritySchemeData::ApiKey { data: SecuritySchemeData::ApiKey {
name: "x-session-token".to_owned(), name: "x-session-token".to_owned(),
location: "header".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(), extensions: schemars::Map::new(),
}, },
requirements, requirements,

View File

@@ -34,6 +34,12 @@ pub fn config() -> Config {
url: format!("{}/login/reset/", *APP_URL), url: format!("{}/login/reset/", *APP_URL),
html: None, 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, welcome: None,
}, },
} }