Browse Source

Misc updates and fixes (#8006)

main
Mathijs van Veluw 3 days ago
committed by GitHub
parent
commit
dbd7829ed1
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 5
      .env.template
  2. 197
      Cargo.lock
  3. 8
      Cargo.toml
  4. 4
      src/api/admin.rs
  5. 18
      src/api/core/two_factor/webauthn.rs
  6. 3
      src/config.rs

5
.env.template

@ -648,6 +648,11 @@
## Keep in mind that when a server drifts out of time, valid codes could be marked as invalid. ## Keep in mind that when a server drifts out of time, valid codes could be marked as invalid.
## In any case, if a code has been used it can not be used again, also codes which predates it will be invalid. ## In any case, if a code has been used it can not be used again, also codes which predates it will be invalid.
# AUTHENTICATOR_DISABLE_TIME_DRIFT=false # AUTHENTICATOR_DISABLE_TIME_DRIFT=false
##
## WebAuthn Settings
## Enable WebAuthn 2FA prefer user verification
## Sets user verification to preferred instead of discouraged, improving compatibility with some security keys.
WEBAUTHN_2FA_PREFER_USER_VERIFICATION=false
########################### ###########################
### SMTP Email settings ### ### SMTP Email settings ###

197
Cargo.lock

@ -10,11 +10,12 @@ checksum = "320119579fcad9c21884f5c4861d16174d0e06250625266f50fe6898340abefa"
[[package]] [[package]]
name = "ahash" name = "ahash"
version = "0.8.12" version = "0.8.13"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5a15f179cd60c4584b8a8c596927aadc462e27f2ca70c04e0071964a73ba7a75" checksum = "0fca89247609239eeb6915e6991111866b92d7b31025e69302bbf430cc4d2c38"
dependencies = [ dependencies = [
"cfg-if", "cfg-if",
"getrandom 0.4.3",
"once_cell", "once_cell",
"version_check", "version_check",
"zerocopy", "zerocopy",
@ -61,9 +62,9 @@ dependencies = [
[[package]] [[package]]
name = "anyhow" name = "anyhow"
version = "1.0.104" version = "1.0.105"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "330a5ed07fa54e4702c9d6c4174f74427fc0ef6e214bbd677ae50a5099946470" checksum = "2cb931c189b85683d69a5cfad41d4d418671e1ac413dd209f3f2fc31e3cfd902"
[[package]] [[package]]
name = "ar_archive_writer" name = "ar_archive_writer"
@ -159,9 +160,9 @@ dependencies = [
[[package]] [[package]]
name = "async-compression" name = "async-compression"
version = "0.4.52" version = "0.4.53"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6ad47a740fb906fffdd891e8b6d5fde2511600f7bfaebd68939fa08a14999459" checksum = "7bde8322bfc31ade96978b8d3c06be0fd60401192e7ddb9a0b2de5e215d22e61"
dependencies = [ dependencies = [
"compression-codecs", "compression-codecs",
"compression-core", "compression-core",
@ -480,9 +481,9 @@ dependencies = [
[[package]] [[package]]
name = "aws-sdk-sts" name = "aws-sdk-sts"
version = "1.127.0" version = "1.128.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "35d50661cd8816b7f23a652391c5b6f3645fce499e62e8fc5b3ed4145c5248f7" checksum = "29c357588cdf8c9ae96c0d9930fff757f9b678d06b8f68d8e37a1278fe034912"
dependencies = [ dependencies = [
"arc-swap", "arc-swap",
"aws-credential-types", "aws-credential-types",
@ -654,9 +655,9 @@ dependencies = [
[[package]] [[package]]
name = "aws-smithy-types" name = "aws-smithy-types"
version = "1.9.4" version = "1.9.5"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "aff4bf014c512840b2bba80a20417b723cbd6a0a65c02e2d81f50b4268aedfc7" checksum = "2085f9721fb3755821f8db7611a67ed15f4d6fdba6785b4db8ed7cd18eebee0f"
dependencies = [ dependencies = [
"base64-simd", "base64-simd",
"bytes", "bytes",
@ -828,9 +829,9 @@ dependencies = [
[[package]] [[package]]
name = "brotli-decompressor" name = "brotli-decompressor"
version = "6.3.2" version = "6.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cc031cd87c6529082b0b65c604e86af0ed7744841b17ccfe60b1e31fa606179e" checksum = "664148598c930650998ef56df301329ffe7b4cdb02d49b2a3fca3bcaf2185bcb"
dependencies = [ dependencies = [
"alloc-no-stdlib", "alloc-no-stdlib",
"alloc-stdlib", "alloc-stdlib",
@ -881,9 +882,9 @@ dependencies = [
[[package]] [[package]]
name = "cc" name = "cc"
version = "1.11.2" version = "1.11.3"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "33ef9e3e8154a45c7a95cff4c1299702106ad94062d7bb85fdc5d3a5afd91d45" checksum = "02f0e023adb368345ce0ca6cdfc0f24a06554468d0e8503e14a0841de79bfa69"
dependencies = [ dependencies = [
"find-msvc-tools", "find-msvc-tools",
"jobserver", "jobserver",
@ -962,9 +963,9 @@ dependencies = [
[[package]] [[package]]
name = "compression-codecs" name = "compression-codecs"
version = "0.4.47" version = "0.4.48"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "84f840cff84d10085260e460023934d0af699e71212b09b2a41452e8bd9cda43" checksum = "5e41632c2efd201c62f1432f7cbee121b97878eab579da9d85676573d1fd33b9"
dependencies = [ dependencies = [
"brotli", "brotli",
"compression-core", "compression-core",
@ -1003,21 +1004,20 @@ checksum = "be95d4a884358a21a199689323c29e9256b4a1b315e22f183d155422041d3a9a"
[[package]] [[package]]
name = "const-random" name = "const-random"
version = "0.1.18" version = "0.1.20"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "87e00182fe74b066627d63b85fd550ac2998d4b0bd86bfed477a0ae4c7c71359" checksum = "d38d4bb3e79c716fd0330d8da84171b0135e59e01076e99f22b75a64c56e952c"
dependencies = [ dependencies = [
"const-random-macro", "const-random-macro",
] ]
[[package]] [[package]]
name = "const-random-macro" name = "const-random-macro"
version = "0.1.16" version = "0.1.18"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f9d839f2a20b0aee515dc581a6172f2321f96cab76c1a38a4c584a194955390e" checksum = "d66bb491e9fc48cb3fed9d57df886880a751d540d645ebc86b6d9d35b8fa8457"
dependencies = [ dependencies = [
"getrandom 0.2.17", "getrandom 0.4.3",
"once_cell",
"tiny-keccak", "tiny-keccak",
] ]
@ -1032,9 +1032,9 @@ dependencies = [
[[package]] [[package]]
name = "cookie" name = "cookie"
version = "0.18.2" version = "0.18.3"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1a373e3602691c3cdea496d2f0ee5935151e6168fe87739483c463db1b2f2f87" checksum = "d55f2d6c30eeec7d5c6f98bd4395d4abb1895629eab97ee6522d340623615f8a"
dependencies = [ dependencies = [
"percent-encoding", "percent-encoding",
"time", "time",
@ -1127,9 +1127,9 @@ dependencies = [
[[package]] [[package]]
name = "crc32fast" name = "crc32fast"
version = "1.5.5" version = "1.5.6"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2b929dd2a135771f40afabd1073f85eed59c800b7c61901e5c254270497dad64" checksum = "fd9ae8fcb3ea71b0b26338b4ffb13006bb175de8fd07921089a906ce7e5e6945"
dependencies = [ dependencies = [
"cfg-if", "cfg-if",
] ]
@ -1900,9 +1900,9 @@ checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b"
[[package]] [[package]]
name = "form_urlencoded" name = "form_urlencoded"
version = "1.2.2" version = "1.2.3"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cb4cb245038516f5f85277875cdaa4f7d2c9a0fa0468de06ed190163b1581fcf" checksum = "afa489199eaffb1211795df1c6236ce1ad0d41a6fa45250add73e3b02420f06e"
dependencies = [ dependencies = [
"percent-encoding", "percent-encoding",
] ]
@ -2235,9 +2235,9 @@ dependencies = [
[[package]] [[package]]
name = "hashbrown" name = "hashbrown"
version = "0.17.1" version = "0.17.2"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ed5909b6e89a2db4456e54cd5f673791d7eca6732202bbf2a9cc504fe2f9b84a" checksum = "735eaa21a6a5ffb2e84362faaeb90c05ba8e19797ca30428478cb6ea3a4921bc"
[[package]] [[package]]
name = "heck" name = "heck"
@ -2431,9 +2431,9 @@ dependencies = [
[[package]] [[package]]
name = "hyper" name = "hyper"
version = "1.12.0" version = "1.13.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2c3e324da4c95177d6291d4c8730197c0d1822f8a9766814a4a44fa5ab797c9c" checksum = "229c6ff5584df4c6becbfe00567128bac768c8cd32ebc8a8366bd81ed072e8f3"
dependencies = [ dependencies = [
"atomic-waker", "atomic-waker",
"bytes", "bytes",
@ -2644,7 +2644,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cc4e190f5d26ca7051642629da2c52fc03bde85a03197c99408dcd291734c855" checksum = "cc4e190f5d26ca7051642629da2c52fc03bde85a03197c99408dcd291734c855"
dependencies = [ dependencies = [
"equivalent", "equivalent",
"hashbrown 0.17.1", "hashbrown 0.17.2",
"serde", "serde",
"serde_core", "serde_core",
] ]
@ -2709,9 +2709,9 @@ version = "0.2.46"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "175dc66334db3b9ab9985bf8b61cfed50dc16d20964bb47f9e479adcae984a7f" checksum = "175dc66334db3b9ab9985bf8b61cfed50dc16d20964bb47f9e479adcae984a7f"
dependencies = [ dependencies = [
"jiff-core", "jiff-core 0.1.8",
"jiff-static", "jiff-static 0.2.46",
"jiff-tzdb-platform", "jiff-tzdb-platform 0.1.3",
"js-sys", "js-sys",
"log", "log",
"portable-atomic", "portable-atomic",
@ -2721,6 +2721,22 @@ dependencies = [
"windows-link", "windows-link",
] ]
[[package]]
name = "jiff"
version = "1.0.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "107f2e89536b6818514025f6787b0d94d819e54fe3b40365275fc753de485b3f"
dependencies = [
"jiff-core 1.0.2",
"jiff-static 1.0.3",
"jiff-tzdb-platform 1.0.0",
"log",
"portable-atomic",
"portable-atomic-util",
"serde_core",
"windows-link",
]
[[package]] [[package]]
name = "jiff-core" name = "jiff-core"
version = "0.1.8" version = "0.1.8"
@ -2730,31 +2746,67 @@ dependencies = [
"log", "log",
] ]
[[package]]
name = "jiff-core"
version = "1.0.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d44c923edf2bf456a982253f1a9ee1f6e89e421dffd0065d9b9a581da0def58f"
dependencies = [
"log",
]
[[package]] [[package]]
name = "jiff-static" name = "jiff-static"
version = "0.2.46" version = "0.2.46"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c7b1af7547d47354bc438d797e3854601bde8f8d185780c5ba4ab27afa54f1ba" checksum = "c7b1af7547d47354bc438d797e3854601bde8f8d185780c5ba4ab27afa54f1ba"
dependencies = [ dependencies = [
"jiff-core", "jiff-core 0.1.8",
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.119", "syn 2.0.119",
] ]
[[package]]
name = "jiff-static"
version = "1.0.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4996f71e569e3a3e32b925c28ef8f0027dc30bb1d594b33eeda409eea185f5c8"
dependencies = [
"jiff-core 1.0.2",
"proc-macro2",
"quote",
"syn 3.0.10",
]
[[package]] [[package]]
name = "jiff-tzdb" name = "jiff-tzdb"
version = "0.1.10" version = "0.1.10"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0980fca2cc272465bd60e82397607ba9f33add9e48defd77923301bbd03808f2" checksum = "0980fca2cc272465bd60e82397607ba9f33add9e48defd77923301bbd03808f2"
[[package]]
name = "jiff-tzdb"
version = "1.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "12e71a1b68a875a44a33bb7a1dd84392cb77145a3367a552a3cfe6a4f5cf3afc"
[[package]] [[package]]
name = "jiff-tzdb-platform" name = "jiff-tzdb-platform"
version = "0.1.3" version = "0.1.3"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "875a5a69ac2bab1a891711cf5eccbec1ce0341ea805560dcd90b7a2e925132e8" checksum = "875a5a69ac2bab1a891711cf5eccbec1ce0341ea805560dcd90b7a2e925132e8"
dependencies = [ dependencies = [
"jiff-tzdb", "jiff-tzdb 0.1.10",
]
[[package]]
name = "jiff-tzdb-platform"
version = "1.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "dc65b284afcfa8f6cf189c7274c805505314a7ab975c60e1f548bff56525420e"
dependencies = [
"jiff-tzdb 1.0.0",
] ]
[[package]] [[package]]
@ -3051,7 +3103,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ec54a4ea92c533f8ed6b8c80dc4bbd60f5b578b173399d92f19bfb5a34bd99a3" checksum = "ec54a4ea92c533f8ed6b8c80dc4bbd60f5b578b173399d92f19bfb5a34bd99a3"
dependencies = [ dependencies = [
"serde", "serde",
"toml 1.2.1+spec-1.1.0", "toml 1.2.2+spec-1.1.0",
] ]
[[package]] [[package]]
@ -3392,7 +3444,7 @@ dependencies = [
"bytes", "bytes",
"futures", "futures",
"http 1.5.0", "http 1.5.0",
"jiff", "jiff 0.2.46",
"log", "log",
"md-5", "md-5",
"percent-encoding", "percent-encoding",
@ -3877,9 +3929,9 @@ checksum = "5be167a7af36ee22fe3115051bc51f6e6c7054c9348e28deb4f49bd6f705a315"
[[package]] [[package]]
name = "pin-project-lite" name = "pin-project-lite"
version = "0.2.17" version = "0.2.18"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a89322df9ebe1c1578d689c92318e070967d1042b512afbe49518723f4e6d5cd" checksum = "c938015719552d665fd0553b90d96cd7ff58e83e4c061ca99e6bb78865a72752"
[[package]] [[package]]
name = "pin-utils" name = "pin-utils"
@ -4000,9 +4052,9 @@ dependencies = [
[[package]] [[package]]
name = "pq-sys" name = "pq-sys"
version = "0.7.8" version = "0.7.9"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "297a95d6f2378891f949d9556723e15140e50d29eac07458dabcee8688995b1d" checksum = "b3bc77e8957fcd07d9768dc26486b07e39339693e21d3c5564be908ef6911540"
dependencies = [ dependencies = [
"libc", "libc",
"pkg-config", "pkg-config",
@ -4347,9 +4399,9 @@ dependencies = [
[[package]] [[package]]
name = "reqsign-aws-core" name = "reqsign-aws-core"
version = "3.3.0" version = "3.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ef1efa04a2b037d30bcb6fcefb0f45a4478d89c57c02bc7c2dc8276e19082b15" checksum = "163fc123fc7cf763a7c7f00f56825100e5dba5002c682eaa46f0bcd789d01bcd"
dependencies = [ dependencies = [
"asyncband 0.8.0", "asyncband 0.8.0",
"bytes", "bytes",
@ -4371,9 +4423,9 @@ dependencies = [
[[package]] [[package]]
name = "reqsign-aws-v4" name = "reqsign-aws-v4"
version = "3.4.0" version = "3.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f30bc6afac5932e1c21763dd51fd593a86b242c5a83a8a12d428c0c2bef7819f" checksum = "acf0c8db7ea8b38ef70375e273b4992227f8c2e57ee8f0df2201b41ccbf1d7c1"
dependencies = [ dependencies = [
"bytes", "bytes",
"http 1.5.0", "http 1.5.0",
@ -4386,9 +4438,9 @@ dependencies = [
[[package]] [[package]]
name = "reqsign-core" name = "reqsign-core"
version = "3.3.3" version = "3.3.4"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5041e58962ebf1a1806a06f45735f1932c9dda25ac2814a59a1b4a3f619c7862" checksum = "a1eb4e857da46e242365c17ad0bc8ed2899d7c04b38add449c21a309b8776786"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"asyncband 0.8.0", "asyncband 0.8.0",
@ -4397,7 +4449,7 @@ dependencies = [
"hex", "hex",
"hmac 0.13.0", "hmac 0.13.0",
"http 1.5.0", "http 1.5.0",
"jiff", "jiff 1.0.3",
"log", "log",
"percent-encoding", "percent-encoding",
"sha1 0.11.0", "sha1 0.11.0",
@ -4407,9 +4459,9 @@ dependencies = [
[[package]] [[package]]
name = "reqsign-file-read-tokio" name = "reqsign-file-read-tokio"
version = "3.0.8" version = "3.0.9"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "66743687bc0ccf687625a39fb8e2d0ddb404c5141ce4edf8636dd18dd5c75a58" checksum = "686019cebfbebec6a07da664ff3aece6c3214bb3537687aac6eb2da3d31b516f"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"reqsign-core", "reqsign-core",
@ -5032,9 +5084,9 @@ dependencies = [
[[package]] [[package]]
name = "serde_with" name = "serde_with"
version = "3.24.0" version = "3.25.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "df9adc193c780ef8f159aee8b61e2d5801aaa555e6eb0947fe45530ec506296f" checksum = "56cb1ca7c93ae63d6439b5250f6b6b040f7e121f32e5dd2f5d523dd4149b3204"
dependencies = [ dependencies = [
"base64 0.23.1", "base64 0.23.1",
"bs58", "bs58",
@ -5042,7 +5094,8 @@ dependencies = [
"hex", "hex",
"indexmap 1.9.3", "indexmap 1.9.3",
"indexmap 2.14.2", "indexmap 2.14.2",
"jiff", "jiff 0.2.46",
"jiff 1.0.3",
"schemars 0.9.0", "schemars 0.9.0",
"schemars 1.2.3", "schemars 1.2.3",
"serde_core", "serde_core",
@ -5053,9 +5106,9 @@ dependencies = [
[[package]] [[package]]
name = "serde_with_macros" name = "serde_with_macros"
version = "3.24.0" version = "3.25.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3e17bbc68e28663bbbb90df47e058aa7eda4fb445b89fe70457bb94fbccf6e49" checksum = "cff15a7c864bbec77d9586ca6822bc7c369bdf19e9243134a62b0b51ce26b31f"
dependencies = [ dependencies = [
"darling 0.24.1", "darling 0.24.1",
"proc-macro2", "proc-macro2",
@ -5654,9 +5707,9 @@ dependencies = [
[[package]] [[package]]
name = "toml" name = "toml"
version = "1.2.1+spec-1.1.0" version = "1.2.2+spec-1.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d5755c51863cdac711f1956baf8eb9588e060755f7d3c4c979e70ea1e1f32cd7" checksum = "5426cb1b964690d913f6c5c1a1ae0b42f428ec506bb4d452876d7a209c9bca3b"
dependencies = [ dependencies = [
"serde_core", "serde_core",
"serde_spanned 1.1.3", "serde_spanned 1.1.3",
@ -5699,9 +5752,9 @@ dependencies = [
[[package]] [[package]]
name = "toml_parser" name = "toml_parser"
version = "1.1.5+spec-1.1.0" version = "1.1.6+spec-1.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "baa693a8032d7e1cada7d0041e96126df243179ff061456783ac7f12bda4744c" checksum = "e6769c452d71ba30696c6b37770c439a9cc9110f47f7d5cdbeda79840ef5ea31"
dependencies = [ dependencies = [
"winnow 1.0.5", "winnow 1.0.5",
] ]
@ -5915,9 +5968,9 @@ checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1"
[[package]] [[package]]
name = "url" name = "url"
version = "2.5.8" version = "2.5.9"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ff67a8a4397373c3ef660812acab3268222035010ab8680ec4215f38ba3d0eed" checksum = "f00cd2407bb42c0ef17be88d4cf020f5cceffd121665bac9b8b9493a369b3b1a"
dependencies = [ dependencies = [
"form_urlencoded", "form_urlencoded",
"idna", "idna",
@ -6071,9 +6124,9 @@ checksum = "5c3082ca00d5a5ef149bb8b555a72ae84c9c59f7250f013ac822ac2e49b19c64"
[[package]] [[package]]
name = "walkdir" name = "walkdir"
version = "2.5.0" version = "2.5.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "29790946404f91d9c5d06f9874efddea1dc06c5efe94541a7d6863108e3a5e4b" checksum = "b42e295b7452c4604982280d8586001fcad9b8b201cac67bca9771e7a7475403"
dependencies = [ dependencies = [
"same-file", "same-file",
"winapi-util", "winapi-util",
@ -6657,18 +6710,18 @@ dependencies = [
[[package]] [[package]]
name = "zerocopy" name = "zerocopy"
version = "0.8.63" version = "0.8.64"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e5fe1f8f1b06191a00962174c61aa5005e0bb391a6d80d07e24d115c01a92ed8" checksum = "ed43f3060383c64b000f3c630550aebdfa9d3b76d48de32390483dd2cc7e0865"
dependencies = [ dependencies = [
"zerocopy-derive", "zerocopy-derive",
] ]
[[package]] [[package]]
name = "zerocopy-derive" name = "zerocopy-derive"
version = "0.8.63" version = "0.8.64"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "863ad3ac83293fb4d740aedbfdc9240dd8d1a50c1099acd76ce80ce7c7230c7f" checksum = "a5cbd820fe3e35fb38c83b6dc7e6b1618bc46e0cd10073ae94e8d52dc468d8b9"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
@ -6751,9 +6804,9 @@ dependencies = [
[[package]] [[package]]
name = "zlib-rs" name = "zlib-rs"
version = "0.6.8" version = "0.6.9"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b268e58e7c693d7c271f93ffc4ba3b380412554231c85bf61ca7af91042a4112" checksum = "aa76918995d776d9dd34d371030be228d021137449771493d56e29f77e4148ac"
[[package]] [[package]]
name = "zmij" name = "zmij"

8
Cargo.toml

@ -161,7 +161,7 @@ webauthn-rs-core = "0.5.5"
serde_cbor_2 = { version = "0.13.0", optional = true } serde_cbor_2 = { version = "0.13.0", optional = true }
# Handling of URL's for WebAuthn and favicons # Handling of URL's for WebAuthn and favicons
url = "2.5.8" url = "2.5.9"
# Email libraries # Email libraries
lettre = { version = "0.11.24", default-features = false, features = [ lettre = { version = "0.11.24", default-features = false, features = [
@ -217,7 +217,7 @@ bytes = "1.12.2"
svg-hush = "0.9.7" svg-hush = "0.9.7"
# Used for custom short lived cookie jar during favicon extraction # Used for custom short lived cookie jar during favicon extraction
cookie = "0.18.2" cookie = "0.18.3"
cookie_store = "0.22.1" cookie_store = "0.22.1"
# Used by U2F, JWT and PostgreSQL # Used by U2F, JWT and PostgreSQL
@ -270,8 +270,8 @@ aws-config = { version = "1.13.3", optional = true, default-features = false, fe
] } ] }
aws-credential-types = { version = "1.3.1", optional = true } aws-credential-types = { version = "1.3.1", optional = true }
aws-smithy-runtime-api = { version = "1.22.0", optional = true } aws-smithy-runtime-api = { version = "1.22.0", optional = true }
reqsign-aws-v4 = { version = "3.4.0", optional = true } reqsign-aws-v4 = { version = "3.5.0", optional = true }
reqsign-core = { version = "3.3.3", optional = true } reqsign-core = { version = "3.3.4", optional = true }
# Strip debuginfo from the release builds # Strip debuginfo from the release builds
# The debug symbols are to provide better panic traces # The debug symbols are to provide better panic traces

4
src/api/admin.rs

@ -99,8 +99,8 @@ static CAN_BACKUP: LazyLock<bool> = LazyLock::new(|| ACTIVE_DB_TYPE.get().is_som
static CAN_BACKUP: LazyLock<bool> = LazyLock::new(|| false); static CAN_BACKUP: LazyLock<bool> = LazyLock::new(|| false);
#[get("/")] #[get("/")]
fn admin_disabled() -> &'static str { fn admin_disabled() -> (Status, &'static str) {
"The admin panel is disabled, please configure the 'ADMIN_TOKEN' variable to enable it" (Status::NotFound, "The admin panel is disabled, please configure the 'ADMIN_TOKEN' variable to enable it")
} }
const COOKIE_NAME: &str = "VW_ADMIN"; const COOKIE_NAME: &str = "VW_ADMIN";

18
src/api/core/two_factor/webauthn.rs

@ -46,6 +46,14 @@ static WEBAUTHN: LazyLock<Webauthn> = LazyLock::new(|| {
webauthn.build().expect("Building Webauthn failed") webauthn.build().expect("Building Webauthn failed")
}); });
fn user_verification_policy() -> UserVerificationPolicy {
if CONFIG.webauthn_2fa_prefer_user_verification() {
UserVerificationPolicy::Preferred
} else {
UserVerificationPolicy::Discouraged_DO_NOT_USE
}
}
pub fn routes() -> Vec<Route> { pub fn routes() -> Vec<Route> {
routes![ routes![
get_webauthn, get_webauthn,
@ -161,7 +169,8 @@ async fn generate_webauthn_challenge(data: Json<VerificationTokenData>, headers:
)?; )?;
let mut state = serde_json::to_value(&state)?; let mut state = serde_json::to_value(&state)?;
state["rs"]["policy"] = Value::String("discouraged".to_owned()); let user_verification_policy = user_verification_policy();
state["rs"]["policy"] = serde_json::to_value(user_verification_policy)?;
state["rs"]["extensions"].as_object_mut().unwrap().clear(); state["rs"]["extensions"].as_object_mut().unwrap().clear();
let type_ = TwoFactorType::WebauthnRegisterChallenge; let type_ = TwoFactorType::WebauthnRegisterChallenge;
@ -171,7 +180,7 @@ async fn generate_webauthn_challenge(data: Json<VerificationTokenData>, headers:
// we need to modify some of the default settings defined by `start_passkey_registration()`. // we need to modify some of the default settings defined by `start_passkey_registration()`.
challenge.public_key.extensions = None; challenge.public_key.extensions = None;
if let Some(asc) = challenge.public_key.authenticator_selection.as_mut() { if let Some(asc) = challenge.public_key.authenticator_selection.as_mut() {
asc.user_verification = UserVerificationPolicy::Discouraged_DO_NOT_USE; asc.user_verification = user_verification_policy;
} }
let mut challenge_value = serde_json::to_value(challenge.public_key)?; let mut challenge_value = serde_json::to_value(challenge.public_key)?;
@ -424,13 +433,14 @@ pub async fn generate_webauthn_login(user_id: &UserId, conn: &DbConn) -> JsonRes
// Modify to discourage user verification // Modify to discourage user verification
let mut state = serde_json::to_value(&state)?; let mut state = serde_json::to_value(&state)?;
state["ast"]["policy"] = Value::String("discouraged".to_owned()); let user_verification_policy = user_verification_policy();
state["ast"]["policy"] = serde_json::to_value(user_verification_policy)?;
// Add appid, this is only needed for U2F compatibility, so maybe it can be removed as well // Add appid, this is only needed for U2F compatibility, so maybe it can be removed as well
let app_id = format!("{}/app-id.json", CONFIG.domain()); let app_id = format!("{}/app-id.json", CONFIG.domain());
state["ast"]["appid"] = Value::String(app_id.clone()); state["ast"]["appid"] = Value::String(app_id.clone());
response.public_key.user_verification = UserVerificationPolicy::Discouraged_DO_NOT_USE; response.public_key.user_verification = user_verification_policy;
response response
.public_key .public_key
.extensions .extensions

3
src/config.rs

@ -781,6 +781,9 @@ make_config! {
/// Two-Factor remember duration |> Number of days before a remembered Two-Factor login expires (min: 1, max: 90). /// Two-Factor remember duration |> Number of days before a remembered Two-Factor login expires (min: 1, max: 90).
two_factor_remember_days: i64, true, def, 30; two_factor_remember_days: i64, true, def, 30;
/// Enable WebAuthn 2FA prefer user verification |> Sets user verification to preferred instead of discouraged, improving compatibility with some security keys.
webauthn_2fa_prefer_user_verification: bool, true, def, false;
/// Disable authenticator time drifted codes to be valid |> Enabling this only allows the current TOTP code to be valid /// Disable authenticator time drifted codes to be valid |> Enabling this only allows the current TOTP code to be valid
/// TOTP codes of the previous and next 30 seconds will be invalid. /// TOTP codes of the previous and next 30 seconds will be invalid.
authenticator_disable_time_drift: bool, true, def, false; authenticator_disable_time_drift: bool, true, def, false;

Loading…
Cancel
Save