diff --git a/.dockerignore b/.dockerignore index 69f51d2a..6bc2dbdd 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 db93ff8b..cafd7f7b 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 70d9c8f7..8737ad5a 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 dd90f9dc..5cf2ec10 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 c747e9aa..384669ef 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 29601a4a..92391417 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 c1d2326c..774f8067 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 1c1ab233..7a13cdfd 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 e5141bb8..538fdfbf 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 149d2267..32bbc441 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 8feb2eb2..5da8c2eb 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 8feb2eb2..5da8c2eb 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, } }