From 2e907826ae209925d21280354869fe0ef077eed0 Mon Sep 17 00:00:00 2001
From: Stuart Heap
Date: Thu, 26 Aug 2021 13:44:22 +0200
Subject: [PATCH 01/21] add required fields to schema/org form
---
.dockerignore | 3 +-
Cargo.lock | 851 ++++++++++++------
docker/amd64/Dockerfile | 3 +-
.../up.sql | 15 +-
.../2019-09-12-100000_create_tables/up.sql | 17 +-
.../up.sql | 15 +-
src/api/core/organizations.rs | 46 +
src/api/identity.rs | 59 +-
src/db/models/organization.rs | 42 +-
src/db/schemas/mysql/schema.rs | 9 +
src/db/schemas/postgresql/schema.rs | 9 +
src/db/schemas/sqlite/schema.rs | 9 +
12 files changed, 789 insertions(+), 289 deletions(-)
diff --git a/.dockerignore b/.dockerignore
index 69f51d2a24..6bc2dbdd5f 100644
--- a/.dockerignore
+++ b/.dockerignore
@@ -3,7 +3,6 @@ target
# Data folder
data
-.env
.env.template
.gitattributes
@@ -24,4 +23,4 @@ hooks
tools
# Web vault
-web-vault
\ No newline at end of file
+#web-vault
diff --git a/Cargo.lock b/Cargo.lock
index db93ff8b71..cafd7f7bfb 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -55,6 +55,47 @@ dependencies = [
"tokio",
]
+[[package]]
+name = "async-stream"
+version = "0.3.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "171374e7e3b2504e0e5236e3b59260560f9fe94bfe9ac39ba5e4e929c5590625"
+dependencies = [
+ "async-stream-impl",
+ "futures-core",
+]
+
+[[package]]
+name = "async-stream-impl"
+version = "0.3.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "648ed8c8d2ce5409ccd57453d9d1b214b342a0d69376a6feda1fd6cae3299308"
+dependencies = [
+ "proc-macro2",
+ "quote",
+ "syn",
+]
+
+[[package]]
+name = "async-trait"
+version = "0.1.51"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "44318e776df68115a881de9a8fd1b9e53368d7a4a5ce4cc48517da3393233a5e"
+dependencies = [
+ "proc-macro2",
+ "quote",
+ "syn",
+]
+
+[[package]]
+name = "atomic"
+version = "0.5.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "c3410529e8288c463bedb5930f82833bc0c90e5d2fe639a56582a4d09220b281"
+dependencies = [
+ "autocfg",
+]
+
[[package]]
name = "atty"
version = "0.2.14"
@@ -93,16 +134,6 @@ version = "0.2.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a4521f3e3d031370679b3b140beb36dfe4801b09ac77e30c61941f97df3ef28b"
-[[package]]
-name = "base64"
-version = "0.9.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "489d6c0ed21b11d038c31b6ceccca973e65d73ba3bd8ecb9a2babf5546164643"
-dependencies = [
- "byteorder",
- "safemem",
-]
-
[[package]]
name = "base64"
version = "0.11.0"
@@ -127,6 +158,21 @@ version = "0.1.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "383d29d513d8764dcdc42ea295d979eb99c3c9f00607b3692cf68a431f7dca72"
+[[package]]
+name = "biscuit"
+version = "0.5.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "0dee631cea28b00e115fd355a1adedc860b155096941dc01259969eabd434a37"
+dependencies = [
+ "chrono",
+ "data-encoding",
+ "num",
+ "once_cell",
+ "ring",
+ "serde",
+ "serde_json",
+]
+
[[package]]
name = "bitflags"
version = "1.2.1"
@@ -318,7 +364,7 @@ checksum = "03a5d7b21829bc7b4bf4754a978a241ae54ea55a40f92bb20216e54096f4b951"
dependencies = [
"percent-encoding 2.1.0",
"time 0.2.27",
- "version_check 0.9.3",
+ "version_check",
]
[[package]]
@@ -329,7 +375,7 @@ checksum = "d5f1c7727e460397e56abc4bddc1d49e07a1ad78fc98eb2e1c8f032a58a2f80d"
dependencies = [
"percent-encoding 2.1.0",
"time 0.2.27",
- "version_check 0.9.3",
+ "version_check",
]
[[package]]
@@ -340,7 +386,7 @@ checksum = "3818dfca4b0cb5211a659bbcbb94225b7127407b2b135e650d717bfb78ab10d3"
dependencies = [
"cookie 0.14.4",
"idna 0.2.3",
- "log 0.4.14",
+ "log",
"publicsuffix 1.5.6",
"serde",
"serde_json",
@@ -356,7 +402,7 @@ checksum = "55b4ac5559dd39f7bdc516f769cb412b151585d8886d216871a8435ed7f862cd"
dependencies = [
"cookie 0.15.1",
"idna 0.2.3",
- "log 0.4.14",
+ "log",
"publicsuffix 2.1.0",
"serde",
"serde_json",
@@ -445,8 +491,9 @@ dependencies = [
[[package]]
name = "devise"
-version = "0.3.0"
-source = "git+https://github.com/SergioBenitez/Devise.git?rev=e58b3ac9a#e58b3ac9afc3b6ff10a8aaf02a3e768a8f530089"
+version = "0.3.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "50c7580b072f1c8476148f16e0a0d5dedddab787da98d86c5082c5e9ed8ab595"
dependencies = [
"devise_codegen",
"devise_core",
@@ -454,22 +501,25 @@ dependencies = [
[[package]]
name = "devise_codegen"
-version = "0.3.0"
-source = "git+https://github.com/SergioBenitez/Devise.git?rev=e58b3ac9a#e58b3ac9afc3b6ff10a8aaf02a3e768a8f530089"
+version = "0.3.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "123c73e7a6e51b05c75fe1a1b2f4e241399ea5740ed810b0e3e6cacd9db5e7b2"
dependencies = [
"devise_core",
- "quote 1.0.9",
+ "quote",
]
[[package]]
name = "devise_core"
-version = "0.3.0"
-source = "git+https://github.com/SergioBenitez/Devise.git?rev=e58b3ac9a#e58b3ac9afc3b6ff10a8aaf02a3e768a8f530089"
+version = "0.3.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "841ef46f4787d9097405cac4e70fb8644fc037b526e8c14054247c0263c400d0"
dependencies = [
"bitflags",
- "proc-macro2 1.0.28",
- "quote 1.0.9",
- "syn 1.0.74",
+ "proc-macro2",
+ "proc-macro2-diagnostics",
+ "quote",
+ "syn",
]
[[package]]
@@ -495,9 +545,9 @@ version = "1.4.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "45f5098f628d02a7a0f68ddba586fb61e80edec3bdc1be3b921f4ceec60858d3"
dependencies = [
- "proc-macro2 1.0.28",
- "quote 1.0.9",
- "syn 1.0.74",
+ "proc-macro2",
+ "quote",
+ "syn",
]
[[package]]
@@ -604,10 +654,24 @@ version = "0.6.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8c9a4820f0ccc8a7afd67c39a0f1a0f4b07ca1725164271a64939d7aeb9af065"
dependencies = [
- "log 0.4.14",
+ "log",
"syslog",
]
+[[package]]
+name = "figment"
+version = "0.10.6"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "790b4292c72618abbab50f787a477014fe15634f96291de45672ce46afe122df"
+dependencies = [
+ "atomic",
+ "pear",
+ "serde",
+ "toml",
+ "uncased",
+ "version_check",
+]
+
[[package]]
name = "flate2"
version = "1.0.20"
@@ -745,9 +809,9 @@ checksum = "c54913bae956fb8df7f4dc6fc90362aa72e69148e3f39041fbe8742d21e0ac57"
dependencies = [
"autocfg",
"proc-macro-hack",
- "proc-macro2 1.0.28",
- "quote 1.0.9",
- "syn 1.0.74",
+ "proc-macro2",
+ "quote",
+ "syn",
]
[[package]]
@@ -783,6 +847,19 @@ dependencies = [
"slab",
]
+[[package]]
+name = "generator"
+version = "0.7.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "c1d9279ca822891c1a4dae06d185612cf8fc6acfe5dff37781b41297811b12ee"
+dependencies = [
+ "cc",
+ "libc",
+ "log",
+ "rustversion",
+ "winapi 0.3.9",
+]
+
[[package]]
name = "generic-array"
version = "0.7.3"
@@ -809,7 +886,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "501466ecc8a30d1d3b7fc9229b122b2ce8ed6e9d9223f1138d4babb253e51817"
dependencies = [
"typenum",
- "version_check 0.9.3",
+ "version_check",
]
[[package]]
@@ -877,7 +954,7 @@ version = "4.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "72a0ffab8c36d0436114310c7e10b59b3307e650ddfabf6d006028e29a70c6e6"
dependencies = [
- "log 0.4.14",
+ "log",
"pest",
"pest_derive",
"quick-error 2.0.1",
@@ -939,12 +1016,12 @@ version = "0.25.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "aafcf38a1a36118242d29b92e1b08ef84e67e4a5ed06e0a80be20e6a32bfed6b"
dependencies = [
- "log 0.4.14",
+ "log",
"mac",
"markup5ever",
- "proc-macro2 1.0.28",
- "quote 1.0.9",
- "syn 1.0.74",
+ "proc-macro2",
+ "quote",
+ "syn",
]
[[package]]
@@ -981,25 +1058,6 @@ version = "1.0.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6456b8a6c8f33fee7d958fcd1b60d55b11940a79e63ae87013e6d22e26034440"
-[[package]]
-name = "hyper"
-version = "0.10.16"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0a0652d9a2609a968c14be1a9ea00bf4b1d64e2e1f53a1b51b6fff3a6e829273"
-dependencies = [
- "base64 0.9.3",
- "httparse",
- "language-tags",
- "log 0.3.9",
- "mime 0.2.6",
- "num_cpus",
- "time 0.1.44",
- "traitobject",
- "typeable",
- "unicase 1.4.2",
- "url 1.7.2",
-]
-
[[package]]
name = "hyper"
version = "0.14.11"
@@ -1024,18 +1082,6 @@ dependencies = [
"want",
]
-[[package]]
-name = "hyper-sync-rustls"
-version = "0.3.0-rc.17"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4cb014c4ea00486e2b62860b5e15229d37516d4924177218beafbf46583de3ab"
-dependencies = [
- "hyper 0.10.16",
- "rustls",
- "webpki",
- "webpki-roots",
-]
-
[[package]]
name = "hyper-tls"
version = "0.5.0"
@@ -1043,7 +1089,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d6183ddfa99b85da61a140bea0efc93fdf56ceaa041b37d553518030827f9905"
dependencies = [
"bytes 1.0.1",
- "hyper 0.14.11",
+ "hyper",
"native-tls",
"tokio",
"tokio-native-tls",
@@ -1071,6 +1117,12 @@ dependencies = [
"unicode-normalization",
]
+[[package]]
+name = "if_chain"
+version = "1.0.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "cb56e1aa765b4b4f3aadfab769793b7087bb03a4ea4920644a6d238e2df5b9ed"
+
[[package]]
name = "indexmap"
version = "1.7.0"
@@ -1079,8 +1131,15 @@ checksum = "bc633605454125dec4b66843673f01c7df2b89479b32e0ed634e43a91cff62a5"
dependencies = [
"autocfg",
"hashbrown",
+ "serde",
]
+[[package]]
+name = "inlinable_string"
+version = "0.1.14"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "3094308123a0e9fd59659ce45e22de9f53fc1d2ac6e1feb9fef988e4f76cad77"
+
[[package]]
name = "instant"
version = "0.1.10"
@@ -1154,12 +1213,6 @@ dependencies = [
"winapi-build",
]
-[[package]]
-name = "language-tags"
-version = "0.2.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a91d884b6667cd606bb5a69aa0c99ba811a115fc68915e7056ec08a46e93199a"
-
[[package]]
name = "lazy_static"
version = "1.4.0"
@@ -1183,7 +1236,7 @@ dependencies = [
"hostname",
"httpdate",
"idna 0.2.3",
- "mime 0.3.16",
+ "mime",
"native-tls",
"nom 6.1.2",
"once_cell",
@@ -1221,20 +1274,24 @@ dependencies = [
[[package]]
name = "log"
-version = "0.3.9"
+version = "0.4.14"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e19e8d5c34a3e0e2223db8e060f9e8264aeeb5c5fc64a4ee9965c062211c024b"
+checksum = "51b9bbe6c47d51fc3e1a9b945965946b4c44142ab8792c50835a980d362c2710"
dependencies = [
- "log 0.4.14",
+ "cfg-if 1.0.0",
]
[[package]]
-name = "log"
-version = "0.4.14"
+name = "loom"
+version = "0.5.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "51b9bbe6c47d51fc3e1a9b945965946b4c44142ab8792c50835a980d362c2710"
+checksum = "2111607c723d7857e0d8299d5ce7a0bf4b844d3e44f8de136b13da513eaf8fc4"
dependencies = [
"cfg-if 1.0.0",
+ "generator",
+ "scoped-tls",
+ "serde",
+ "serde_json",
]
[[package]]
@@ -1255,7 +1312,7 @@ version = "0.10.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a24f40fb03852d1cdd84330cddcaf98e9ec08a7b7768e952fad3b4cf048ec8fd"
dependencies = [
- "log 0.4.14",
+ "log",
"phf",
"phf_codegen",
"string_cache",
@@ -1315,18 +1372,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9753f12909fd8d923f75ae5c3258cae1ed3c8ec052e1b38c93c21a6d157f789c"
dependencies = [
"migrations_internals",
- "proc-macro2 1.0.28",
- "quote 1.0.9",
- "syn 1.0.74",
-]
-
-[[package]]
-name = "mime"
-version = "0.2.6"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ba626b8a6de5da682e1caa06bdb42a335aee5a84db8e5046a3e8ab17ba0a3ae0"
-dependencies = [
- "log 0.3.9",
+ "proc-macro2",
+ "quote",
+ "syn",
]
[[package]]
@@ -1341,8 +1389,8 @@ version = "2.0.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2684d4c2e97d99848d30b324b00c8fcc7e5c897b7cbb5819b09e7c90e8baf212"
dependencies = [
- "mime 0.3.16",
- "unicase 2.6.0",
+ "mime",
+ "unicase",
]
[[package]]
@@ -1367,7 +1415,7 @@ dependencies = [
"iovec",
"kernel32-sys",
"libc",
- "log 0.4.14",
+ "log",
"miow 0.2.2",
"net2",
"slab",
@@ -1381,7 +1429,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8c2bdb6314ec10835cd3293dd268473a835c02b7b352e788be788b3c6ca6bb16"
dependencies = [
"libc",
- "log 0.4.14",
+ "log",
"miow 0.3.7",
"ntapi",
"winapi 0.3.9",
@@ -1394,7 +1442,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "52403fe290012ce777c4626790c8951324a2b9e3316b3143779c72b029742f19"
dependencies = [
"lazycell",
- "log 0.4.14",
+ "log",
"mio 0.6.23",
"slab",
]
@@ -1420,6 +1468,26 @@ dependencies = [
"winapi 0.3.9",
]
+[[package]]
+name = "multer"
+version = "2.0.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "408327e2999b839cd1af003fc01b2019a6c10a1361769542203f6fedc5179680"
+dependencies = [
+ "bytes 1.0.1",
+ "encoding_rs",
+ "futures-util",
+ "http",
+ "httparse",
+ "log",
+ "mime",
+ "spin 0.9.2",
+ "tokio",
+ "tokio-util",
+ "twoway 0.2.2",
+ "version_check",
+]
+
[[package]]
name = "multipart"
version = "0.18.0"
@@ -1428,14 +1496,14 @@ checksum = "00dec633863867f29cb39df64a397cdf4a6354708ddd7759f70c7fb51c5f9182"
dependencies = [
"buf_redux",
"httparse",
- "log 0.4.14",
- "mime 0.3.16",
+ "log",
+ "mime",
"mime_guess",
"quick-error 1.2.3",
"rand 0.8.4",
"safemem",
"tempfile",
- "twoway",
+ "twoway 0.1.8",
]
[[package]]
@@ -1456,7 +1524,7 @@ checksum = "b8d96b2e1c8da3957d58100b09f102c6d9cfdfced01b7ec5a8974044bb09dbd4"
dependencies = [
"lazy_static",
"libc",
- "log 0.4.14",
+ "log",
"openssl",
"openssl-probe",
"openssl-sys",
@@ -1507,7 +1575,7 @@ dependencies = [
"bitvec",
"funty",
"memchr",
- "version_check 0.9.3",
+ "version_check",
]
[[package]]
@@ -1519,6 +1587,20 @@ dependencies = [
"winapi 0.3.9",
]
+[[package]]
+name = "num"
+version = "0.3.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "8b7a8e9be5e039e2ff869df49155f1c06bd01ade2117ec783e56ab0932b67a8f"
+dependencies = [
+ "num-bigint 0.3.2",
+ "num-complex",
+ "num-integer",
+ "num-iter",
+ "num-rational",
+ "num-traits",
+]
+
[[package]]
name = "num-bigint"
version = "0.2.6"
@@ -1530,15 +1612,35 @@ dependencies = [
"num-traits",
]
+[[package]]
+name = "num-bigint"
+version = "0.3.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "7d0a3d5e207573f948a9e5376662aa743a2ea13f7c50a554d7af443a73fbfeba"
+dependencies = [
+ "autocfg",
+ "num-integer",
+ "num-traits",
+]
+
+[[package]]
+name = "num-complex"
+version = "0.3.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "747d632c0c558b87dbabbe6a82f3b4ae03720d0646ac5b7b4dae89394be5f2c5"
+dependencies = [
+ "num-traits",
+]
+
[[package]]
name = "num-derive"
version = "0.3.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "876a53fff98e03a936a674b29568b0e605f06b29372c2489ff4de23f1949743d"
dependencies = [
- "proc-macro2 1.0.28",
- "quote 1.0.9",
- "syn 1.0.74",
+ "proc-macro2",
+ "quote",
+ "syn",
]
[[package]]
@@ -1551,6 +1653,29 @@ dependencies = [
"num-traits",
]
+[[package]]
+name = "num-iter"
+version = "0.1.42"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "b2021c8337a54d21aca0d59a92577a029af9431cb59b909b03252b9c164fad59"
+dependencies = [
+ "autocfg",
+ "num-integer",
+ "num-traits",
+]
+
+[[package]]
+name = "num-rational"
+version = "0.3.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "12ac428b1cb17fce6f731001d307d351ec70a6d202fc2e60f7d4c5e42d8f4f07"
+dependencies = [
+ "autocfg",
+ "num-bigint 0.3.2",
+ "num-integer",
+ "num-traits",
+]
+
[[package]]
name = "num-traits"
version = "0.2.14"
@@ -1610,6 +1735,24 @@ version = "0.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5"
+[[package]]
+name = "openid"
+version = "0.9.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "ab30a9456b3484c408d9708b6f65b2bd834fdf22b73567775e1ca6de5524dd19"
+dependencies = [
+ "base64 0.13.0",
+ "biscuit",
+ "chrono",
+ "lazy_static",
+ "reqwest",
+ "serde",
+ "serde_json",
+ "thiserror",
+ "url 2.2.2",
+ "validator",
+]
+
[[package]]
name = "openssl"
version = "0.10.35"
@@ -1671,7 +1814,7 @@ dependencies = [
"byteorder",
"bytes 0.4.12",
"httparse",
- "log 0.4.14",
+ "log",
"mio 0.6.23",
"mio-extras",
"rand 0.7.3",
@@ -1744,24 +1887,25 @@ checksum = "acbf547ad0c65e31259204bd90935776d1c693cec2f4ff7abb7a1bbbd40dfe58"
[[package]]
name = "pear"
-version = "0.1.4"
+version = "0.2.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5320f212db967792b67cfe12bd469d08afd6318a249bd917d5c19bc92200ab8a"
+checksum = "15e44241c5e4c868e3eaa78b7c1848cadd6344ed4f54d029832d32b415a58702"
dependencies = [
+ "inlinable_string",
"pear_codegen",
+ "yansi",
]
[[package]]
name = "pear_codegen"
-version = "0.1.4"
+version = "0.2.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "bfc1c836fdc3d1ef87c348b237b5b5c4dff922156fb2d968f57734f9669768ca"
+checksum = "82a5ca643c2303ecb740d506539deba189e16f2754040a42901cd8105d0282d0"
dependencies = [
- "proc-macro2 0.4.30",
- "quote 0.6.13",
- "syn 0.15.44",
- "version_check 0.9.3",
- "yansi",
+ "proc-macro2",
+ "proc-macro2-diagnostics",
+ "quote",
+ "syn",
]
[[package]]
@@ -1814,9 +1958,9 @@ checksum = "99b8db626e31e5b81787b9783425769681b347011cc59471e33ea46d2ea0cf55"
dependencies = [
"pest",
"pest_meta",
- "proc-macro2 1.0.28",
- "quote 1.0.9",
- "syn 1.0.74",
+ "proc-macro2",
+ "quote",
+ "syn",
]
[[package]]
@@ -1913,6 +2057,30 @@ version = "0.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "925383efa346730478fb4838dbe9137d2a47675ad789c546d150a6e1dd4ab31c"
+[[package]]
+name = "proc-macro-error"
+version = "1.0.4"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c"
+dependencies = [
+ "proc-macro-error-attr",
+ "proc-macro2",
+ "quote",
+ "syn",
+ "version_check",
+]
+
+[[package]]
+name = "proc-macro-error-attr"
+version = "1.0.4"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869"
+dependencies = [
+ "proc-macro2",
+ "quote",
+ "version_check",
+]
+
[[package]]
name = "proc-macro-hack"
version = "0.5.19"
@@ -1927,20 +2095,24 @@ checksum = "bc881b2c22681370c6a780e47af9840ef841837bc98118431d4e1868bd0c1086"
[[package]]
name = "proc-macro2"
-version = "0.4.30"
+version = "1.0.28"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "cf3d2011ab5c909338f7887f4fc896d35932e29146c12c8d01da6b22a80ba759"
+checksum = "5c7ed8b8c7b886ea3ed7dde405212185f423ab44682667c8c6dd14aa1d9f6612"
dependencies = [
- "unicode-xid 0.1.0",
+ "unicode-xid",
]
[[package]]
-name = "proc-macro2"
-version = "1.0.28"
+name = "proc-macro2-diagnostics"
+version = "0.9.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5c7ed8b8c7b886ea3ed7dde405212185f423ab44682667c8c6dd14aa1d9f6612"
+checksum = "4bf29726d67464d49fa6224a1d07936a8c08bb3fba727c7493f6cf1616fdaada"
dependencies = [
- "unicode-xid 0.2.2",
+ "proc-macro2",
+ "quote",
+ "syn",
+ "version_check",
+ "yansi",
]
[[package]]
@@ -1983,22 +2155,13 @@ version = "2.0.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a993555f31e5a609f617c12db6250dedcac1b0a85076912c436e6fc9b2c8e6a3"
-[[package]]
-name = "quote"
-version = "0.6.13"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6ce23b6b870e8f94f81fb0a363d65d86675884b34a09043c81e5562f11c1f8e1"
-dependencies = [
- "proc-macro2 0.4.30",
-]
-
[[package]]
name = "quote"
version = "1.0.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c3d0b9745dc2debf507c8422de05d7226cc1f0644216dfdfead988f9b1ab32a7"
dependencies = [
- "proc-macro2 1.0.28",
+ "proc-macro2",
]
[[package]]
@@ -2013,7 +2176,7 @@ version = "0.8.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "545c5bc2b880973c9c10e4067418407a0ccaa3091781d1671d46eb35107cb26f"
dependencies = [
- "log 0.4.14",
+ "log",
"parking_lot 0.11.1",
"scheduled-thread-pool",
]
@@ -2161,6 +2324,26 @@ dependencies = [
"bitflags",
]
+[[package]]
+name = "ref-cast"
+version = "1.0.6"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "300f2a835d808734ee295d45007adacb9ebb29dd3ae2424acfa17930cae541da"
+dependencies = [
+ "ref-cast-impl",
+]
+
+[[package]]
+name = "ref-cast-impl"
+version = "1.0.6"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "4c38e3aecd2b21cb3959637b883bb3714bc7e43f0268b9a29d3743ee3e55cdd2"
+dependencies = [
+ "proc-macro2",
+ "quote",
+ "syn",
+]
+
[[package]]
name = "regex"
version = "1.5.4"
@@ -2203,13 +2386,13 @@ dependencies = [
"futures-util",
"http",
"http-body",
- "hyper 0.14.11",
+ "hyper",
"hyper-tls",
"ipnet",
"js-sys",
"lazy_static",
- "log 0.4.14",
- "mime 0.3.16",
+ "log",
+ "mime",
"native-tls",
"percent-encoding 2.1.0",
"pin-project-lite",
@@ -2237,7 +2420,7 @@ dependencies = [
"cc",
"libc",
"once_cell",
- "spin",
+ "spin 0.5.2",
"untrusted",
"web-sys",
"winapi 0.3.9",
@@ -2265,65 +2448,86 @@ dependencies = [
[[package]]
name = "rocket"
-version = "0.5.0-dev"
-source = "git+https://github.com/SergioBenitez/Rocket?rev=263e39b5b429de1913ce7e3036575a7b4d88b6d7#263e39b5b429de1913ce7e3036575a7b4d88b6d7"
+version = "0.5.0-rc.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "0a71c18c42a0eb15bf3816831caf0dad11e7966f2a41aaf486a701979c4dd1f2"
dependencies = [
+ "async-stream",
+ "async-trait",
+ "atomic",
"atty",
"binascii",
- "log 0.4.14",
+ "bytes 1.0.1",
+ "either",
+ "figment",
+ "futures",
+ "indexmap",
+ "log",
"memchr",
+ "multer",
"num_cpus",
- "pear",
+ "parking_lot 0.11.1",
+ "pin-project-lite",
+ "rand 0.8.4",
+ "ref-cast",
"rocket_codegen",
"rocket_http",
+ "serde",
+ "serde_json",
"state",
+ "tempfile",
"time 0.2.27",
- "toml",
- "version_check 0.9.3",
+ "tokio",
+ "tokio-stream",
+ "tokio-util",
+ "ubyte",
+ "version_check",
"yansi",
]
[[package]]
name = "rocket_codegen"
-version = "0.5.0-dev"
-source = "git+https://github.com/SergioBenitez/Rocket?rev=263e39b5b429de1913ce7e3036575a7b4d88b6d7#263e39b5b429de1913ce7e3036575a7b4d88b6d7"
+version = "0.5.0-rc.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "66f5fa462f7eb958bba8710c17c5d774bbbd59809fa76fb1957af7e545aea8bb"
dependencies = [
"devise",
"glob",
"indexmap",
- "quote 1.0.9",
+ "proc-macro2",
+ "quote",
"rocket_http",
- "version_check 0.9.3",
- "yansi",
-]
-
-[[package]]
-name = "rocket_contrib"
-version = "0.5.0-dev"
-source = "git+https://github.com/SergioBenitez/Rocket?rev=263e39b5b429de1913ce7e3036575a7b4d88b6d7#263e39b5b429de1913ce7e3036575a7b4d88b6d7"
-dependencies = [
- "log 0.4.14",
- "rocket",
- "serde",
- "serde_json",
+ "syn",
+ "unicode-xid",
]
[[package]]
name = "rocket_http"
-version = "0.5.0-dev"
-source = "git+https://github.com/SergioBenitez/Rocket?rev=263e39b5b429de1913ce7e3036575a7b4d88b6d7#263e39b5b429de1913ce7e3036575a7b4d88b6d7"
+version = "0.5.0-rc.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "23c8b7d512d2fcac2316ebe590cde67573844b99e6cc9ee0f53375fa16e25ebd"
dependencies = [
- "cookie 0.14.4",
- "hyper 0.10.16",
- "hyper-sync-rustls",
+ "cookie 0.15.1",
+ "either",
+ "http",
+ "hyper",
"indexmap",
+ "log",
+ "memchr",
+ "mime",
+ "parking_lot 0.11.1",
"pear",
- "percent-encoding 1.0.1",
- "rustls",
+ "percent-encoding 2.1.0",
+ "pin-project-lite",
+ "ref-cast",
+ "serde",
"smallvec 1.6.1",
+ "stable-pattern",
"state",
"time 0.2.27",
- "unicode-xid 0.2.2",
+ "tokio",
+ "tokio-rustls",
+ "uncased",
]
[[package]]
@@ -2349,17 +2553,23 @@ dependencies = [
[[package]]
name = "rustls"
-version = "0.17.0"
+version = "0.19.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c0d4a31f5d68413404705d6982529b0e11a9aacd4839d1d6222ee3b8cb4015e1"
+checksum = "35edb675feee39aec9c99fa5ff985081995a06d594114ae14cbe797ad7b7a6d7"
dependencies = [
- "base64 0.11.0",
- "log 0.4.14",
+ "base64 0.13.0",
+ "log",
"ring",
"sct",
"webpki",
]
+[[package]]
+name = "rustversion"
+version = "1.0.5"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "61b3909d758bb75c79f23d4736fac9433868679d3ad2ea7a61e3c25cfda9a088"
+
[[package]]
name = "ryu"
version = "1.0.5"
@@ -2400,6 +2610,12 @@ dependencies = [
"parking_lot 0.11.1",
]
+[[package]]
+name = "scoped-tls"
+version = "1.0.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "ea6a9290e3c9cf0f18145ef7ffa62d68ee0bf5fcd651017e586dc7fd5da448c2"
+
[[package]]
name = "scopeguard"
version = "1.1.0"
@@ -2488,9 +2704,9 @@ version = "1.0.126"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "963a7dbc9895aeac7ac90e74f34a5d5261828f79df35cbed41e10189d3804d43"
dependencies = [
- "proc-macro2 1.0.28",
- "quote 1.0.9",
- "syn 1.0.74",
+ "proc-macro2",
+ "quote",
+ "syn",
]
[[package]]
@@ -2499,6 +2715,7 @@ version = "1.0.64"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "799e97dc9fdae36a5c8b8f2cae9ce2ee9fdce2058c57a93e6099d919fd982f79"
dependencies = [
+ "indexmap",
"itoa",
"ryu",
"serde",
@@ -2573,6 +2790,15 @@ dependencies = [
"generic-array 0.7.3",
]
+[[package]]
+name = "signal-hook-registry"
+version = "1.4.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "e51e73328dc4ac0c7ccbda3a494dfa03df1de2f46018127f60c693f2648455b0"
+dependencies = [
+ "libc",
+]
+
[[package]]
name = "simple_asn1"
version = "0.4.1"
@@ -2580,7 +2806,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "692ca13de57ce0613a363c8c2f1de925adebc81b04c923ac60c5488bb44abe4b"
dependencies = [
"chrono",
- "num-bigint",
+ "num-bigint 0.2.6",
"num-traits",
]
@@ -2627,6 +2853,21 @@ version = "0.5.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d"
+[[package]]
+name = "spin"
+version = "0.9.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "511254be0c5bcf062b019a6c89c01a664aa359ded62f78aa72c6fc137c0590e5"
+
+[[package]]
+name = "stable-pattern"
+version = "0.1.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "4564168c00635f88eaed410d5efa8131afa8d8699a612c80c455a0ba05c21045"
+dependencies = [
+ "memchr",
+]
+
[[package]]
name = "stable_deref_trait"
version = "1.2.0"
@@ -2639,14 +2880,17 @@ version = "0.2.17"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e113fb6f3de07a243d434a56ec6f186dfd51cb08448239fe7bcae73f87ff28ff"
dependencies = [
- "version_check 0.9.3",
+ "version_check",
]
[[package]]
name = "state"
-version = "0.4.2"
+version = "0.5.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3015a7d0a5fd5105c91c3710d42f9ccf0abfb287d62206484dcc67f9569a6483"
+checksum = "87cf4f5369e6d3044b5e365c9690f451516ac8f0954084622b49ea3fde2f6de5"
+dependencies = [
+ "loom",
+]
[[package]]
name = "stdweb"
@@ -2668,11 +2912,11 @@ version = "0.5.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c87a60a40fccc84bef0652345bbbbbe20a605bf5d0ce81719fc476f5c03b50ef"
dependencies = [
- "proc-macro2 1.0.28",
- "quote 1.0.9",
+ "proc-macro2",
+ "quote",
"serde",
"serde_derive",
- "syn 1.0.74",
+ "syn",
]
[[package]]
@@ -2682,13 +2926,13 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "58fa5ff6ad0d98d1ffa8cb115892b6e69d67799f6763e162a1c9db421dc22e11"
dependencies = [
"base-x",
- "proc-macro2 1.0.28",
- "quote 1.0.9",
+ "proc-macro2",
+ "quote",
"serde",
"serde_derive",
"serde_json",
"sha1",
- "syn 1.0.74",
+ "syn",
]
[[package]]
@@ -2718,8 +2962,8 @@ checksum = "f24c8e5e19d22a726626f1a5e16fe15b132dcf21d10177fa5a45ce7962996b97"
dependencies = [
"phf_generator",
"phf_shared",
- "proc-macro2 1.0.28",
- "quote 1.0.9",
+ "proc-macro2",
+ "quote",
]
[[package]]
@@ -2728,26 +2972,15 @@ version = "2.4.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6bdef32e8150c2a081110b42772ffe7d7c9032b606bc226c8260fd97e0976601"
-[[package]]
-name = "syn"
-version = "0.15.44"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9ca4b3b69a77cbe1ffc9e198781b7acb0c7365a883670e8f1c1bc66fba79a5c5"
-dependencies = [
- "proc-macro2 0.4.30",
- "quote 0.6.13",
- "unicode-xid 0.1.0",
-]
-
[[package]]
name = "syn"
version = "1.0.74"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1873d832550d4588c3dbc20f01361ab00bfe741048f71e3fecf145a7cc18b29c"
dependencies = [
- "proc-macro2 1.0.28",
- "quote 1.0.9",
- "unicode-xid 0.2.2",
+ "proc-macro2",
+ "quote",
+ "unicode-xid",
]
[[package]]
@@ -2758,7 +2991,7 @@ checksum = "a0641142b4081d3d44beffa4eefd7346a228cdf91ed70186db2ca2cef762d327"
dependencies = [
"error-chain",
"libc",
- "log 0.4.14",
+ "log",
"time 0.1.44",
]
@@ -2808,9 +3041,9 @@ version = "1.0.26"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "060d69a0afe7796bf42e9e2ff91f5ee691fb15c53d38b4b62a9a53eb23164745"
dependencies = [
- "proc-macro2 1.0.28",
- "quote 1.0.9",
- "syn 1.0.74",
+ "proc-macro2",
+ "quote",
+ "syn",
]
[[package]]
@@ -2844,7 +3077,7 @@ dependencies = [
"standback",
"stdweb",
"time-macros",
- "version_check 0.9.3",
+ "version_check",
"winapi 0.3.9",
]
@@ -2865,10 +3098,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fd3c141a1b43194f3f56a1411225df8646c55781d5f26db825b3d98507eb482f"
dependencies = [
"proc-macro-hack",
- "proc-macro2 1.0.28",
- "quote 1.0.9",
+ "proc-macro2",
+ "quote",
"standback",
- "syn 1.0.74",
+ "syn",
]
[[package]]
@@ -2898,10 +3131,24 @@ dependencies = [
"memchr",
"mio 0.7.13",
"num_cpus",
+ "once_cell",
"pin-project-lite",
+ "signal-hook-registry",
+ "tokio-macros",
"winapi 0.3.9",
]
+[[package]]
+name = "tokio-macros"
+version = "1.3.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "54473be61f4ebe4efd09cec9bd5d16fa51d70ea0192213d754d2d500457db110"
+dependencies = [
+ "proc-macro2",
+ "quote",
+ "syn",
+]
+
[[package]]
name = "tokio-native-tls"
version = "0.3.0"
@@ -2912,6 +3159,17 @@ dependencies = [
"tokio",
]
+[[package]]
+name = "tokio-rustls"
+version = "0.22.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "bc6844de72e57df1980054b38be3a9f4702aba4858be64dd700181a8a6d0e1b6"
+dependencies = [
+ "rustls",
+ "tokio",
+ "webpki",
+]
+
[[package]]
name = "tokio-socks"
version = "0.5.1"
@@ -2924,6 +3182,17 @@ dependencies = [
"tokio",
]
+[[package]]
+name = "tokio-stream"
+version = "0.1.7"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "7b2f3f698253f03119ac0102beaa64f67a67e08074d03a22d18784104543727f"
+dependencies = [
+ "futures-core",
+ "pin-project-lite",
+ "tokio",
+]
+
[[package]]
name = "tokio-util"
version = "0.6.7"
@@ -2933,16 +3202,16 @@ dependencies = [
"bytes 1.0.1",
"futures-core",
"futures-sink",
- "log 0.4.14",
+ "log",
"pin-project-lite",
"tokio",
]
[[package]]
name = "toml"
-version = "0.4.10"
+version = "0.5.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "758664fc71a3a69038656bee8b6be6477d2a6c315a6b81f7081f591bffa4111f"
+checksum = "a31142970826733df8241ef35dc040ef98c679ab14d7c3e54d827099b3acecaa"
dependencies = [
"serde",
]
@@ -2960,7 +3229,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "09adeb8c97449311ccd28a427f96fb563e7fd31aabf994189879d9da2394b89d"
dependencies = [
"cfg-if 1.0.0",
- "log 0.4.14",
+ "log",
"pin-project-lite",
"tracing-attributes",
"tracing-core",
@@ -2972,9 +3241,9 @@ version = "0.1.15"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c42e6fa53307c8a17e4ccd4dc81cf5ec38db9209f59b222210375b54ee40d1e2"
dependencies = [
- "proc-macro2 1.0.28",
- "quote 1.0.9",
- "syn 1.0.74",
+ "proc-macro2",
+ "quote",
+ "syn",
]
[[package]]
@@ -2986,12 +3255,6 @@ dependencies = [
"lazy_static",
]
-[[package]]
-name = "traitobject"
-version = "0.1.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "efd1f82c56340fdf16f2a953d7bda4f8fdffba13d93b00844c25572110b26079"
-
[[package]]
name = "try-lock"
version = "0.2.3"
@@ -3008,10 +3271,14 @@ dependencies = [
]
[[package]]
-name = "typeable"
-version = "0.1.2"
+name = "twoway"
+version = "0.2.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1410f6f91f21d1612654e7cc69193b0334f909dcf2c790c4826254fbb86f8887"
+checksum = "c57ffb460d7c24cd6eda43694110189030a3d1dfe418416d9468fd1c1d290b47"
+dependencies = [
+ "memchr",
+ "unchecked-index",
+]
[[package]]
name = "typenum"
@@ -3036,6 +3303,15 @@ dependencies = [
"time 0.1.44",
]
+[[package]]
+name = "ubyte"
+version = "0.10.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "42756bb9e708855de2f8a98195643dff31a97f0485d90d8467b39dc24be9e8fe"
+dependencies = [
+ "serde",
+]
+
[[package]]
name = "ucd-trie"
version = "0.1.3"
@@ -3043,21 +3319,28 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "56dee185309b50d1f11bfedef0fe6d036842e3fb77413abef29f8f8d1c5d4c1c"
[[package]]
-name = "unicase"
-version = "1.4.2"
+name = "uncased"
+version = "0.9.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7f4765f83163b74f957c797ad9253caf97f103fb064d3999aea9568d09fc8a33"
+checksum = "5baeed7327e25054889b9bd4f975f32e5f4c5d434042d59ab6cd4142c0a76ed0"
dependencies = [
- "version_check 0.1.5",
+ "serde",
+ "version_check",
]
+[[package]]
+name = "unchecked-index"
+version = "0.2.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "eeba86d422ce181a719445e51872fa30f1f7413b62becb52e95ec91aa262d85c"
+
[[package]]
name = "unicase"
version = "2.6.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "50f37be617794602aabbeee0be4f259dc1778fabe05e2d67ee8f79326d5cb4f6"
dependencies = [
- "version_check 0.9.3",
+ "version_check",
]
[[package]]
@@ -3078,12 +3361,6 @@ dependencies = [
"tinyvec",
]
-[[package]]
-name = "unicode-xid"
-version = "0.1.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "fc72304796d0818e357ead4e000d19c9c174ab23dc11093ac919054d20a6a7fc"
-
[[package]]
name = "unicode-xid"
version = "0.2.2"
@@ -3117,6 +3394,7 @@ dependencies = [
"idna 0.2.3",
"matches",
"percent-encoding 2.1.0",
+ "serde",
]
[[package]]
@@ -3134,6 +3412,45 @@ dependencies = [
"getrandom 0.2.3",
]
+[[package]]
+name = "validator"
+version = "0.12.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "841d6937c33ec6039d8071bcf72933146b5bbe378d645d8fa59bdadabfc2a249"
+dependencies = [
+ "idna 0.2.3",
+ "lazy_static",
+ "regex",
+ "serde",
+ "serde_derive",
+ "serde_json",
+ "url 2.2.2",
+ "validator_derive",
+ "validator_types",
+]
+
+[[package]]
+name = "validator_derive"
+version = "0.12.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "4286b4497f270f59276a89ae0ad109d5f8f18c69b613e3fb22b61201aadb0c4d"
+dependencies = [
+ "if_chain",
+ "lazy_static",
+ "proc-macro-error",
+ "proc-macro2",
+ "quote",
+ "regex",
+ "syn",
+ "validator_types",
+]
+
+[[package]]
+name = "validator_types"
+version = "0.12.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "ad9680608df133af2c1ddd5eaf1ddce91d60d61b6bc51494ef326458365a470a"
+
[[package]]
name = "vaultwarden"
version = "1.0.0"
@@ -3151,6 +3468,7 @@ dependencies = [
"diesel_migrations",
"dotenv",
"fern",
+ "futures",
"handlebars",
"html5ever",
"idna 0.2.3",
@@ -3158,13 +3476,14 @@ dependencies = [
"jsonwebtoken",
"lettre",
"libsqlite3-sys",
- "log 0.4.14",
+ "log",
"markup5ever_rcdom",
"multipart",
"num-derive",
"num-traits",
"oath",
"once_cell",
+ "openid",
"openssl",
"parity-ws",
"paste",
@@ -3176,7 +3495,6 @@ dependencies = [
"ring",
"rmpv",
"rocket",
- "rocket_contrib",
"serde",
"serde_json",
"syslog",
@@ -3195,12 +3513,6 @@ version = "0.2.15"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426"
-[[package]]
-name = "version_check"
-version = "0.1.5"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "914b1a6776c4c929a602fafd8bc742e06365d4bcbe48c30f9cca5824f70dc9dd"
-
[[package]]
name = "version_check"
version = "0.9.3"
@@ -3224,7 +3536,7 @@ version = "0.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1ce8a968cb1cd110d136ff8b819a556d6fb6d919363c61534f6860c7eb172ba0"
dependencies = [
- "log 0.4.14",
+ "log",
"try-lock",
]
@@ -3260,10 +3572,10 @@ checksum = "3b33f6a0694ccfea53d94db8b2ed1c3a8a4c86dd936b13b9f0a15ec4a451b900"
dependencies = [
"bumpalo",
"lazy_static",
- "log 0.4.14",
- "proc-macro2 1.0.28",
- "quote 1.0.9",
- "syn 1.0.74",
+ "log",
+ "proc-macro2",
+ "quote",
+ "syn",
"wasm-bindgen-shared",
]
@@ -3285,7 +3597,7 @@ version = "0.2.74"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "088169ca61430fe1e58b8096c24975251700e7b1f6fd91cc9d59b04fb9b18bd4"
dependencies = [
- "quote 1.0.9",
+ "quote",
"wasm-bindgen-macro-support",
]
@@ -3295,9 +3607,9 @@ version = "0.2.74"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "be2241542ff3d9f241f5e2cb6dd09b37efe786df8851c54957683a49f0987a97"
dependencies = [
- "proc-macro2 1.0.28",
- "quote 1.0.9",
- "syn 1.0.74",
+ "proc-macro2",
+ "quote",
+ "syn",
"wasm-bindgen-backend",
"wasm-bindgen-shared",
]
@@ -3325,7 +3637,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4bbb2b77105c3b25ef0187146d80824648da0645f650c4d2080e3815d6cbbb87"
dependencies = [
"base64 0.13.0",
- "log 0.4.14",
+ "log",
"nom 4.1.1",
"openssl",
"rand 0.8.4",
@@ -3347,15 +3659,6 @@ dependencies = [
"untrusted",
]
-[[package]]
-name = "webpki-roots"
-version = "0.19.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f8eff4b7516a57307f9349c64bf34caa34b940b66fed4b2fb3136cb7386e5739"
-dependencies = [
- "webpki",
-]
-
[[package]]
name = "winapi"
version = "0.2.8"
@@ -3430,7 +3733,7 @@ version = "0.16.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0b1b52e6e8614d4a58b8e70cf51ec0cc21b256ad8206708bcff8139b5bbd6a59"
dependencies = [
- "log 0.4.14",
+ "log",
"mac",
"markup5ever",
"time 0.1.44",
@@ -3458,3 +3761,13 @@ dependencies = [
"threadpool",
"url 1.7.2",
]
+
+# [[patch.unused]]
+# name = "rocket"
+# version = "0.5.0-dev"
+# source = "git+https://github.com/SergioBenitez/Rocket?rev=263e39b5b429de1913ce7e3036575a7b4d88b6d7#263e39b5b429de1913ce7e3036575a7b4d88b6d7"
+
+# [[patch.unused]]
+# name = "rocket_contrib"
+# version = "0.5.0-dev"
+# source = "git+https://github.com/SergioBenitez/Rocket?rev=263e39b5b429de1913ce7e3036575a7b4d88b6d7#263e39b5b429de1913ce7e3036575a7b4d88b6d7"
diff --git a/docker/amd64/Dockerfile b/docker/amd64/Dockerfile
index 70d9c8f742..8737ad5a40 100644
--- a/docker/amd64/Dockerfile
+++ b/docker/amd64/Dockerfile
@@ -22,7 +22,6 @@
# $ docker image inspect --format "{{.RepoTags}}" vaultwarden/web-vault@sha256:29a4fa7bf3790fff9d908b02ac5a154913491f4bf30c95b87b06d8cf1c5516b5
# [vaultwarden/web-vault:v2.21.1]
#
-FROM vaultwarden/web-vault@sha256:29a4fa7bf3790fff9d908b02ac5a154913491f4bf30c95b87b06d8cf1c5516b5 as vault
########################## BUILD IMAGE ##########################
FROM rust:1.53 as build
@@ -101,7 +100,7 @@ EXPOSE 3012
# and the binary from the "build" stage to the current stage
WORKDIR /
COPY Rocket.toml .
-COPY --from=vault /web-vault ./web-vault
+COPY ./web-vault/build ./web-vault
COPY --from=build /app/target/release/vaultwarden .
COPY docker/healthcheck.sh /healthcheck.sh
diff --git a/migrations/mysql/2018-02-17-205753_create_collections_and_orgs/up.sql b/migrations/mysql/2018-02-17-205753_create_collections_and_orgs/up.sql
index dd90f9dc15..5cf2ec101a 100644
--- a/migrations/mysql/2018-02-17-205753_create_collections_and_orgs/up.sql
+++ b/migrations/mysql/2018-02-17-205753_create_collections_and_orgs/up.sql
@@ -5,9 +5,18 @@ CREATE TABLE collections (
);
CREATE TABLE organizations (
- uuid VARCHAR(40) NOT NULL PRIMARY KEY,
- name TEXT NOT NULL,
- billing_email TEXT NOT NULL
+ uuid VARCHAR(40) NOT NULL PRIMARY KEY,
+ name TEXT NOT NULL,
+ billing_email TEXT NOT NULL,
+ identifier TEXT NOT NULL,
+ use_sso BOOLEAN NOT NULL,
+ callback_path TEXT NOT NULL,
+ signed_out_callback_path TEXT NOT NULL,
+ authority TEXT NOT NULL,
+ client_id TEXT NOT NULL,
+ client_secret TEXT NOT NULL,
+ metadata_address TEXT NOT NULL,
+ oidc_redirect_behavior TEXT NOT NULL
);
CREATE TABLE users_collections (
diff --git a/migrations/postgresql/2019-09-12-100000_create_tables/up.sql b/migrations/postgresql/2019-09-12-100000_create_tables/up.sql
index c747e9aa03..384669efff 100644
--- a/migrations/postgresql/2019-09-12-100000_create_tables/up.sql
+++ b/migrations/postgresql/2019-09-12-100000_create_tables/up.sql
@@ -33,9 +33,18 @@ CREATE TABLE devices (
);
CREATE TABLE organizations (
- uuid VARCHAR(40) NOT NULL PRIMARY KEY,
- name TEXT NOT NULL,
- billing_email TEXT NOT NULL
+ uuid VARCHAR(40) NOT NULL PRIMARY KEY,
+ name TEXT NOT NULL,
+ billing_email TEXT NOT NULL,
+ identifier TEXT NOT NULL,
+ use_sso BOOLEAN NOT NULL,
+ callback_path TEXT NOT NULL,
+ signed_out_callback_path TEXT NOT NULL,
+ authority TEXT NOT NULL,
+ client_id TEXT NOT NULL,
+ client_secret TEXT NOT NULL,
+ metadata_address TEXT NOT NULL,
+ oidc_redirect_behavior TEXT NOT NULL
);
CREATE TABLE ciphers (
@@ -118,4 +127,4 @@ CREATE TABLE twofactor (
CREATE TABLE invitations (
email VARCHAR(255) NOT NULL PRIMARY KEY
-);
\ No newline at end of file
+);
diff --git a/migrations/sqlite/2018-02-17-205753_create_collections_and_orgs/up.sql b/migrations/sqlite/2018-02-17-205753_create_collections_and_orgs/up.sql
index 29601a4a5e..92391417fe 100644
--- a/migrations/sqlite/2018-02-17-205753_create_collections_and_orgs/up.sql
+++ b/migrations/sqlite/2018-02-17-205753_create_collections_and_orgs/up.sql
@@ -5,9 +5,18 @@ CREATE TABLE collections (
);
CREATE TABLE organizations (
- uuid TEXT NOT NULL PRIMARY KEY,
- name TEXT NOT NULL,
- billing_email TEXT NOT NULL
+ uuid TEXT NOT NULL PRIMARY KEY,
+ name TEXT NOT NULL,
+ billing_email TEXT NOT NULL,
+ identifier TEXT NOT NULL,
+ use_sso BOOLEAN NOT NULL,
+ callback_path TEXT NOT NULL,
+ signed_out_callback_path TEXT NOT NULL,
+ authority TEXT NOT NULL,
+ client_id TEXT NOT NULL,
+ client_secret TEXT NOT NULL,
+ metadata_address TEXT NOT NULL,
+ oidc_redirect_behavior TEXT NOT NULL
);
diff --git a/src/api/core/organizations.rs b/src/api/core/organizations.rs
index c1d2326cc6..774f806771 100644
--- a/src/api/core/organizations.rs
+++ b/src/api/core/organizations.rs
@@ -24,6 +24,7 @@ pub fn routes() -> Vec {
put_collection_users,
put_organization,
post_organization,
+ put_organization_sso,
post_organization_collections,
delete_organization_collection_user,
post_organization_collection_delete_user,
@@ -72,6 +73,20 @@ struct OrgData {
struct OrganizationUpdateData {
BillingEmail: String,
Name: String,
+ Identifier: Option,
+}
+
+#[derive(Deserialize, Debug)]
+#[allow(non_snake_case)]
+struct OrganizationSsoUpdateData {
+ UseSso: bool,
+ CallbackPath: String,
+ SignedOutCallbackPath: String,
+ Authority: String,
+ ClientId: String,
+ ClientSecret: String,
+ MetadataAddress: String,
+ OidcRedirectBehavior: String,
}
#[derive(Deserialize, Debug)]
@@ -200,6 +215,37 @@ fn post_organization(
org.name = data.Name;
org.billing_email = data.BillingEmail;
+ org.identifier = match data.Identifier {
+ Some(identifier) => identifier,
+ None => String::from(""),
+ };
+
+ org.save(&conn)?;
+ Ok(Json(org.to_json()))
+}
+
+#[put("/organizations//sso", data = "")]
+fn put_organization_sso(
+ org_id: String,
+ _headers: OwnerHeaders,
+ data: JsonUpcase,
+ conn: DbConn,
+) -> JsonResult {
+ let data: OrganizationSsoUpdateData = data.into_inner().data;
+
+ let mut org = match Organization::find_by_uuid(&org_id, &conn) {
+ Some(organization) => organization,
+ None => err!("Can't find organization details"),
+ };
+
+ org.use_sso = data.UseSso;
+ org.callback_path = data.CallbackPath;
+ org.signed_out_callback_path = data.SignedOutCallbackPath;
+ org.authority = data.Authority;
+ org.client_id = data.ClientId;
+ org.client_secret = data.ClientSecret;
+ org.metadata_address = data.MetadataAddress;
+ org.oidc_redirect_behavior = data.OidcRedirectBehavior;
org.save(&conn)?;
Ok(Json(org.to_json()))
diff --git a/src/api/identity.rs b/src/api/identity.rs
index 1c1ab2338c..7a13cdfd88 100644
--- a/src/api/identity.rs
+++ b/src/api/identity.rs
@@ -1,6 +1,7 @@
use chrono::Local;
use num_traits::FromPrimitive;
use rocket::{
+ http::{RawStr, Status},
request::{Form, FormItems, FromForm},
Route,
};
@@ -19,7 +20,7 @@ use crate::{
};
pub fn routes() -> Vec {
- routes![login]
+ routes![login, prevalidate, authorize]
}
#[post("/connect/token", data = "")]
@@ -421,7 +422,6 @@ impl<'f> FromForm<'f> for ConnectData {
key => warn!("Detected unexpected parameter during login: {}", key),
}
}
-
Ok(form)
}
}
@@ -432,3 +432,58 @@ fn _check_is_some(value: &Option, msg: &str) -> EmptyResult {
}
Ok(())
}
+
+fn invalid_json(error_message: &str, exception: bool) -> JsonResult {
+ if exception {
+ err_code!(error_message, Status::BadRequest.code)
+ }
+ err_code!(error_message, Status::InternalServerError.code)
+}
+
+#[get("/account/prevalidate?")]
+#[allow(non_snake_case)]
+fn prevalidate(domainHint: &RawStr, conn: DbConn) -> JsonResult {
+ let empty_result = json!({});
+
+ // TODO as_str shouldn't be used here
+ let organization = Organization::find_by_identifier(domainHint.as_str(), &conn);
+ match organization {
+ Some(organization) => {
+ if !organization.use_sso {
+ return invalid_json("SSO Not allowed for organization", false);
+ }
+ },
+ None => {
+ return invalid_json("Organization not found by identifier", false);
+ },
+ }
+
+ if domainHint == "" {
+ return invalid_json("No Organization Identifier Provided", false);
+ }
+
+ Ok(Json(empty_result))
+}
+
+
+#[get("/connect/authorize?")]
+fn authorize(
+ domain_hint: &RawStr,
+ conn: DbConn,
+) {
+ let empty_result = json!({});
+ let organization = Organization::find_by_identifier(domain_hint.as_str(), &conn);
+ match organization {
+ Some(organization) => {
+ println!("found org. authority: {}", organization.authority);
+ let redirect = Some(organization.callback_path.to_string());
+ let issuer = reqwest::Url::parse(&organization.authority).unwrap();
+ println!("got issuer: {}", issuer);
+ // return Ok(Json(empty_result));
+ },
+ None => {
+ println!("error");
+ // return invalid_json("No Organization found", false);
+ }
+ }
+}
diff --git a/src/db/models/organization.rs b/src/db/models/organization.rs
index e5141bb843..538fdfbffb 100644
--- a/src/db/models/organization.rs
+++ b/src/db/models/organization.rs
@@ -12,8 +12,17 @@ db_object! {
pub uuid: String,
pub name: String,
pub billing_email: String,
+ pub identifier: String,
pub private_key: Option,
pub public_key: Option,
+ pub use_sso: bool,
+ pub callback_path: String,
+ pub signed_out_callback_path: String,
+ pub authority: String,
+ pub client_id: String,
+ pub client_secret: String,
+ pub metadata_address: String,
+ pub oidc_redirect_behavior: String,
}
#[derive(Identifiable, Queryable, Insertable, AsChangeset)]
@@ -131,13 +140,22 @@ impl Organization {
billing_email,
private_key,
public_key,
+ identifier: String::from(""),
+ use_sso: false,
+ callback_path: String::from("http://localhost/oidc-signin"),
+ signed_out_callback_path: String::from("http://localhost/sso/oidc-signin"),
+ authority: String::from(""),
+ client_id: String::from(""),
+ client_secret: String::from(""),
+ metadata_address: String::from(""),
+ oidc_redirect_behavior: String::from(""),
}
}
pub fn to_json(&self) -> Value {
json!({
"Id": self.uuid,
- "Identifier": null, // not supported by us
+ "Identifier": self.identifier,
"Name": self.name,
"Seats": 10, // The value doesn't matter, we don't check server-side
"MaxCollections": 10, // The value doesn't matter, we don't check server-side
@@ -148,7 +166,7 @@ impl Organization {
"UseGroups": false, // not supported by us
"UseTotp": true,
"UsePolicies": true,
- "UseSso": false, // We do not support SSO
+ "UseSso": self.use_sso,
"SelfHost": true,
"UseApi": false, // not supported by us
"HasPublicAndPrivateKeys": self.private_key.is_some() && self.public_key.is_some(),
@@ -166,6 +184,13 @@ impl Organization {
"PlanType": 5, // TeamsAnnually plan
"UsersGetPremium": true,
"Object": "organization",
+ "CallbackPath": self.callback_path,
+ "SignedOutCallbackPath": self.signed_out_callback_path,
+ "Authority": self.authority,
+ "ClientId": self.client_id,
+ "ClientSecret": self.client_secret,
+ "MetadataAddress": self.metadata_address,
+ "OidcRedirectBehavior": self.oidc_redirect_behavior,
})
}
}
@@ -254,6 +279,15 @@ impl Organization {
}}
}
+ pub fn find_by_identifier(identifier: &str, conn: &DbConn) -> Option {
+ db_run! { conn: {
+ organizations::table
+ .filter(organizations::identifier.eq(identifier))
+ .first::(conn)
+ .ok().from_db()
+ }}
+ }
+
pub fn get_all(conn: &DbConn) -> Vec {
db_run! { conn: {
organizations::table.load::(conn).expect("Error loading organizations").from_db()
@@ -283,8 +317,8 @@ impl UserOrganization {
"SelfHost": true,
"HasPublicAndPrivateKeys": org.private_key.is_some() && org.public_key.is_some(),
"ResetPasswordEnrolled": false, // not supported by us
- "SsoBound": false, // We do not support SSO
- "UseSso": false, // We do not support SSO
+ "SsoBound": true,
+ "UseSso": true,
// TODO: Add support for Business Portal
// Upstream is moving Policies and SSO management outside of the web-vault to /portal
// For now they still have that code also in the web-vault, but they will remove it at some point.
diff --git a/src/db/schemas/mysql/schema.rs b/src/db/schemas/mysql/schema.rs
index 149d2267eb..32bbc44122 100644
--- a/src/db/schemas/mysql/schema.rs
+++ b/src/db/schemas/mysql/schema.rs
@@ -100,8 +100,17 @@ table! {
uuid -> Text,
name -> Text,
billing_email -> Text,
+ identifier -> Text,
private_key -> Nullable,
public_key -> Nullable,
+ use_sso -> Bool,
+ callback_path -> Text,
+ signed_out_callback_path -> Text,
+ authority -> Text,
+ client_id -> Text,
+ client_secret -> Text,
+ metadata_address -> Text,
+ oidc_redirect_behavior -> Text,
}
}
diff --git a/src/db/schemas/postgresql/schema.rs b/src/db/schemas/postgresql/schema.rs
index 8feb2eb2b7..5da8c2eb6d 100644
--- a/src/db/schemas/postgresql/schema.rs
+++ b/src/db/schemas/postgresql/schema.rs
@@ -100,8 +100,17 @@ table! {
uuid -> Text,
name -> Text,
billing_email -> Text,
+ identifier -> Text,
private_key -> Nullable,
public_key -> Nullable,
+ use_sso -> Bool,
+ callback_path -> Text,
+ signed_out_callback_path -> Text,
+ authority -> Text,
+ client_id -> Text,
+ client_secret -> Text,
+ metadata_address -> Text,
+ oidc_redirect_behavior -> Text,
}
}
diff --git a/src/db/schemas/sqlite/schema.rs b/src/db/schemas/sqlite/schema.rs
index 8feb2eb2b7..5da8c2eb6d 100644
--- a/src/db/schemas/sqlite/schema.rs
+++ b/src/db/schemas/sqlite/schema.rs
@@ -100,8 +100,17 @@ table! {
uuid -> Text,
name -> Text,
billing_email -> Text,
+ identifier -> Text,
private_key -> Nullable,
public_key -> Nullable,
+ use_sso -> Bool,
+ callback_path -> Text,
+ signed_out_callback_path -> Text,
+ authority -> Text,
+ client_id -> Text,
+ client_secret -> Text,
+ metadata_address -> Text,
+ oidc_redirect_behavior -> Text,
}
}
From 4674464aed0fc70303debce7696ad5d5e941e671 Mon Sep 17 00:00:00 2001
From: Stuart Heap
Date: Tue, 31 Aug 2021 15:13:56 +0200
Subject: [PATCH 02/21] working sso login
---
Cargo.toml | 2 +
src/api/identity.rs | 159 +++++++++++++++++++++++++++++++---
src/db/models/organization.rs | 4 +-
3 files changed, 151 insertions(+), 14 deletions(-)
diff --git a/Cargo.toml b/Cargo.toml
index cf9e3fac27..80bf7d8d92 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -137,6 +137,8 @@ backtrace = "0.3.60"
# Macro ident concatenation
paste = "1.0.5"
+openidconnect = "2.0.1"
+urlencoding = "1.1.1"
[patch.crates-io]
# Use newest ring
diff --git a/src/api/identity.rs b/src/api/identity.rs
index 7a13cdfd88..ba34a0baee 100644
--- a/src/api/identity.rs
+++ b/src/api/identity.rs
@@ -3,10 +3,12 @@ use num_traits::FromPrimitive;
use rocket::{
http::{RawStr, Status},
request::{Form, FormItems, FromForm},
+ response::Redirect,
Route,
};
use rocket_contrib::json::Json;
use serde_json::Value;
+use std::iter::FromIterator;
use crate::{
api::{
@@ -44,6 +46,13 @@ fn login(data: Form, conn: DbConn, ip: ClientIp) -> JsonResult {
_password_login(data, conn, &ip)
}
+ "authorization_code" => {
+ _check_is_some(&data.code, "code cannot be blank")?;
+ _check_is_some(&data.org_identifier, "org_identifier cannot be blank")?;
+ _check_is_some(&data.device_identifier, "device identifier cannot be blank")?;
+
+ _authorization_login(data, conn)
+ }
t => err!("Invalid type", t),
}
}
@@ -78,6 +87,32 @@ fn _refresh_login(data: ConnectData, conn: DbConn) -> JsonResult {
})))
}
+fn _authorization_login(data: ConnectData, conn: DbConn) -> JsonResult {
+ let (access_token, refresh_token) = get_auth_code_access_token(data.code.unwrap(), data.org_identifier.unwrap(), &conn);
+ // let expiry = jsonwebtoken::decode_header(access_token.as_str()).unwrap();
+ let time_now = std::time::SystemTime::now().duration_since(std::time::SystemTime::UNIX_EPOCH).unwrap().as_secs();
+
+ let mut device = Device::find_by_uuid(&data.device_identifier.unwrap(), &conn).map_res("device not found")?;
+
+ // COMMON
+ let user = User::find_by_uuid(&device.user_uuid, &conn).unwrap();
+
+ Ok(Json(json!({
+ "access_token": access_token,
+ "expires_in": 1000000,
+ "token_type": "Bearer",
+ "refresh_token": device.refresh_token,
+ "Key": user.akey,
+ "PrivateKey": user.private_key,
+
+ "Kdf": user.client_kdf_type,
+ "KdfIterations": user.client_kdf_iter,
+ "ResetMasterPassword": false, // TODO: according to official server seems something like: user.password_hash.is_empty(), but would need testing
+ "scope": "api offline_access",
+ "unofficialServer": true,
+ })))
+}
+
fn _password_login(data: ConnectData, conn: DbConn, ip: &ClientIp) -> JsonResult {
// Validate scope
let scope = data.scope.as_ref().unwrap();
@@ -393,6 +428,10 @@ struct ConnectData {
two_factor_provider: Option,
two_factor_token: Option,
two_factor_remember: Option,
+
+ // Needed for authorization code
+ code: Option,
+ org_identifier: Option,
}
impl<'f> FromForm<'f> for ConnectData {
@@ -419,6 +458,8 @@ impl<'f> FromForm<'f> for ConnectData {
"twofactorprovider" => form.two_factor_provider = value.parse().ok(),
"twofactortoken" => form.two_factor_token = Some(value),
"twofactorremember" => form.two_factor_remember = value.parse().ok(),
+ "code" => form.code = Some(value),
+ "orgidentifier" => form.org_identifier = Some(value),
key => warn!("Detected unexpected parameter during login: {}", key),
}
}
@@ -465,25 +506,119 @@ fn prevalidate(domainHint: &RawStr, conn: DbConn) -> JsonResult {
Ok(Json(empty_result))
}
+use openidconnect::core::{
+ CoreProviderMetadata, CoreClient,
+ CoreResponseType,
+};
+use openidconnect::reqwest::http_client;
+use openidconnect::{
+ AuthenticationFlow, AuthorizationCode, ClientId, ClientSecret,
+ CsrfToken, IssuerUrl, Nonce, RedirectUrl,
+ Scope, OAuth2TokenResponse,
+};
+
+fn handle_error(fail: &T, msg: &'static str) {
+ let mut err_msg = format!("ERROR: {}", msg);
+ let mut cur_fail: Option<&dyn std::error::Error> = Some(fail);
+ while let Some(cause) = cur_fail {
+ err_msg += &format!("\n caused by: {}", cause);
+ cur_fail = cause.source();
+ }
+ panic!("{}", err_msg);
+}
+
+fn get_client_from_identifier (identifier: &str, conn: &DbConn) -> CoreClient {
+ let organization = Organization::find_by_identifier(identifier, conn);
-#[get("/connect/authorize?")]
-fn authorize(
- domain_hint: &RawStr,
- conn: DbConn,
-) {
- let empty_result = json!({});
- let organization = Organization::find_by_identifier(domain_hint.as_str(), &conn);
match organization {
Some(organization) => {
println!("found org. authority: {}", organization.authority);
- let redirect = Some(organization.callback_path.to_string());
+ let redirect = organization.callback_path.to_string();
let issuer = reqwest::Url::parse(&organization.authority).unwrap();
println!("got issuer: {}", issuer);
- // return Ok(Json(empty_result));
+ let client_id = ClientId::new(organization.client_id);
+ let client_secret = ClientSecret::new(organization.client_secret);
+ let issuer_url = IssuerUrl::new(organization.authority).expect("invalid issuer URL");
+ let provider_metadata = CoreProviderMetadata::discover(&issuer_url, http_client)
+ .unwrap_or_else(|err| {
+ handle_error(&err, "Failed to discover OpenID Provider");
+ unreachable!();
+ });
+ let client = CoreClient::from_provider_metadata(
+ provider_metadata,
+ client_id,
+ Some(client_secret),
+ )
+ .set_redirect_uri(RedirectUrl::new(redirect).expect("Invalid redirect URL"));
+ return client;
},
None => {
- println!("error");
- // return invalid_json("No Organization found", false);
- }
+ panic!("unable to find org");
+ },
}
}
+
+#[get("/connect/authorize?&")]
+fn authorize(
+ domain_hint: &RawStr,
+ state: &RawStr,
+ conn: DbConn,
+) -> Redirect {
+ let empty_result = json!({});
+ let client = get_client_from_identifier(domain_hint.as_str(), &conn);
+
+ let (mut authorize_url, csrf_state, _nonce) = client
+ .authorize_url(
+ AuthenticationFlow::::AuthorizationCode,
+ CsrfToken::new_random,
+ Nonce::new_random,
+ )
+ .add_scope(Scope::new("email".to_string()))
+ .add_scope(Scope::new("profile".to_string()))
+ .url();
+
+ // it seems impossible to set the state going in dynamically (requires static lifetime string)
+ // so I change it after the fact (will it work? Let's find out)
+ let old_pairs = authorize_url.query_pairs().clone();
+ let new_pairs = old_pairs.map(|pair| {
+ let (key, value) = pair;
+ if key == "state" {
+ return format!("{}={}", key, state);
+ }
+ return format!("{}={}", key, value);
+ });
+ let full_query = Vec::from_iter(new_pairs).join("&");
+ authorize_url.set_query(Some(full_query.as_str()));
+
+ // return Redirect::to(rocket::uri!(&authorize_url.to_string()));
+ return Redirect::to(authorize_url.to_string());
+ // return Ok(Json(empty_result));
+}
+
+fn get_auth_code_access_token (
+ code: String,
+ org_identifier: String,
+ conn: &DbConn,
+) -> (String, String) {
+ let oidc_code = AuthorizationCode::new(code);
+
+ println!("code: {}", oidc_code.secret());
+ println!("identifier: {}", org_identifier);
+
+ let client = get_client_from_identifier(&org_identifier, conn);
+
+ let token_response = client
+ .exchange_code(oidc_code)
+ .request(http_client)
+ .unwrap_or_else(|err| {
+ handle_error(&err, "Failed to contact token endpoint");
+ unreachable!();
+ });
+
+
+ let access_token = token_response.access_token().secret().to_string();
+ let refresh_token = token_response.refresh_token().unwrap().secret().to_string();
+ println!("access token: {}, refresh token: {}", access_token, refresh_token);
+
+ (access_token, refresh_token)
+}
diff --git a/src/db/models/organization.rs b/src/db/models/organization.rs
index 538fdfbffb..c9b4bfa893 100644
--- a/src/db/models/organization.rs
+++ b/src/db/models/organization.rs
@@ -142,8 +142,8 @@ impl Organization {
public_key,
identifier: String::from(""),
use_sso: false,
- callback_path: String::from("http://localhost/oidc-signin"),
- signed_out_callback_path: String::from("http://localhost/sso/oidc-signin"),
+ callback_path: String::from("http://localhost/#/sso/"),
+ signed_out_callback_path: String::from("http://localhost/#/sso/"),
authority: String::from(""),
client_id: String::from(""),
client_secret: String::from(""),
From 284d2155c0778981e74112c08663c669c6157a83 Mon Sep 17 00:00:00 2001
From: Stuart Heap
Date: Wed, 1 Sep 2021 15:42:06 +0200
Subject: [PATCH 03/21] policy enforcement - multiple devices
---
Cargo.lock | 967 +++++++++++++++---------------------
src/api/identity.rs | 81 ++-
src/db/models/org_policy.rs | 4 +-
3 files changed, 468 insertions(+), 584 deletions(-)
diff --git a/Cargo.lock b/Cargo.lock
index cafd7f7bfb..68da363292 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -55,47 +55,6 @@ dependencies = [
"tokio",
]
-[[package]]
-name = "async-stream"
-version = "0.3.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "171374e7e3b2504e0e5236e3b59260560f9fe94bfe9ac39ba5e4e929c5590625"
-dependencies = [
- "async-stream-impl",
- "futures-core",
-]
-
-[[package]]
-name = "async-stream-impl"
-version = "0.3.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "648ed8c8d2ce5409ccd57453d9d1b214b342a0d69376a6feda1fd6cae3299308"
-dependencies = [
- "proc-macro2",
- "quote",
- "syn",
-]
-
-[[package]]
-name = "async-trait"
-version = "0.1.51"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "44318e776df68115a881de9a8fd1b9e53368d7a4a5ce4cc48517da3393233a5e"
-dependencies = [
- "proc-macro2",
- "quote",
- "syn",
-]
-
-[[package]]
-name = "atomic"
-version = "0.5.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c3410529e8288c463bedb5930f82833bc0c90e5d2fe639a56582a4d09220b281"
-dependencies = [
- "autocfg",
-]
-
[[package]]
name = "atty"
version = "0.2.14"
@@ -134,6 +93,16 @@ version = "0.2.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a4521f3e3d031370679b3b140beb36dfe4801b09ac77e30c61941f97df3ef28b"
+[[package]]
+name = "base64"
+version = "0.9.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "489d6c0ed21b11d038c31b6ceccca973e65d73ba3bd8ecb9a2babf5546164643"
+dependencies = [
+ "byteorder",
+ "safemem",
+]
+
[[package]]
name = "base64"
version = "0.11.0"
@@ -158,21 +127,6 @@ version = "0.1.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "383d29d513d8764dcdc42ea295d979eb99c3c9f00607b3692cf68a431f7dca72"
-[[package]]
-name = "biscuit"
-version = "0.5.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0dee631cea28b00e115fd355a1adedc860b155096941dc01259969eabd434a37"
-dependencies = [
- "chrono",
- "data-encoding",
- "num",
- "once_cell",
- "ring",
- "serde",
- "serde_json",
-]
-
[[package]]
name = "bitflags"
version = "1.2.1"
@@ -364,7 +318,7 @@ checksum = "03a5d7b21829bc7b4bf4754a978a241ae54ea55a40f92bb20216e54096f4b951"
dependencies = [
"percent-encoding 2.1.0",
"time 0.2.27",
- "version_check",
+ "version_check 0.9.3",
]
[[package]]
@@ -375,7 +329,7 @@ checksum = "d5f1c7727e460397e56abc4bddc1d49e07a1ad78fc98eb2e1c8f032a58a2f80d"
dependencies = [
"percent-encoding 2.1.0",
"time 0.2.27",
- "version_check",
+ "version_check 0.9.3",
]
[[package]]
@@ -386,7 +340,7 @@ checksum = "3818dfca4b0cb5211a659bbcbb94225b7127407b2b135e650d717bfb78ab10d3"
dependencies = [
"cookie 0.14.4",
"idna 0.2.3",
- "log",
+ "log 0.4.14",
"publicsuffix 1.5.6",
"serde",
"serde_json",
@@ -402,7 +356,7 @@ checksum = "55b4ac5559dd39f7bdc516f769cb412b151585d8886d216871a8435ed7f862cd"
dependencies = [
"cookie 0.15.1",
"idna 0.2.3",
- "log",
+ "log 0.4.14",
"publicsuffix 2.1.0",
"serde",
"serde_json",
@@ -435,6 +389,15 @@ dependencies = [
"libc",
]
+[[package]]
+name = "cpufeatures"
+version = "0.2.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "95059428f66df56b63431fdb4e1947ed2190586af5c5a8a8b71122bdf5a7f469"
+dependencies = [
+ "libc",
+]
+
[[package]]
name = "crc32fast"
version = "1.2.1"
@@ -491,9 +454,8 @@ dependencies = [
[[package]]
name = "devise"
-version = "0.3.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "50c7580b072f1c8476148f16e0a0d5dedddab787da98d86c5082c5e9ed8ab595"
+version = "0.3.0"
+source = "git+https://github.com/SergioBenitez/Devise.git?rev=e58b3ac9a#e58b3ac9afc3b6ff10a8aaf02a3e768a8f530089"
dependencies = [
"devise_codegen",
"devise_core",
@@ -501,25 +463,22 @@ dependencies = [
[[package]]
name = "devise_codegen"
-version = "0.3.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "123c73e7a6e51b05c75fe1a1b2f4e241399ea5740ed810b0e3e6cacd9db5e7b2"
+version = "0.3.0"
+source = "git+https://github.com/SergioBenitez/Devise.git?rev=e58b3ac9a#e58b3ac9afc3b6ff10a8aaf02a3e768a8f530089"
dependencies = [
"devise_core",
- "quote",
+ "quote 1.0.9",
]
[[package]]
name = "devise_core"
-version = "0.3.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "841ef46f4787d9097405cac4e70fb8644fc037b526e8c14054247c0263c400d0"
+version = "0.3.0"
+source = "git+https://github.com/SergioBenitez/Devise.git?rev=e58b3ac9a#e58b3ac9afc3b6ff10a8aaf02a3e768a8f530089"
dependencies = [
"bitflags",
- "proc-macro2",
- "proc-macro2-diagnostics",
- "quote",
- "syn",
+ "proc-macro2 1.0.28",
+ "quote 1.0.9",
+ "syn 1.0.74",
]
[[package]]
@@ -545,9 +504,9 @@ version = "1.4.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "45f5098f628d02a7a0f68ddba586fb61e80edec3bdc1be3b921f4ceec60858d3"
dependencies = [
- "proc-macro2",
- "quote",
- "syn",
+ "proc-macro2 1.0.28",
+ "quote 1.0.9",
+ "syn 1.0.74",
]
[[package]]
@@ -654,24 +613,10 @@ version = "0.6.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8c9a4820f0ccc8a7afd67c39a0f1a0f4b07ca1725164271a64939d7aeb9af065"
dependencies = [
- "log",
+ "log 0.4.14",
"syslog",
]
-[[package]]
-name = "figment"
-version = "0.10.6"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "790b4292c72618abbab50f787a477014fe15634f96291de45672ce46afe122df"
-dependencies = [
- "atomic",
- "pear",
- "serde",
- "toml",
- "uncased",
- "version_check",
-]
-
[[package]]
name = "flate2"
version = "1.0.20"
@@ -809,9 +754,9 @@ checksum = "c54913bae956fb8df7f4dc6fc90362aa72e69148e3f39041fbe8742d21e0ac57"
dependencies = [
"autocfg",
"proc-macro-hack",
- "proc-macro2",
- "quote",
- "syn",
+ "proc-macro2 1.0.28",
+ "quote 1.0.9",
+ "syn 1.0.74",
]
[[package]]
@@ -847,19 +792,6 @@ dependencies = [
"slab",
]
-[[package]]
-name = "generator"
-version = "0.7.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c1d9279ca822891c1a4dae06d185612cf8fc6acfe5dff37781b41297811b12ee"
-dependencies = [
- "cc",
- "libc",
- "log",
- "rustversion",
- "winapi 0.3.9",
-]
-
[[package]]
name = "generic-array"
version = "0.7.3"
@@ -886,7 +818,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "501466ecc8a30d1d3b7fc9229b122b2ce8ed6e9d9223f1138d4babb253e51817"
dependencies = [
"typenum",
- "version_check",
+ "version_check 0.9.3",
]
[[package]]
@@ -907,8 +839,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7fcd999463524c52659517fe2cea98493cfe485d10565e7b0fb07dbba7ad2753"
dependencies = [
"cfg-if 1.0.0",
+ "js-sys",
"libc",
"wasi 0.10.0+wasi-snapshot-preview1",
+ "wasm-bindgen",
]
[[package]]
@@ -954,7 +888,7 @@ version = "4.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "72a0ffab8c36d0436114310c7e10b59b3307e650ddfabf6d006028e29a70c6e6"
dependencies = [
- "log",
+ "log 0.4.14",
"pest",
"pest_derive",
"quick-error 2.0.1",
@@ -1016,12 +950,12 @@ version = "0.25.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "aafcf38a1a36118242d29b92e1b08ef84e67e4a5ed06e0a80be20e6a32bfed6b"
dependencies = [
- "log",
+ "log 0.4.14",
"mac",
"markup5ever",
- "proc-macro2",
- "quote",
- "syn",
+ "proc-macro2 1.0.28",
+ "quote 1.0.9",
+ "syn 1.0.74",
]
[[package]]
@@ -1058,6 +992,25 @@ version = "1.0.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6456b8a6c8f33fee7d958fcd1b60d55b11940a79e63ae87013e6d22e26034440"
+[[package]]
+name = "hyper"
+version = "0.10.16"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "0a0652d9a2609a968c14be1a9ea00bf4b1d64e2e1f53a1b51b6fff3a6e829273"
+dependencies = [
+ "base64 0.9.3",
+ "httparse",
+ "language-tags",
+ "log 0.3.9",
+ "mime 0.2.6",
+ "num_cpus",
+ "time 0.1.44",
+ "traitobject",
+ "typeable",
+ "unicase 1.4.2",
+ "url 1.7.2",
+]
+
[[package]]
name = "hyper"
version = "0.14.11"
@@ -1082,6 +1035,33 @@ dependencies = [
"want",
]
+[[package]]
+name = "hyper-rustls"
+version = "0.22.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "5f9f7a97316d44c0af9b0301e65010573a853a9fc97046d7331d7f6bc0fd5a64"
+dependencies = [
+ "futures-util",
+ "hyper 0.14.11",
+ "log 0.4.14",
+ "rustls 0.19.1",
+ "tokio",
+ "tokio-rustls",
+ "webpki",
+]
+
+[[package]]
+name = "hyper-sync-rustls"
+version = "0.3.0-rc.17"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "4cb014c4ea00486e2b62860b5e15229d37516d4924177218beafbf46583de3ab"
+dependencies = [
+ "hyper 0.10.16",
+ "rustls 0.17.0",
+ "webpki",
+ "webpki-roots 0.19.0",
+]
+
[[package]]
name = "hyper-tls"
version = "0.5.0"
@@ -1089,7 +1069,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d6183ddfa99b85da61a140bea0efc93fdf56ceaa041b37d553518030827f9905"
dependencies = [
"bytes 1.0.1",
- "hyper",
+ "hyper 0.14.11",
"native-tls",
"tokio",
"tokio-native-tls",
@@ -1117,12 +1097,6 @@ dependencies = [
"unicode-normalization",
]
-[[package]]
-name = "if_chain"
-version = "1.0.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "cb56e1aa765b4b4f3aadfab769793b7087bb03a4ea4920644a6d238e2df5b9ed"
-
[[package]]
name = "indexmap"
version = "1.7.0"
@@ -1131,15 +1105,8 @@ checksum = "bc633605454125dec4b66843673f01c7df2b89479b32e0ed634e43a91cff62a5"
dependencies = [
"autocfg",
"hashbrown",
- "serde",
]
-[[package]]
-name = "inlinable_string"
-version = "0.1.14"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3094308123a0e9fd59659ce45e22de9f53fc1d2ac6e1feb9fef988e4f76cad77"
-
[[package]]
name = "instant"
version = "0.1.10"
@@ -1164,6 +1131,15 @@ version = "2.3.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "68f2d64f2edebec4ce84ad108148e67e1064789bee435edc5b60ad398714a3a9"
+[[package]]
+name = "itertools"
+version = "0.9.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "284f18f85651fe11e8a991b2adb42cb078325c996ed026d994719efcfca1d54b"
+dependencies = [
+ "either",
+]
+
[[package]]
name = "itoa"
version = "0.4.7"
@@ -1213,6 +1189,12 @@ dependencies = [
"winapi-build",
]
+[[package]]
+name = "language-tags"
+version = "0.2.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "a91d884b6667cd606bb5a69aa0c99ba811a115fc68915e7056ec08a46e93199a"
+
[[package]]
name = "lazy_static"
version = "1.4.0"
@@ -1236,7 +1218,7 @@ dependencies = [
"hostname",
"httpdate",
"idna 0.2.3",
- "mime",
+ "mime 0.3.16",
"native-tls",
"nom 6.1.2",
"once_cell",
@@ -1248,9 +1230,9 @@ dependencies = [
[[package]]
name = "libc"
-version = "0.2.98"
+version = "0.2.101"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "320cfe77175da3a483efed4bc0adc1968ca050b098ce4f2f1c13a56626128790"
+checksum = "3cb00336871be5ed2c8ed44b60ae9959dc5b9f08539422ed43f09e34ecaeba21"
[[package]]
name = "libsqlite3-sys"
@@ -1274,24 +1256,20 @@ dependencies = [
[[package]]
name = "log"
-version = "0.4.14"
+version = "0.3.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "51b9bbe6c47d51fc3e1a9b945965946b4c44142ab8792c50835a980d362c2710"
+checksum = "e19e8d5c34a3e0e2223db8e060f9e8264aeeb5c5fc64a4ee9965c062211c024b"
dependencies = [
- "cfg-if 1.0.0",
+ "log 0.4.14",
]
[[package]]
-name = "loom"
-version = "0.5.1"
+name = "log"
+version = "0.4.14"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2111607c723d7857e0d8299d5ce7a0bf4b844d3e44f8de136b13da513eaf8fc4"
+checksum = "51b9bbe6c47d51fc3e1a9b945965946b4c44142ab8792c50835a980d362c2710"
dependencies = [
"cfg-if 1.0.0",
- "generator",
- "scoped-tls",
- "serde",
- "serde_json",
]
[[package]]
@@ -1312,7 +1290,7 @@ version = "0.10.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a24f40fb03852d1cdd84330cddcaf98e9ec08a7b7768e952fad3b4cf048ec8fd"
dependencies = [
- "log",
+ "log 0.4.14",
"phf",
"phf_codegen",
"string_cache",
@@ -1372,9 +1350,18 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9753f12909fd8d923f75ae5c3258cae1ed3c8ec052e1b38c93c21a6d157f789c"
dependencies = [
"migrations_internals",
- "proc-macro2",
- "quote",
- "syn",
+ "proc-macro2 1.0.28",
+ "quote 1.0.9",
+ "syn 1.0.74",
+]
+
+[[package]]
+name = "mime"
+version = "0.2.6"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "ba626b8a6de5da682e1caa06bdb42a335aee5a84db8e5046a3e8ab17ba0a3ae0"
+dependencies = [
+ "log 0.3.9",
]
[[package]]
@@ -1389,8 +1376,8 @@ version = "2.0.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2684d4c2e97d99848d30b324b00c8fcc7e5c897b7cbb5819b09e7c90e8baf212"
dependencies = [
- "mime",
- "unicase",
+ "mime 0.3.16",
+ "unicase 2.6.0",
]
[[package]]
@@ -1415,7 +1402,7 @@ dependencies = [
"iovec",
"kernel32-sys",
"libc",
- "log",
+ "log 0.4.14",
"miow 0.2.2",
"net2",
"slab",
@@ -1429,7 +1416,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8c2bdb6314ec10835cd3293dd268473a835c02b7b352e788be788b3c6ca6bb16"
dependencies = [
"libc",
- "log",
+ "log 0.4.14",
"miow 0.3.7",
"ntapi",
"winapi 0.3.9",
@@ -1442,7 +1429,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "52403fe290012ce777c4626790c8951324a2b9e3316b3143779c72b029742f19"
dependencies = [
"lazycell",
- "log",
+ "log 0.4.14",
"mio 0.6.23",
"slab",
]
@@ -1468,26 +1455,6 @@ dependencies = [
"winapi 0.3.9",
]
-[[package]]
-name = "multer"
-version = "2.0.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "408327e2999b839cd1af003fc01b2019a6c10a1361769542203f6fedc5179680"
-dependencies = [
- "bytes 1.0.1",
- "encoding_rs",
- "futures-util",
- "http",
- "httparse",
- "log",
- "mime",
- "spin 0.9.2",
- "tokio",
- "tokio-util",
- "twoway 0.2.2",
- "version_check",
-]
-
[[package]]
name = "multipart"
version = "0.18.0"
@@ -1496,14 +1463,14 @@ checksum = "00dec633863867f29cb39df64a397cdf4a6354708ddd7759f70c7fb51c5f9182"
dependencies = [
"buf_redux",
"httparse",
- "log",
- "mime",
+ "log 0.4.14",
+ "mime 0.3.16",
"mime_guess",
"quick-error 1.2.3",
"rand 0.8.4",
"safemem",
"tempfile",
- "twoway 0.1.8",
+ "twoway",
]
[[package]]
@@ -1524,7 +1491,7 @@ checksum = "b8d96b2e1c8da3957d58100b09f102c6d9cfdfced01b7ec5a8974044bb09dbd4"
dependencies = [
"lazy_static",
"libc",
- "log",
+ "log 0.4.14",
"openssl",
"openssl-probe",
"openssl-sys",
@@ -1575,7 +1542,7 @@ dependencies = [
"bitvec",
"funty",
"memchr",
- "version_check",
+ "version_check 0.9.3",
]
[[package]]
@@ -1587,20 +1554,6 @@ dependencies = [
"winapi 0.3.9",
]
-[[package]]
-name = "num"
-version = "0.3.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8b7a8e9be5e039e2ff869df49155f1c06bd01ade2117ec783e56ab0932b67a8f"
-dependencies = [
- "num-bigint 0.3.2",
- "num-complex",
- "num-integer",
- "num-iter",
- "num-rational",
- "num-traits",
-]
-
[[package]]
name = "num-bigint"
version = "0.2.6"
@@ -1612,35 +1565,15 @@ dependencies = [
"num-traits",
]
-[[package]]
-name = "num-bigint"
-version = "0.3.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7d0a3d5e207573f948a9e5376662aa743a2ea13f7c50a554d7af443a73fbfeba"
-dependencies = [
- "autocfg",
- "num-integer",
- "num-traits",
-]
-
-[[package]]
-name = "num-complex"
-version = "0.3.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "747d632c0c558b87dbabbe6a82f3b4ae03720d0646ac5b7b4dae89394be5f2c5"
-dependencies = [
- "num-traits",
-]
-
[[package]]
name = "num-derive"
version = "0.3.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "876a53fff98e03a936a674b29568b0e605f06b29372c2489ff4de23f1949743d"
dependencies = [
- "proc-macro2",
- "quote",
- "syn",
+ "proc-macro2 1.0.28",
+ "quote 1.0.9",
+ "syn 1.0.74",
]
[[package]]
@@ -1653,29 +1586,6 @@ dependencies = [
"num-traits",
]
-[[package]]
-name = "num-iter"
-version = "0.1.42"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b2021c8337a54d21aca0d59a92577a029af9431cb59b909b03252b9c164fad59"
-dependencies = [
- "autocfg",
- "num-integer",
- "num-traits",
-]
-
-[[package]]
-name = "num-rational"
-version = "0.3.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "12ac428b1cb17fce6f731001d307d351ec70a6d202fc2e60f7d4c5e42d8f4f07"
-dependencies = [
- "autocfg",
- "num-bigint 0.3.2",
- "num-integer",
- "num-traits",
-]
-
[[package]]
name = "num-traits"
version = "0.2.14"
@@ -1705,7 +1615,27 @@ dependencies = [
"hmac 0.1.1",
"rustc-hex",
"sha-1 0.3.4",
- "sha2",
+ "sha2 0.5.3",
+]
+
+[[package]]
+name = "oauth2"
+version = "4.1.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "80e47cfc4c0a1a519d9a025ebfbac3a2439d1b5cdf397d72dcb79b11d9920dab"
+dependencies = [
+ "base64 0.13.0",
+ "chrono",
+ "getrandom 0.2.3",
+ "http",
+ "rand 0.8.4",
+ "reqwest",
+ "serde",
+ "serde_json",
+ "serde_path_to_error",
+ "sha2 0.9.6",
+ "thiserror",
+ "url 2.2.2",
]
[[package]]
@@ -1736,21 +1666,27 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5"
[[package]]
-name = "openid"
-version = "0.9.3"
+name = "openidconnect"
+version = "2.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ab30a9456b3484c408d9708b6f65b2bd834fdf22b73567775e1ca6de5524dd19"
+checksum = "a42ff51db0f23ae55dd6f234a15ed7bb468bc97938670693a3eaa42869110167"
dependencies = [
- "base64 0.13.0",
- "biscuit",
+ "base64 0.12.3",
"chrono",
- "lazy_static",
- "reqwest",
+ "http",
+ "itertools",
+ "log 0.4.14",
+ "oauth2",
+ "rand 0.7.3",
+ "ring",
"serde",
+ "serde-value",
+ "serde_derive",
"serde_json",
+ "serde_path_to_error",
"thiserror",
+ "untrusted",
"url 2.2.2",
- "validator",
]
[[package]]
@@ -1796,6 +1732,15 @@ dependencies = [
"vcpkg",
]
+[[package]]
+name = "ordered-float"
+version = "1.1.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "3305af35278dd29f46fcdd139e0b1fbfae2153f0e5928b39b035542dd31e37b7"
+dependencies = [
+ "num-traits",
+]
+
[[package]]
name = "owning_ref"
version = "0.3.3"
@@ -1814,7 +1759,7 @@ dependencies = [
"byteorder",
"bytes 0.4.12",
"httparse",
- "log",
+ "log 0.4.14",
"mio 0.6.23",
"mio-extras",
"rand 0.7.3",
@@ -1887,25 +1832,24 @@ checksum = "acbf547ad0c65e31259204bd90935776d1c693cec2f4ff7abb7a1bbbd40dfe58"
[[package]]
name = "pear"
-version = "0.2.3"
+version = "0.1.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "15e44241c5e4c868e3eaa78b7c1848cadd6344ed4f54d029832d32b415a58702"
+checksum = "5320f212db967792b67cfe12bd469d08afd6318a249bd917d5c19bc92200ab8a"
dependencies = [
- "inlinable_string",
"pear_codegen",
- "yansi",
]
[[package]]
name = "pear_codegen"
-version = "0.2.3"
+version = "0.1.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "82a5ca643c2303ecb740d506539deba189e16f2754040a42901cd8105d0282d0"
+checksum = "bfc1c836fdc3d1ef87c348b237b5b5c4dff922156fb2d968f57734f9669768ca"
dependencies = [
- "proc-macro2",
- "proc-macro2-diagnostics",
- "quote",
- "syn",
+ "proc-macro2 0.4.30",
+ "quote 0.6.13",
+ "syn 0.15.44",
+ "version_check 0.9.3",
+ "yansi",
]
[[package]]
@@ -1958,9 +1902,9 @@ checksum = "99b8db626e31e5b81787b9783425769681b347011cc59471e33ea46d2ea0cf55"
dependencies = [
"pest",
"pest_meta",
- "proc-macro2",
- "quote",
- "syn",
+ "proc-macro2 1.0.28",
+ "quote 1.0.9",
+ "syn 1.0.74",
]
[[package]]
@@ -2057,30 +2001,6 @@ version = "0.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "925383efa346730478fb4838dbe9137d2a47675ad789c546d150a6e1dd4ab31c"
-[[package]]
-name = "proc-macro-error"
-version = "1.0.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c"
-dependencies = [
- "proc-macro-error-attr",
- "proc-macro2",
- "quote",
- "syn",
- "version_check",
-]
-
-[[package]]
-name = "proc-macro-error-attr"
-version = "1.0.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869"
-dependencies = [
- "proc-macro2",
- "quote",
- "version_check",
-]
-
[[package]]
name = "proc-macro-hack"
version = "0.5.19"
@@ -2095,24 +2015,20 @@ checksum = "bc881b2c22681370c6a780e47af9840ef841837bc98118431d4e1868bd0c1086"
[[package]]
name = "proc-macro2"
-version = "1.0.28"
+version = "0.4.30"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5c7ed8b8c7b886ea3ed7dde405212185f423ab44682667c8c6dd14aa1d9f6612"
+checksum = "cf3d2011ab5c909338f7887f4fc896d35932e29146c12c8d01da6b22a80ba759"
dependencies = [
- "unicode-xid",
+ "unicode-xid 0.1.0",
]
[[package]]
-name = "proc-macro2-diagnostics"
-version = "0.9.1"
+name = "proc-macro2"
+version = "1.0.28"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4bf29726d67464d49fa6224a1d07936a8c08bb3fba727c7493f6cf1616fdaada"
+checksum = "5c7ed8b8c7b886ea3ed7dde405212185f423ab44682667c8c6dd14aa1d9f6612"
dependencies = [
- "proc-macro2",
- "quote",
- "syn",
- "version_check",
- "yansi",
+ "unicode-xid 0.2.2",
]
[[package]]
@@ -2155,13 +2071,22 @@ version = "2.0.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a993555f31e5a609f617c12db6250dedcac1b0a85076912c436e6fc9b2c8e6a3"
+[[package]]
+name = "quote"
+version = "0.6.13"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "6ce23b6b870e8f94f81fb0a363d65d86675884b34a09043c81e5562f11c1f8e1"
+dependencies = [
+ "proc-macro2 0.4.30",
+]
+
[[package]]
name = "quote"
version = "1.0.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c3d0b9745dc2debf507c8422de05d7226cc1f0644216dfdfead988f9b1ab32a7"
dependencies = [
- "proc-macro2",
+ "proc-macro2 1.0.28",
]
[[package]]
@@ -2176,7 +2101,7 @@ version = "0.8.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "545c5bc2b880973c9c10e4067418407a0ccaa3091781d1671d46eb35107cb26f"
dependencies = [
- "log",
+ "log 0.4.14",
"parking_lot 0.11.1",
"scheduled-thread-pool",
]
@@ -2324,26 +2249,6 @@ dependencies = [
"bitflags",
]
-[[package]]
-name = "ref-cast"
-version = "1.0.6"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "300f2a835d808734ee295d45007adacb9ebb29dd3ae2424acfa17930cae541da"
-dependencies = [
- "ref-cast-impl",
-]
-
-[[package]]
-name = "ref-cast-impl"
-version = "1.0.6"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4c38e3aecd2b21cb3959637b883bb3714bc7e43f0268b9a29d3743ee3e55cdd2"
-dependencies = [
- "proc-macro2",
- "quote",
- "syn",
-]
-
[[package]]
name = "regex"
version = "1.5.4"
@@ -2386,28 +2291,32 @@ dependencies = [
"futures-util",
"http",
"http-body",
- "hyper",
+ "hyper 0.14.11",
+ "hyper-rustls",
"hyper-tls",
"ipnet",
"js-sys",
"lazy_static",
- "log",
- "mime",
+ "log 0.4.14",
+ "mime 0.3.16",
"native-tls",
"percent-encoding 2.1.0",
"pin-project-lite",
+ "rustls 0.19.1",
"serde",
"serde_json",
"serde_urlencoded",
"time 0.2.27",
"tokio",
"tokio-native-tls",
+ "tokio-rustls",
"tokio-socks",
"tokio-util",
"url 2.2.2",
"wasm-bindgen",
"wasm-bindgen-futures",
"web-sys",
+ "webpki-roots 0.21.1",
"winreg",
]
@@ -2420,7 +2329,7 @@ dependencies = [
"cc",
"libc",
"once_cell",
- "spin 0.5.2",
+ "spin",
"untrusted",
"web-sys",
"winapi 0.3.9",
@@ -2448,86 +2357,65 @@ dependencies = [
[[package]]
name = "rocket"
-version = "0.5.0-rc.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0a71c18c42a0eb15bf3816831caf0dad11e7966f2a41aaf486a701979c4dd1f2"
+version = "0.5.0-dev"
+source = "git+https://github.com/SergioBenitez/Rocket?rev=263e39b5b429de1913ce7e3036575a7b4d88b6d7#263e39b5b429de1913ce7e3036575a7b4d88b6d7"
dependencies = [
- "async-stream",
- "async-trait",
- "atomic",
"atty",
"binascii",
- "bytes 1.0.1",
- "either",
- "figment",
- "futures",
- "indexmap",
- "log",
+ "log 0.4.14",
"memchr",
- "multer",
"num_cpus",
- "parking_lot 0.11.1",
- "pin-project-lite",
- "rand 0.8.4",
- "ref-cast",
+ "pear",
"rocket_codegen",
"rocket_http",
- "serde",
- "serde_json",
"state",
- "tempfile",
"time 0.2.27",
- "tokio",
- "tokio-stream",
- "tokio-util",
- "ubyte",
- "version_check",
+ "toml",
+ "version_check 0.9.3",
"yansi",
]
[[package]]
name = "rocket_codegen"
-version = "0.5.0-rc.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "66f5fa462f7eb958bba8710c17c5d774bbbd59809fa76fb1957af7e545aea8bb"
+version = "0.5.0-dev"
+source = "git+https://github.com/SergioBenitez/Rocket?rev=263e39b5b429de1913ce7e3036575a7b4d88b6d7#263e39b5b429de1913ce7e3036575a7b4d88b6d7"
dependencies = [
"devise",
"glob",
"indexmap",
- "proc-macro2",
- "quote",
+ "quote 1.0.9",
"rocket_http",
- "syn",
- "unicode-xid",
+ "version_check 0.9.3",
+ "yansi",
+]
+
+[[package]]
+name = "rocket_contrib"
+version = "0.5.0-dev"
+source = "git+https://github.com/SergioBenitez/Rocket?rev=263e39b5b429de1913ce7e3036575a7b4d88b6d7#263e39b5b429de1913ce7e3036575a7b4d88b6d7"
+dependencies = [
+ "log 0.4.14",
+ "rocket",
+ "serde",
+ "serde_json",
]
[[package]]
name = "rocket_http"
-version = "0.5.0-rc.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "23c8b7d512d2fcac2316ebe590cde67573844b99e6cc9ee0f53375fa16e25ebd"
+version = "0.5.0-dev"
+source = "git+https://github.com/SergioBenitez/Rocket?rev=263e39b5b429de1913ce7e3036575a7b4d88b6d7#263e39b5b429de1913ce7e3036575a7b4d88b6d7"
dependencies = [
- "cookie 0.15.1",
- "either",
- "http",
- "hyper",
+ "cookie 0.14.4",
+ "hyper 0.10.16",
+ "hyper-sync-rustls",
"indexmap",
- "log",
- "memchr",
- "mime",
- "parking_lot 0.11.1",
"pear",
- "percent-encoding 2.1.0",
- "pin-project-lite",
- "ref-cast",
- "serde",
+ "percent-encoding 1.0.1",
+ "rustls 0.17.0",
"smallvec 1.6.1",
- "stable-pattern",
"state",
"time 0.2.27",
- "tokio",
- "tokio-rustls",
- "uncased",
+ "unicode-xid 0.2.2",
]
[[package]]
@@ -2553,22 +2441,29 @@ dependencies = [
[[package]]
name = "rustls"
-version = "0.19.1"
+version = "0.17.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "35edb675feee39aec9c99fa5ff985081995a06d594114ae14cbe797ad7b7a6d7"
+checksum = "c0d4a31f5d68413404705d6982529b0e11a9aacd4839d1d6222ee3b8cb4015e1"
dependencies = [
- "base64 0.13.0",
- "log",
+ "base64 0.11.0",
+ "log 0.4.14",
"ring",
"sct",
"webpki",
]
[[package]]
-name = "rustversion"
-version = "1.0.5"
+name = "rustls"
+version = "0.19.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "61b3909d758bb75c79f23d4736fac9433868679d3ad2ea7a61e3c25cfda9a088"
+checksum = "35edb675feee39aec9c99fa5ff985081995a06d594114ae14cbe797ad7b7a6d7"
+dependencies = [
+ "base64 0.13.0",
+ "log 0.4.14",
+ "ring",
+ "sct",
+ "webpki",
+]
[[package]]
name = "ryu"
@@ -2610,12 +2505,6 @@ dependencies = [
"parking_lot 0.11.1",
]
-[[package]]
-name = "scoped-tls"
-version = "1.0.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ea6a9290e3c9cf0f18145ef7ffa62d68ee0bf5fcd651017e586dc7fd5da448c2"
-
[[package]]
name = "scopeguard"
version = "1.1.0"
@@ -2679,6 +2568,16 @@ dependencies = [
"serde_derive",
]
+[[package]]
+name = "serde-value"
+version = "0.6.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "5a65a7291a8a568adcae4c10a677ebcedbc6c9cec91c054dee2ce40b0e3290eb"
+dependencies = [
+ "ordered-float",
+ "serde",
+]
+
[[package]]
name = "serde_bytes"
version = "0.11.5"
@@ -2704,9 +2603,9 @@ version = "1.0.126"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "963a7dbc9895aeac7ac90e74f34a5d5261828f79df35cbed41e10189d3804d43"
dependencies = [
- "proc-macro2",
- "quote",
- "syn",
+ "proc-macro2 1.0.28",
+ "quote 1.0.9",
+ "syn 1.0.74",
]
[[package]]
@@ -2715,12 +2614,20 @@ version = "1.0.64"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "799e97dc9fdae36a5c8b8f2cae9ce2ee9fdce2058c57a93e6099d919fd982f79"
dependencies = [
- "indexmap",
"itoa",
"ryu",
"serde",
]
+[[package]]
+name = "serde_path_to_error"
+version = "0.1.4"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "42f6109f0506e20f7e0f910e51a0079acf41da8e0694e6442527c4ddf5a2b158"
+dependencies = [
+ "serde",
+]
+
[[package]]
name = "serde_urlencoded"
version = "0.7.0"
@@ -2766,7 +2673,7 @@ checksum = "1a0c8611594e2ab4ebbf06ec7cbbf0a99450b8570e96cbf5188b5d5f6ef18d81"
dependencies = [
"block-buffer 0.9.0",
"cfg-if 1.0.0",
- "cpufeatures",
+ "cpufeatures 0.1.5",
"digest 0.9.0",
"opaque-debug 0.3.0",
]
@@ -2791,12 +2698,16 @@ dependencies = [
]
[[package]]
-name = "signal-hook-registry"
-version = "1.4.0"
+name = "sha2"
+version = "0.9.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e51e73328dc4ac0c7ccbda3a494dfa03df1de2f46018127f60c693f2648455b0"
+checksum = "9204c41a1597a8c5af23c82d1c921cb01ec0a4c59e07a9c7306062829a3903f3"
dependencies = [
- "libc",
+ "block-buffer 0.9.0",
+ "cfg-if 1.0.0",
+ "cpufeatures 0.2.1",
+ "digest 0.9.0",
+ "opaque-debug 0.3.0",
]
[[package]]
@@ -2806,7 +2717,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "692ca13de57ce0613a363c8c2f1de925adebc81b04c923ac60c5488bb44abe4b"
dependencies = [
"chrono",
- "num-bigint 0.2.6",
+ "num-bigint",
"num-traits",
]
@@ -2853,21 +2764,6 @@ version = "0.5.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d"
-[[package]]
-name = "spin"
-version = "0.9.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "511254be0c5bcf062b019a6c89c01a664aa359ded62f78aa72c6fc137c0590e5"
-
-[[package]]
-name = "stable-pattern"
-version = "0.1.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4564168c00635f88eaed410d5efa8131afa8d8699a612c80c455a0ba05c21045"
-dependencies = [
- "memchr",
-]
-
[[package]]
name = "stable_deref_trait"
version = "1.2.0"
@@ -2880,17 +2776,14 @@ version = "0.2.17"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e113fb6f3de07a243d434a56ec6f186dfd51cb08448239fe7bcae73f87ff28ff"
dependencies = [
- "version_check",
+ "version_check 0.9.3",
]
[[package]]
name = "state"
-version = "0.5.2"
+version = "0.4.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "87cf4f5369e6d3044b5e365c9690f451516ac8f0954084622b49ea3fde2f6de5"
-dependencies = [
- "loom",
-]
+checksum = "3015a7d0a5fd5105c91c3710d42f9ccf0abfb287d62206484dcc67f9569a6483"
[[package]]
name = "stdweb"
@@ -2912,11 +2805,11 @@ version = "0.5.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c87a60a40fccc84bef0652345bbbbbe20a605bf5d0ce81719fc476f5c03b50ef"
dependencies = [
- "proc-macro2",
- "quote",
+ "proc-macro2 1.0.28",
+ "quote 1.0.9",
"serde",
"serde_derive",
- "syn",
+ "syn 1.0.74",
]
[[package]]
@@ -2926,13 +2819,13 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "58fa5ff6ad0d98d1ffa8cb115892b6e69d67799f6763e162a1c9db421dc22e11"
dependencies = [
"base-x",
- "proc-macro2",
- "quote",
+ "proc-macro2 1.0.28",
+ "quote 1.0.9",
"serde",
"serde_derive",
"serde_json",
"sha1",
- "syn",
+ "syn 1.0.74",
]
[[package]]
@@ -2962,8 +2855,8 @@ checksum = "f24c8e5e19d22a726626f1a5e16fe15b132dcf21d10177fa5a45ce7962996b97"
dependencies = [
"phf_generator",
"phf_shared",
- "proc-macro2",
- "quote",
+ "proc-macro2 1.0.28",
+ "quote 1.0.9",
]
[[package]]
@@ -2972,15 +2865,26 @@ version = "2.4.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6bdef32e8150c2a081110b42772ffe7d7c9032b606bc226c8260fd97e0976601"
+[[package]]
+name = "syn"
+version = "0.15.44"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "9ca4b3b69a77cbe1ffc9e198781b7acb0c7365a883670e8f1c1bc66fba79a5c5"
+dependencies = [
+ "proc-macro2 0.4.30",
+ "quote 0.6.13",
+ "unicode-xid 0.1.0",
+]
+
[[package]]
name = "syn"
version = "1.0.74"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1873d832550d4588c3dbc20f01361ab00bfe741048f71e3fecf145a7cc18b29c"
dependencies = [
- "proc-macro2",
- "quote",
- "unicode-xid",
+ "proc-macro2 1.0.28",
+ "quote 1.0.9",
+ "unicode-xid 0.2.2",
]
[[package]]
@@ -2991,7 +2895,7 @@ checksum = "a0641142b4081d3d44beffa4eefd7346a228cdf91ed70186db2ca2cef762d327"
dependencies = [
"error-chain",
"libc",
- "log",
+ "log 0.4.14",
"time 0.1.44",
]
@@ -3041,9 +2945,9 @@ version = "1.0.26"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "060d69a0afe7796bf42e9e2ff91f5ee691fb15c53d38b4b62a9a53eb23164745"
dependencies = [
- "proc-macro2",
- "quote",
- "syn",
+ "proc-macro2 1.0.28",
+ "quote 1.0.9",
+ "syn 1.0.74",
]
[[package]]
@@ -3077,7 +2981,7 @@ dependencies = [
"standback",
"stdweb",
"time-macros",
- "version_check",
+ "version_check 0.9.3",
"winapi 0.3.9",
]
@@ -3098,10 +3002,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fd3c141a1b43194f3f56a1411225df8646c55781d5f26db825b3d98507eb482f"
dependencies = [
"proc-macro-hack",
- "proc-macro2",
- "quote",
+ "proc-macro2 1.0.28",
+ "quote 1.0.9",
"standback",
- "syn",
+ "syn 1.0.74",
]
[[package]]
@@ -3131,24 +3035,10 @@ dependencies = [
"memchr",
"mio 0.7.13",
"num_cpus",
- "once_cell",
"pin-project-lite",
- "signal-hook-registry",
- "tokio-macros",
"winapi 0.3.9",
]
-[[package]]
-name = "tokio-macros"
-version = "1.3.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "54473be61f4ebe4efd09cec9bd5d16fa51d70ea0192213d754d2d500457db110"
-dependencies = [
- "proc-macro2",
- "quote",
- "syn",
-]
-
[[package]]
name = "tokio-native-tls"
version = "0.3.0"
@@ -3165,7 +3055,7 @@ version = "0.22.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bc6844de72e57df1980054b38be3a9f4702aba4858be64dd700181a8a6d0e1b6"
dependencies = [
- "rustls",
+ "rustls 0.19.1",
"tokio",
"webpki",
]
@@ -3182,17 +3072,6 @@ dependencies = [
"tokio",
]
-[[package]]
-name = "tokio-stream"
-version = "0.1.7"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7b2f3f698253f03119ac0102beaa64f67a67e08074d03a22d18784104543727f"
-dependencies = [
- "futures-core",
- "pin-project-lite",
- "tokio",
-]
-
[[package]]
name = "tokio-util"
version = "0.6.7"
@@ -3202,16 +3081,16 @@ dependencies = [
"bytes 1.0.1",
"futures-core",
"futures-sink",
- "log",
+ "log 0.4.14",
"pin-project-lite",
"tokio",
]
[[package]]
name = "toml"
-version = "0.5.8"
+version = "0.4.10"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a31142970826733df8241ef35dc040ef98c679ab14d7c3e54d827099b3acecaa"
+checksum = "758664fc71a3a69038656bee8b6be6477d2a6c315a6b81f7081f591bffa4111f"
dependencies = [
"serde",
]
@@ -3229,7 +3108,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "09adeb8c97449311ccd28a427f96fb563e7fd31aabf994189879d9da2394b89d"
dependencies = [
"cfg-if 1.0.0",
- "log",
+ "log 0.4.14",
"pin-project-lite",
"tracing-attributes",
"tracing-core",
@@ -3241,9 +3120,9 @@ version = "0.1.15"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c42e6fa53307c8a17e4ccd4dc81cf5ec38db9209f59b222210375b54ee40d1e2"
dependencies = [
- "proc-macro2",
- "quote",
- "syn",
+ "proc-macro2 1.0.28",
+ "quote 1.0.9",
+ "syn 1.0.74",
]
[[package]]
@@ -3255,6 +3134,12 @@ dependencies = [
"lazy_static",
]
+[[package]]
+name = "traitobject"
+version = "0.1.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "efd1f82c56340fdf16f2a953d7bda4f8fdffba13d93b00844c25572110b26079"
+
[[package]]
name = "try-lock"
version = "0.2.3"
@@ -3271,14 +3156,10 @@ dependencies = [
]
[[package]]
-name = "twoway"
-version = "0.2.2"
+name = "typeable"
+version = "0.1.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c57ffb460d7c24cd6eda43694110189030a3d1dfe418416d9468fd1c1d290b47"
-dependencies = [
- "memchr",
- "unchecked-index",
-]
+checksum = "1410f6f91f21d1612654e7cc69193b0334f909dcf2c790c4826254fbb86f8887"
[[package]]
name = "typenum"
@@ -3303,15 +3184,6 @@ dependencies = [
"time 0.1.44",
]
-[[package]]
-name = "ubyte"
-version = "0.10.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "42756bb9e708855de2f8a98195643dff31a97f0485d90d8467b39dc24be9e8fe"
-dependencies = [
- "serde",
-]
-
[[package]]
name = "ucd-trie"
version = "0.1.3"
@@ -3319,28 +3191,21 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "56dee185309b50d1f11bfedef0fe6d036842e3fb77413abef29f8f8d1c5d4c1c"
[[package]]
-name = "uncased"
-version = "0.9.6"
+name = "unicase"
+version = "1.4.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5baeed7327e25054889b9bd4f975f32e5f4c5d434042d59ab6cd4142c0a76ed0"
+checksum = "7f4765f83163b74f957c797ad9253caf97f103fb064d3999aea9568d09fc8a33"
dependencies = [
- "serde",
- "version_check",
+ "version_check 0.1.5",
]
-[[package]]
-name = "unchecked-index"
-version = "0.2.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "eeba86d422ce181a719445e51872fa30f1f7413b62becb52e95ec91aa262d85c"
-
[[package]]
name = "unicase"
version = "2.6.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "50f37be617794602aabbeee0be4f259dc1778fabe05e2d67ee8f79326d5cb4f6"
dependencies = [
- "version_check",
+ "version_check 0.9.3",
]
[[package]]
@@ -3361,6 +3226,12 @@ dependencies = [
"tinyvec",
]
+[[package]]
+name = "unicode-xid"
+version = "0.1.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "fc72304796d0818e357ead4e000d19c9c174ab23dc11093ac919054d20a6a7fc"
+
[[package]]
name = "unicode-xid"
version = "0.2.2"
@@ -3397,6 +3268,12 @@ dependencies = [
"serde",
]
+[[package]]
+name = "urlencoding"
+version = "1.3.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "5a1f0175e03a0973cf4afd476bef05c26e228520400eb1fd473ad417b1c00ffb"
+
[[package]]
name = "utf-8"
version = "0.7.6"
@@ -3412,45 +3289,6 @@ dependencies = [
"getrandom 0.2.3",
]
-[[package]]
-name = "validator"
-version = "0.12.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "841d6937c33ec6039d8071bcf72933146b5bbe378d645d8fa59bdadabfc2a249"
-dependencies = [
- "idna 0.2.3",
- "lazy_static",
- "regex",
- "serde",
- "serde_derive",
- "serde_json",
- "url 2.2.2",
- "validator_derive",
- "validator_types",
-]
-
-[[package]]
-name = "validator_derive"
-version = "0.12.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4286b4497f270f59276a89ae0ad109d5f8f18c69b613e3fb22b61201aadb0c4d"
-dependencies = [
- "if_chain",
- "lazy_static",
- "proc-macro-error",
- "proc-macro2",
- "quote",
- "regex",
- "syn",
- "validator_types",
-]
-
-[[package]]
-name = "validator_types"
-version = "0.12.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ad9680608df133af2c1ddd5eaf1ddce91d60d61b6bc51494ef326458365a470a"
-
[[package]]
name = "vaultwarden"
version = "1.0.0"
@@ -3468,7 +3306,6 @@ dependencies = [
"diesel_migrations",
"dotenv",
"fern",
- "futures",
"handlebars",
"html5ever",
"idna 0.2.3",
@@ -3476,14 +3313,14 @@ dependencies = [
"jsonwebtoken",
"lettre",
"libsqlite3-sys",
- "log",
+ "log 0.4.14",
"markup5ever_rcdom",
"multipart",
"num-derive",
"num-traits",
"oath",
"once_cell",
- "openid",
+ "openidconnect",
"openssl",
"parity-ws",
"paste",
@@ -3495,6 +3332,7 @@ dependencies = [
"ring",
"rmpv",
"rocket",
+ "rocket_contrib",
"serde",
"serde_json",
"syslog",
@@ -3502,6 +3340,7 @@ dependencies = [
"tracing",
"u2f",
"url 2.2.2",
+ "urlencoding",
"uuid",
"webauthn-rs",
"yubico",
@@ -3513,6 +3352,12 @@ version = "0.2.15"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426"
+[[package]]
+name = "version_check"
+version = "0.1.5"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "914b1a6776c4c929a602fafd8bc742e06365d4bcbe48c30f9cca5824f70dc9dd"
+
[[package]]
name = "version_check"
version = "0.9.3"
@@ -3536,7 +3381,7 @@ version = "0.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1ce8a968cb1cd110d136ff8b819a556d6fb6d919363c61534f6860c7eb172ba0"
dependencies = [
- "log",
+ "log 0.4.14",
"try-lock",
]
@@ -3572,10 +3417,10 @@ checksum = "3b33f6a0694ccfea53d94db8b2ed1c3a8a4c86dd936b13b9f0a15ec4a451b900"
dependencies = [
"bumpalo",
"lazy_static",
- "log",
- "proc-macro2",
- "quote",
- "syn",
+ "log 0.4.14",
+ "proc-macro2 1.0.28",
+ "quote 1.0.9",
+ "syn 1.0.74",
"wasm-bindgen-shared",
]
@@ -3597,7 +3442,7 @@ version = "0.2.74"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "088169ca61430fe1e58b8096c24975251700e7b1f6fd91cc9d59b04fb9b18bd4"
dependencies = [
- "quote",
+ "quote 1.0.9",
"wasm-bindgen-macro-support",
]
@@ -3607,9 +3452,9 @@ version = "0.2.74"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "be2241542ff3d9f241f5e2cb6dd09b37efe786df8851c54957683a49f0987a97"
dependencies = [
- "proc-macro2",
- "quote",
- "syn",
+ "proc-macro2 1.0.28",
+ "quote 1.0.9",
+ "syn 1.0.74",
"wasm-bindgen-backend",
"wasm-bindgen-shared",
]
@@ -3637,7 +3482,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4bbb2b77105c3b25ef0187146d80824648da0645f650c4d2080e3815d6cbbb87"
dependencies = [
"base64 0.13.0",
- "log",
+ "log 0.4.14",
"nom 4.1.1",
"openssl",
"rand 0.8.4",
@@ -3659,6 +3504,24 @@ dependencies = [
"untrusted",
]
+[[package]]
+name = "webpki-roots"
+version = "0.19.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "f8eff4b7516a57307f9349c64bf34caa34b940b66fed4b2fb3136cb7386e5739"
+dependencies = [
+ "webpki",
+]
+
+[[package]]
+name = "webpki-roots"
+version = "0.21.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "aabe153544e473b775453675851ecc86863d2a81d786d741f6b76778f2a48940"
+dependencies = [
+ "webpki",
+]
+
[[package]]
name = "winapi"
version = "0.2.8"
@@ -3733,7 +3596,7 @@ version = "0.16.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0b1b52e6e8614d4a58b8e70cf51ec0cc21b256ad8206708bcff8139b5bbd6a59"
dependencies = [
- "log",
+ "log 0.4.14",
"mac",
"markup5ever",
"time 0.1.44",
@@ -3761,13 +3624,3 @@ dependencies = [
"threadpool",
"url 1.7.2",
]
-
-# [[patch.unused]]
-# name = "rocket"
-# version = "0.5.0-dev"
-# source = "git+https://github.com/SergioBenitez/Rocket?rev=263e39b5b429de1913ce7e3036575a7b4d88b6d7#263e39b5b429de1913ce7e3036575a7b4d88b6d7"
-
-# [[patch.unused]]
-# name = "rocket_contrib"
-# version = "0.5.0-dev"
-# source = "git+https://github.com/SergioBenitez/Rocket?rev=263e39b5b429de1913ce7e3036575a7b4d88b6d7#263e39b5b429de1913ce7e3036575a7b4d88b6d7"
diff --git a/src/api/identity.rs b/src/api/identity.rs
index ba34a0baee..3d6f3fef65 100644
--- a/src/api/identity.rs
+++ b/src/api/identity.rs
@@ -51,7 +51,7 @@ fn login(data: Form, conn: DbConn, ip: ClientIp) -> JsonResult {
_check_is_some(&data.org_identifier, "org_identifier cannot be blank")?;
_check_is_some(&data.device_identifier, "device identifier cannot be blank")?;
- _authorization_login(data, conn)
+ _authorization_login(data, conn, &ip)
}
t => err!("Invalid type", t),
}
@@ -87,21 +87,46 @@ fn _refresh_login(data: ConnectData, conn: DbConn) -> JsonResult {
})))
}
-fn _authorization_login(data: ConnectData, conn: DbConn) -> JsonResult {
- let (access_token, refresh_token) = get_auth_code_access_token(data.code.unwrap(), data.org_identifier.unwrap(), &conn);
- // let expiry = jsonwebtoken::decode_header(access_token.as_str()).unwrap();
- let time_now = std::time::SystemTime::now().duration_since(std::time::SystemTime::UNIX_EPOCH).unwrap().as_secs();
+#[derive(Debug, Serialize, Deserialize)]
+struct TokenPayload {
+ exp: i64,
+ email: String,
+}
- let mut device = Device::find_by_uuid(&data.device_identifier.unwrap(), &conn).map_res("device not found")?;
+fn _authorization_login(data: ConnectData, conn: DbConn, ip: &ClientIp) -> JsonResult {
+ let org_identifier = data.org_identifier.as_ref().unwrap();
+ let code = data.code.as_ref().unwrap();
+ let (access_token, refresh_token) = get_auth_code_access_token(&code, &org_identifier, &conn);
+ let token = jsonwebtoken::dangerous_insecure_decode::(access_token.as_str()).unwrap().claims;
+ let expiry = token.exp;
+ let user_email = token.email;
+ let now = Local::now();
// COMMON
- let user = User::find_by_uuid(&device.user_uuid, &conn).unwrap();
+ let user = User::find_by_mail(&user_email, &conn).unwrap();
- Ok(Json(json!({
+ let (mut device, new_device) = get_device(&data, &conn, &user);
+
+ let twofactor_token = twofactor_auth(&user.uuid, &data, &mut device, ip, &conn)?;
+
+ if CONFIG.mail_enabled() && new_device {
+ if let Err(e) = mail::send_new_device_logged_in(&user.email, &ip.ip.to_string(), &now, &device.name) {
+ error!("Error sending new device email: {:#?}", e);
+
+ if CONFIG.require_device_email() {
+ err!("Could not send login notification email. Please contact your administrator.")
+ }
+ }
+ }
+
+ device.refresh_token = refresh_token.clone();
+ device.save(&conn)?;
+
+ let mut result = json!({
"access_token": access_token,
- "expires_in": 1000000,
+ "expires_in": expiry - now.naive_utc().timestamp(),
"token_type": "Bearer",
- "refresh_token": device.refresh_token,
+ "refresh_token": refresh_token,
"Key": user.akey,
"PrivateKey": user.private_key,
@@ -110,7 +135,13 @@ fn _authorization_login(data: ConnectData, conn: DbConn) -> JsonResult {
"ResetMasterPassword": false, // TODO: according to official server seems something like: user.password_hash.is_empty(), but would need testing
"scope": "api offline_access",
"unofficialServer": true,
- })))
+ });
+
+ if let Some(token) = twofactor_token {
+ result["TwoFactorToken"] = Value::String(token);
+ }
+
+ Ok(Json(result))
}
fn _password_login(data: ConnectData, conn: DbConn, ip: &ClientIp) -> JsonResult {
@@ -138,6 +169,15 @@ fn _password_login(data: ConnectData, conn: DbConn, ip: &ClientIp) -> JsonResult
err!("This user has been disabled", format!("IP: {}. Username: {}.", ip.ip, username))
}
+ // Check if org policy prevents password login
+ let user_orgs = UserOrganization::find_by_user_and_policy(&user.uuid, OrgPolicyType::RequireSso, &conn);
+ if user_orgs.len() == 1 && user_orgs[0].atype >= 2 {
+ // if requires SSO is active, user is in exactly one org by policy rules
+ // policy only applies to "non-owner/non-admin" members
+
+ err!("Organization policy requires SSO sign in");
+ }
+
let now = Local::now();
if user.verified_at.is_none() && CONFIG.mail_enabled() && CONFIG.signups_verify() {
@@ -532,10 +572,8 @@ fn get_client_from_identifier (identifier: &str, conn: &DbConn) -> CoreClient {
match organization {
Some(organization) => {
- println!("found org. authority: {}", organization.authority);
let redirect = organization.callback_path.to_string();
let issuer = reqwest::Url::parse(&organization.authority).unwrap();
- println!("got issuer: {}", issuer);
let client_id = ClientId::new(organization.client_id);
let client_secret = ClientSecret::new(organization.client_secret);
let issuer_url = IssuerUrl::new(organization.authority).expect("invalid issuer URL");
@@ -564,10 +602,9 @@ fn authorize(
state: &RawStr,
conn: DbConn,
) -> Redirect {
- let empty_result = json!({});
let client = get_client_from_identifier(domain_hint.as_str(), &conn);
- let (mut authorize_url, csrf_state, _nonce) = client
+ let (mut authorize_url, _csrf_state, _nonce) = client
.authorize_url(
AuthenticationFlow::::AuthorizationCode,
CsrfToken::new_random,
@@ -590,22 +627,17 @@ fn authorize(
let full_query = Vec::from_iter(new_pairs).join("&");
authorize_url.set_query(Some(full_query.as_str()));
- // return Redirect::to(rocket::uri!(&authorize_url.to_string()));
return Redirect::to(authorize_url.to_string());
- // return Ok(Json(empty_result));
}
fn get_auth_code_access_token (
- code: String,
- org_identifier: String,
+ code: &str,
+ org_identifier: &str,
conn: &DbConn,
) -> (String, String) {
- let oidc_code = AuthorizationCode::new(code);
-
- println!("code: {}", oidc_code.secret());
- println!("identifier: {}", org_identifier);
+ let oidc_code = AuthorizationCode::new(String::from(code));
- let client = get_client_from_identifier(&org_identifier, conn);
+ let client = get_client_from_identifier(org_identifier, conn);
let token_response = client
.exchange_code(oidc_code)
@@ -618,7 +650,6 @@ fn get_auth_code_access_token (
let access_token = token_response.access_token().secret().to_string();
let refresh_token = token_response.refresh_token().unwrap().secret().to_string();
- println!("access token: {}, refresh token: {}", access_token, refresh_token);
(access_token, refresh_token)
}
diff --git a/src/db/models/org_policy.rs b/src/db/models/org_policy.rs
index 34eaedb1fc..c669ada3ab 100644
--- a/src/db/models/org_policy.rs
+++ b/src/db/models/org_policy.rs
@@ -27,8 +27,8 @@ pub enum OrgPolicyType {
TwoFactorAuthentication = 0,
MasterPassword = 1,
PasswordGenerator = 2,
- // SingleOrg = 3, // Not currently supported.
- // RequireSso = 4, // Not currently supported.
+ SingleOrg = 3,
+ RequireSso = 4,
PersonalOwnership = 5,
DisableSend = 6,
SendOptions = 7,
From d0d476f8effc1067748de653e431131f265acf0f Mon Sep 17 00:00:00 2001
From: Stuart Heap
Date: Wed, 1 Sep 2021 16:28:01 +0200
Subject: [PATCH 04/21] cleanup
---
.../2018-02-17-205753_create_collections_and_orgs/up.sql | 4 +---
.../postgresql/2019-09-12-100000_create_tables/up.sql | 4 +---
.../2018-02-17-205753_create_collections_and_orgs/up.sql | 4 +---
src/api/core/organizations.rs | 4 ----
src/api/identity.rs | 1 -
src/db/models/organization.rs | 6 ------
src/db/schemas/mysql/schema.rs | 2 --
src/db/schemas/postgresql/schema.rs | 2 --
src/db/schemas/sqlite/schema.rs | 2 --
9 files changed, 3 insertions(+), 26 deletions(-)
diff --git a/migrations/mysql/2018-02-17-205753_create_collections_and_orgs/up.sql b/migrations/mysql/2018-02-17-205753_create_collections_and_orgs/up.sql
index 5cf2ec101a..e1c20b31d1 100644
--- a/migrations/mysql/2018-02-17-205753_create_collections_and_orgs/up.sql
+++ b/migrations/mysql/2018-02-17-205753_create_collections_and_orgs/up.sql
@@ -14,9 +14,7 @@ CREATE TABLE organizations (
signed_out_callback_path TEXT NOT NULL,
authority TEXT NOT NULL,
client_id TEXT NOT NULL,
- client_secret TEXT NOT NULL,
- metadata_address TEXT NOT NULL,
- oidc_redirect_behavior TEXT NOT NULL
+ client_secret TEXT NOT NULL
);
CREATE TABLE users_collections (
diff --git a/migrations/postgresql/2019-09-12-100000_create_tables/up.sql b/migrations/postgresql/2019-09-12-100000_create_tables/up.sql
index 384669efff..74f492f191 100644
--- a/migrations/postgresql/2019-09-12-100000_create_tables/up.sql
+++ b/migrations/postgresql/2019-09-12-100000_create_tables/up.sql
@@ -42,9 +42,7 @@ CREATE TABLE organizations (
signed_out_callback_path TEXT NOT NULL,
authority TEXT NOT NULL,
client_id TEXT NOT NULL,
- client_secret TEXT NOT NULL,
- metadata_address TEXT NOT NULL,
- oidc_redirect_behavior TEXT NOT NULL
+ client_secret TEXT NOT NULL
);
CREATE TABLE ciphers (
diff --git a/migrations/sqlite/2018-02-17-205753_create_collections_and_orgs/up.sql b/migrations/sqlite/2018-02-17-205753_create_collections_and_orgs/up.sql
index 92391417fe..7a8c835f42 100644
--- a/migrations/sqlite/2018-02-17-205753_create_collections_and_orgs/up.sql
+++ b/migrations/sqlite/2018-02-17-205753_create_collections_and_orgs/up.sql
@@ -14,9 +14,7 @@ CREATE TABLE organizations (
signed_out_callback_path TEXT NOT NULL,
authority TEXT NOT NULL,
client_id TEXT NOT NULL,
- client_secret TEXT NOT NULL,
- metadata_address TEXT NOT NULL,
- oidc_redirect_behavior TEXT NOT NULL
+ client_secret TEXT NOT NULL
);
diff --git a/src/api/core/organizations.rs b/src/api/core/organizations.rs
index 774f806771..bc09d38ce0 100644
--- a/src/api/core/organizations.rs
+++ b/src/api/core/organizations.rs
@@ -85,8 +85,6 @@ struct OrganizationSsoUpdateData {
Authority: String,
ClientId: String,
ClientSecret: String,
- MetadataAddress: String,
- OidcRedirectBehavior: String,
}
#[derive(Deserialize, Debug)]
@@ -244,8 +242,6 @@ fn put_organization_sso(
org.authority = data.Authority;
org.client_id = data.ClientId;
org.client_secret = data.ClientSecret;
- org.metadata_address = data.MetadataAddress;
- org.oidc_redirect_behavior = data.OidcRedirectBehavior;
org.save(&conn)?;
Ok(Json(org.to_json()))
diff --git a/src/api/identity.rs b/src/api/identity.rs
index 3d6f3fef65..8f0a2ea7e2 100644
--- a/src/api/identity.rs
+++ b/src/api/identity.rs
@@ -573,7 +573,6 @@ fn get_client_from_identifier (identifier: &str, conn: &DbConn) -> CoreClient {
match organization {
Some(organization) => {
let redirect = organization.callback_path.to_string();
- let issuer = reqwest::Url::parse(&organization.authority).unwrap();
let client_id = ClientId::new(organization.client_id);
let client_secret = ClientSecret::new(organization.client_secret);
let issuer_url = IssuerUrl::new(organization.authority).expect("invalid issuer URL");
diff --git a/src/db/models/organization.rs b/src/db/models/organization.rs
index c9b4bfa893..20a19c232a 100644
--- a/src/db/models/organization.rs
+++ b/src/db/models/organization.rs
@@ -21,8 +21,6 @@ db_object! {
pub authority: String,
pub client_id: String,
pub client_secret: String,
- pub metadata_address: String,
- pub oidc_redirect_behavior: String,
}
#[derive(Identifiable, Queryable, Insertable, AsChangeset)]
@@ -147,8 +145,6 @@ impl Organization {
authority: String::from(""),
client_id: String::from(""),
client_secret: String::from(""),
- metadata_address: String::from(""),
- oidc_redirect_behavior: String::from(""),
}
}
@@ -189,8 +185,6 @@ impl Organization {
"Authority": self.authority,
"ClientId": self.client_id,
"ClientSecret": self.client_secret,
- "MetadataAddress": self.metadata_address,
- "OidcRedirectBehavior": self.oidc_redirect_behavior,
})
}
}
diff --git a/src/db/schemas/mysql/schema.rs b/src/db/schemas/mysql/schema.rs
index 32bbc44122..f5caaa8443 100644
--- a/src/db/schemas/mysql/schema.rs
+++ b/src/db/schemas/mysql/schema.rs
@@ -109,8 +109,6 @@ table! {
authority -> Text,
client_id -> Text,
client_secret -> Text,
- metadata_address -> Text,
- oidc_redirect_behavior -> Text,
}
}
diff --git a/src/db/schemas/postgresql/schema.rs b/src/db/schemas/postgresql/schema.rs
index 5da8c2eb6d..560399b89e 100644
--- a/src/db/schemas/postgresql/schema.rs
+++ b/src/db/schemas/postgresql/schema.rs
@@ -109,8 +109,6 @@ table! {
authority -> Text,
client_id -> Text,
client_secret -> Text,
- metadata_address -> Text,
- oidc_redirect_behavior -> Text,
}
}
diff --git a/src/db/schemas/sqlite/schema.rs b/src/db/schemas/sqlite/schema.rs
index 5da8c2eb6d..560399b89e 100644
--- a/src/db/schemas/sqlite/schema.rs
+++ b/src/db/schemas/sqlite/schema.rs
@@ -109,8 +109,6 @@ table! {
authority -> Text,
client_id -> Text,
client_secret -> Text,
- metadata_address -> Text,
- oidc_redirect_behavior -> Text,
}
}
From d0d261a3468c97e7500b8b3aa956ea99ad18e9d2 Mon Sep 17 00:00:00 2001
From: Stuart Heap
Date: Wed, 1 Sep 2021 16:48:51 +0200
Subject: [PATCH 05/21] safe handling of RawStrs
---
src/api/identity.rs | 39 +++++++++++++++++++++++----------------
1 file changed, 23 insertions(+), 16 deletions(-)
diff --git a/src/api/identity.rs b/src/api/identity.rs
index 8f0a2ea7e2..f7bc54df7e 100644
--- a/src/api/identity.rs
+++ b/src/api/identity.rs
@@ -525,25 +525,30 @@ fn invalid_json(error_message: &str, exception: bool) -> JsonResult {
#[allow(non_snake_case)]
fn prevalidate(domainHint: &RawStr, conn: DbConn) -> JsonResult {
let empty_result = json!({});
+ match domainHint.percent_decode() {
+ Ok(domain_hint) => {
+ let organization = Organization::find_by_identifier(&domain_hint.to_owned(), &conn);
+ match organization {
+ Some(organization) => {
+ if !organization.use_sso {
+ return invalid_json("SSO Not allowed for organization", false);
+ }
+ },
+ None => {
+ return invalid_json("Organization not found by identifier", false);
+ },
+ }
- // TODO as_str shouldn't be used here
- let organization = Organization::find_by_identifier(domainHint.as_str(), &conn);
- match organization {
- Some(organization) => {
- if !organization.use_sso {
- return invalid_json("SSO Not allowed for organization", false);
+ if domainHint == "" {
+ return invalid_json("No Organization Identifier Provided", false);
}
+
+ Ok(Json(empty_result))
},
- None => {
- return invalid_json("Organization not found by identifier", false);
+ Err(_) => {
+ return invalid_json("Invalid domainHint received", false);
},
}
-
- if domainHint == "" {
- return invalid_json("No Organization Identifier Provided", false);
- }
-
- Ok(Json(empty_result))
}
use openidconnect::core::{
@@ -601,7 +606,9 @@ fn authorize(
state: &RawStr,
conn: DbConn,
) -> Redirect {
- let client = get_client_from_identifier(domain_hint.as_str(), &conn);
+ let domain_hint_decoded = &domain_hint.percent_decode().expect("Invalid domain_hint").into_owned();
+ let state_decoded = &state.percent_decode().expect("Invalid state").into_owned();
+ let client = get_client_from_identifier(domain_hint_decoded, &conn);
let (mut authorize_url, _csrf_state, _nonce) = client
.authorize_url(
@@ -619,7 +626,7 @@ fn authorize(
let new_pairs = old_pairs.map(|pair| {
let (key, value) = pair;
if key == "state" {
- return format!("{}={}", key, state);
+ return format!("{}={}", key, state_decoded);
}
return format!("{}={}", key, value);
});
From 05a4a6c4a8c9cdd11bbff2266010a1fc32a226db Mon Sep 17 00:00:00 2001
From: Stuart Heap
Date: Wed, 1 Sep 2021 17:12:05 +0200
Subject: [PATCH 06/21] comment updates
---
src/api/identity.rs | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/src/api/identity.rs b/src/api/identity.rs
index f7bc54df7e..f36b362b4a 100644
--- a/src/api/identity.rs
+++ b/src/api/identity.rs
@@ -610,6 +610,8 @@ fn authorize(
let state_decoded = &state.percent_decode().expect("Invalid state").into_owned();
let client = get_client_from_identifier(domain_hint_decoded, &conn);
+ // TODO store the nonce for validation on authorization token exchange - unclear where to store
+ // this
let (mut authorize_url, _csrf_state, _nonce) = client
.authorize_url(
AuthenticationFlow::::AuthorizationCode,
@@ -621,7 +623,7 @@ fn authorize(
.url();
// it seems impossible to set the state going in dynamically (requires static lifetime string)
- // so I change it after the fact (will it work? Let's find out)
+ // so I change it after the fact
let old_pairs = authorize_url.query_pairs().clone();
let new_pairs = old_pairs.map(|pair| {
let (key, value) = pair;
From 7f97e7f8dd36fa0c33d9773a831a0c446dcd3fe9 Mon Sep 17 00:00:00 2001
From: Stuart Heap
Date: Wed, 1 Sep 2021 17:34:56 +0200
Subject: [PATCH 07/21] add web-vault-sso.patch
---
web-vault-sso.patch | 570 ++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 570 insertions(+)
create mode 100644 web-vault-sso.patch
diff --git a/web-vault-sso.patch b/web-vault-sso.patch
new file mode 100644
index 0000000000..dde307ad5f
--- /dev/null
+++ b/web-vault-sso.patch
@@ -0,0 +1,570 @@
+Submodule jslib contains modified content
+diff --git a/jslib/angular/src/components/register.component.ts b/jslib/angular/src/components/register.component.ts
+index 53ec3c8..7b49db1 100644
+--- a/jslib/angular/src/components/register.component.ts
++++ b/jslib/angular/src/components/register.component.ts
+@@ -24,7 +24,7 @@ export class RegisterComponent {
+ formPromise: Promise;
+ masterPasswordScore: number;
+ referenceData: ReferenceEventRequest;
+- showTerms = true;
++ showTerms = false;
+ acceptPolicies: boolean = false;
+
+ protected successRoute = 'login';
+@@ -35,7 +35,7 @@ export class RegisterComponent {
+ protected apiService: ApiService, protected stateService: StateService,
+ protected platformUtilsService: PlatformUtilsService,
+ protected passwordGenerationService: PasswordGenerationService) {
+- this.showTerms = !platformUtilsService.isSelfHost();
++ this.showTerms = false;
+ }
+
+ get masterPasswordScoreWidth() {
+@@ -69,6 +69,12 @@ export class RegisterComponent {
+ }
+
+ async submit() {
++ if (typeof crypto.subtle === 'undefined') {
++ this.platformUtilsService.showToast('error', "This browser requires HTTPS to use the web vault",
++ "Check the Vaultwarden wiki for details on how to enable it");
++ return;
++ }
++
+ if (!this.acceptPolicies && this.showTerms) {
+ this.platformUtilsService.showToast('error', this.i18nService.t('errorOccurred'),
+ this.i18nService.t('acceptPoliciesError'));
+diff --git a/jslib/angular/src/components/sso.component.ts b/jslib/angular/src/components/sso.component.ts
+index d4512a1..ad57f69 100644
+--- a/jslib/angular/src/components/sso.component.ts
++++ b/jslib/angular/src/components/sso.component.ts
+@@ -19,6 +19,8 @@ import { Utils } from 'jslib-common/misc/utils';
+
+ import { AuthResult } from 'jslib-common/models/domain/authResult';
+
++import { switchMap } from 'rxjs/operators';
++
+ @Directive()
+ export class SsoComponent {
+ identifier: string;
+@@ -48,13 +50,19 @@ export class SsoComponent {
+
+ async ngOnInit() {
+ const queryParamsSub = this.route.queryParams.subscribe(async qParams => {
+- if (qParams.code != null && qParams.state != null) {
++ // I have no idea why the qParams is empty here - I've hacked in an alternative very messily, but it works.
++ const workingParams = (new URL(window.location.href)).searchParams;
++ const workingSwap = {
++ code: workingParams.get('code'),
++ state: workingParams.get('state'),
++ };
++ if (workingSwap.code != null && workingSwap.state != null) {
+ const codeVerifier = await this.storageService.get(ConstantsService.ssoCodeVerifierKey);
+ const state = await this.storageService.get(ConstantsService.ssoStateKey);
+ await this.storageService.remove(ConstantsService.ssoCodeVerifierKey);
+ await this.storageService.remove(ConstantsService.ssoStateKey);
+- if (qParams.code != null && codeVerifier != null && state != null && this.checkState(state, qParams.state)) {
+- await this.logIn(qParams.code, codeVerifier, this.getOrgIdentiferFromState(qParams.state));
++ if (workingSwap.code != null && codeVerifier != null && state != null && this.checkState(state, workingSwap.state)) {
++ await this.logIn(workingSwap.code, codeVerifier, this.getOrgIdentiferFromState(workingSwap.state));
+ }
+ } else if (qParams.clientId != null && qParams.redirectUri != null && qParams.state != null &&
+ qParams.codeChallenge != null) {
+@@ -122,7 +130,7 @@ export class SsoComponent {
+ let authorizeUrl = this.apiService.identityBaseUrl + '/connect/authorize?' +
+ 'client_id=' + this.clientId + '&redirect_uri=' + encodeURIComponent(this.redirectUri) + '&' +
+ 'response_type=code&scope=api offline_access&' +
+- 'state=' + state + '&code_challenge=' + codeChallenge + '&' +
++ 'state=' + encodeURIComponent(state) + '&code_challenge=' + codeChallenge + '&' +
+ 'code_challenge_method=S256&response_mode=query&' +
+ 'domain_hint=' + encodeURIComponent(this.identifier);
+
+@@ -137,7 +145,7 @@ export class SsoComponent {
+ private async logIn(code: string, codeVerifier: string, orgIdFromState: string) {
+ this.loggingIn = true;
+ try {
+- this.formPromise = this.authService.logInSso(code, codeVerifier, this.redirectUri);
++ this.formPromise = this.authService.logInSso(code, codeVerifier, this.redirectUri, orgIdFromState);
+ const response = await this.formPromise;
+ if (response.twoFactor) {
+ if (this.onSuccessfulLoginTwoFactorNavigate != null) {
+diff --git a/jslib/common/src/abstractions/api.service.ts b/jslib/common/src/abstractions/api.service.ts
+index 67131df..e75a874 100644
+--- a/jslib/common/src/abstractions/api.service.ts
++++ b/jslib/common/src/abstractions/api.service.ts
+@@ -33,6 +33,7 @@ import { KeysRequest } from '../models/request/keysRequest';
+ import { OrganizationCreateRequest } from '../models/request/organizationCreateRequest';
+ import { OrganizationImportRequest } from '../models/request/organizationImportRequest';
+ import { OrganizationKeysRequest } from '../models/request/organizationKeysRequest';
++import { OrganizationSsoUpdateRequest } from '../models/request/organizationSsoUpdateRequest';
+ import { OrganizationTaxInfoUpdateRequest } from '../models/request/organizationTaxInfoUpdateRequest';
+ import { OrganizationUpdateRequest } from '../models/request/organizationUpdateRequest';
+ import { OrganizationUpgradeRequest } from '../models/request/organizationUpgradeRequest';
+@@ -360,6 +361,7 @@ export abstract class ApiService {
+ getOrganizationTaxInfo: (id: string) => Promise;
+ postOrganization: (request: OrganizationCreateRequest) => Promise;
+ putOrganization: (id: string, request: OrganizationUpdateRequest) => Promise;
++ putOrganizationSso: (id: string, request: OrganizationSsoUpdateRequest) => Promise;
+ putOrganizationTaxInfo: (id: string, request: OrganizationTaxInfoUpdateRequest) => Promise;
+ postLeaveOrganization: (id: string) => Promise;
+ postOrganizationLicense: (data: FormData) => Promise;
+diff --git a/jslib/common/src/abstractions/auth.service.ts b/jslib/common/src/abstractions/auth.service.ts
+index ac7ef04..5b1b774 100644
+--- a/jslib/common/src/abstractions/auth.service.ts
++++ b/jslib/common/src/abstractions/auth.service.ts
+@@ -15,7 +15,7 @@ export abstract class AuthService {
+ selectedTwoFactorProviderType: TwoFactorProviderType;
+
+ logIn: (email: string, masterPassword: string) => Promise;
+- logInSso: (code: string, codeVerifier: string, redirectUrl: string) => Promise;
++ logInSso: (code: string, codeVerifier: string, redirectUrl: string, orgIdentifier: string) => Promise;
+ logInApiKey: (clientId: string, clientSecret: string) => Promise;
+ logInTwoFactor: (twoFactorProvider: TwoFactorProviderType, twoFactorToken: string,
+ remember?: boolean) => Promise;
+diff --git a/jslib/common/src/models/request/tokenRequest.ts b/jslib/common/src/models/request/tokenRequest.ts
+index 7578012..964364f 100644
+--- a/jslib/common/src/models/request/tokenRequest.ts
++++ b/jslib/common/src/models/request/tokenRequest.ts
+@@ -14,9 +14,10 @@ export class TokenRequest {
+ provider: TwoFactorProviderType;
+ remember: boolean;
+ device?: DeviceRequest;
++ orgIdentifier?: string;
+
+ constructor(credentials: string[], codes: string[], clientIdClientSecret: string[], provider: TwoFactorProviderType,
+- token: string, remember: boolean, device?: DeviceRequest) {
++ token: string, remember: boolean, device?: DeviceRequest, orgIdentifier?: string) {
+ if (credentials != null && credentials.length > 1) {
+ this.email = credentials[0];
+ this.masterPasswordHash = credentials[1];
+@@ -28,6 +29,9 @@ export class TokenRequest {
+ this.clientId = clientIdClientSecret[0];
+ this.clientSecret = clientIdClientSecret[1];
+ }
++ if (orgIdentifier && orgIdentifier !== '') {
++ this.orgIdentifier = orgIdentifier;
++ }
+ this.token = token;
+ this.provider = provider;
+ this.remember = remember;
+@@ -53,6 +57,7 @@ export class TokenRequest {
+ obj.code = this.code;
+ obj.code_verifier = this.codeVerifier;
+ obj.redirect_uri = this.redirectUri;
++ obj.org_identifier = this.orgIdentifier;
+ } else {
+ throw new Error('must provide credentials or codes');
+ }
+diff --git a/jslib/common/src/models/response/organizationResponse.ts b/jslib/common/src/models/response/organizationResponse.ts
+index 21d8d43..896b7a6 100644
+--- a/jslib/common/src/models/response/organizationResponse.ts
++++ b/jslib/common/src/models/response/organizationResponse.ts
+@@ -27,6 +27,12 @@ export class OrganizationResponse extends BaseResponse {
+ useApi: boolean;
+ useResetPassword: boolean;
+ hasPublicAndPrivateKeys: boolean;
++ useSso: boolean;
++ callbackPath: string;
++ signedOutCallbackPath: string;
++ authority: string;
++ clientId: string;
++ clientSecret: string;
+
+ constructor(response: any) {
+ super(response);
+@@ -54,5 +60,11 @@ export class OrganizationResponse extends BaseResponse {
+ this.useApi = this.getResponseProperty('UseApi');
+ this.useResetPassword = this.getResponseProperty('UseResetPassword');
+ this.hasPublicAndPrivateKeys = this.getResponseProperty('HasPublicAndPrivateKeys');
++ this.useSso = this.getResponseProperty('UseSso');
++ this.callbackPath = this.getResponseProperty('CallbackPath');
++ this.signedOutCallbackPath = this.getResponseProperty('SignedOutCallbackPath');
++ this.authority = this.getResponseProperty('Authority');
++ this.clientId = this.getResponseProperty('ClientId');
++ this.clientSecret = this.getResponseProperty('ClientSecret');
+ }
+ }
+diff --git a/jslib/common/src/services/api.service.ts b/jslib/common/src/services/api.service.ts
+index 51c1c14..1a5b088 100644
+--- a/jslib/common/src/services/api.service.ts
++++ b/jslib/common/src/services/api.service.ts
+@@ -37,6 +37,7 @@ import { KeysRequest } from '../models/request/keysRequest';
+ import { OrganizationCreateRequest } from '../models/request/organizationCreateRequest';
+ import { OrganizationImportRequest } from '../models/request/organizationImportRequest';
+ import { OrganizationKeysRequest } from '../models/request/organizationKeysRequest';
++import { OrganizationSsoUpdateRequest } from '../models/request/organizationSsoUpdateRequest';
+ import { OrganizationTaxInfoUpdateRequest } from '../models/request/organizationTaxInfoUpdateRequest';
+ import { OrganizationUpdateRequest } from '../models/request/organizationUpdateRequest';
+ import { OrganizationUpgradeRequest } from '../models/request/organizationUpgradeRequest';
+@@ -1158,6 +1159,11 @@ export class ApiService implements ApiServiceAbstraction {
+ return new OrganizationResponse(r);
+ }
+
++ async putOrganizationSso(id: string, request: OrganizationSsoUpdateRequest): Promise {
++ const r = await this.send('PUT', '/organizations/' + id + '/sso', request, true, false);
++ return new OrganizationResponse(r);
++ }
++
+ async putOrganizationTaxInfo(id: string, request: OrganizationTaxInfoUpdateRequest): Promise {
+ return this.send('PUT', '/organizations/' + id + '/tax', request, true, false);
+ }
+diff --git a/jslib/common/src/services/auth.service.ts b/jslib/common/src/services/auth.service.ts
+index 6536a94..6f4899c 100644
+--- a/jslib/common/src/services/auth.service.ts
++++ b/jslib/common/src/services/auth.service.ts
+@@ -130,10 +130,10 @@ export class AuthService implements AuthServiceAbstraction {
+ key, null, null, null);
+ }
+
+- async logInSso(code: string, codeVerifier: string, redirectUrl: string): Promise {
++ async logInSso(code: string, codeVerifier: string, redirectUrl: string, orgIdentifier: string): Promise {
+ this.selectedTwoFactorProviderType = null;
+ return await this.logInHelper(null, null, null, code, codeVerifier, redirectUrl, null, null,
+- null, null, null, null);
++ null, null, null, null, orgIdentifier);
+ }
+
+ async logInApiKey(clientId: string, clientSecret: string): Promise {
+@@ -272,7 +272,7 @@ export class AuthService implements AuthServiceAbstraction {
+
+ private async logInHelper(email: string, hashedPassword: string, localHashedPassword: string, code: string,
+ codeVerifier: string, redirectUrl: string, clientId: string, clientSecret: string, key: SymmetricCryptoKey,
+- twoFactorProvider?: TwoFactorProviderType, twoFactorToken?: string, remember?: boolean): Promise {
++ twoFactorProvider?: TwoFactorProviderType, twoFactorToken?: string, remember?: boolean, orgIdentifier?: string): Promise {
+ const storedTwoFactorToken = await this.tokenService.getTwoFactorToken(email);
+ const appId = await this.appIdService.getAppId();
+ const deviceRequest = new DeviceRequest(appId, this.platformUtilsService);
+@@ -300,13 +300,13 @@ export class AuthService implements AuthServiceAbstraction {
+ let request: TokenRequest;
+ if (twoFactorToken != null && twoFactorProvider != null) {
+ request = new TokenRequest(emailPassword, codeCodeVerifier, clientIdClientSecret, twoFactorProvider,
+- twoFactorToken, remember, deviceRequest);
++ twoFactorToken, remember, deviceRequest, orgIdentifier);
+ } else if (storedTwoFactorToken != null) {
+ request = new TokenRequest(emailPassword, codeCodeVerifier, clientIdClientSecret, TwoFactorProviderType.Remember,
+- storedTwoFactorToken, false, deviceRequest);
++ storedTwoFactorToken, false, deviceRequest, orgIdentifier);
+ } else {
+ request = new TokenRequest(emailPassword, codeCodeVerifier, clientIdClientSecret, null,
+- null, false, deviceRequest);
++ null, false, deviceRequest, orgIdentifier);
+ }
+
+ const response = await this.apiService.postIdentityToken(request);
+diff --git a/src/404.html b/src/404.html
+index eba36375..cb8883ec 100644
+--- a/src/404.html
++++ b/src/404.html
+@@ -41,10 +41,10 @@
+
+
+ You can return to the web vault, check our status page
+- or contact us.
++ or contact us.
+
+
+