mirror of
https://github.com/mCaptcha/cache.git
synced 2024-11-21 16:25:19 +03:00
chore: update redis_module to 2.0.5
This commit is contained in:
parent
072bb2b0cc
commit
e1e80b149d
8 changed files with 450 additions and 264 deletions
1
.github/workflows/linux.yml
vendored
1
.github/workflows/linux.yml
vendored
|
@ -35,7 +35,6 @@ jobs:
|
||||||
/var/lib/docker
|
/var/lib/docker
|
||||||
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
|
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
|
||||||
|
|
||||||
|
|
||||||
- name: configure GPG key
|
- name: configure GPG key
|
||||||
if: (github.ref == 'refs/heads/master' || github.event_name == 'push') && github.repository == 'mCaptcha/cache'
|
if: (github.ref == 'refs/heads/master' || github.event_name == 'push') && github.repository == 'mCaptcha/cache'
|
||||||
run: echo -n "$RELEASE_BOT_GPG_SIGNING_KEY" | gpg --batch --import --pinentry-mode loopback
|
run: echo -n "$RELEASE_BOT_GPG_SIGNING_KEY" | gpg --batch --import --pinentry-mode loopback
|
||||||
|
|
558
Cargo.lock
generated
558
Cargo.lock
generated
|
@ -4,9 +4,9 @@ version = 3
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "addr2line"
|
name = "addr2line"
|
||||||
version = "0.17.0"
|
version = "0.21.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "b9ecd88a8c8378ca913a680cd98f0f13ac67383d35993f86c90a70e3f137816b"
|
checksum = "8a30b2e23b9e17a9f90641c7ab1549cd9b44f296d3ccbf309d2863cfe398a0cb"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"gimli",
|
"gimli",
|
||||||
]
|
]
|
||||||
|
@ -19,33 +19,13 @@ checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "aho-corasick"
|
name = "aho-corasick"
|
||||||
version = "0.7.18"
|
version = "1.1.2"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "1e37cfd5e7657ada45f742d6e99ca5788580b5c529dc78faf11ece6dc702656f"
|
checksum = "b2969dcb958b36655471fc61f7e416fa76033bdd4bfed0678d8fee1e2d07a1f0"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"memchr",
|
"memchr",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "ansi_term"
|
|
||||||
version = "0.12.1"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "d52a9bb7ec0cf484c551830a7ce27bd20d67eac647e1befb56b0be4ee39a55d2"
|
|
||||||
dependencies = [
|
|
||||||
"winapi",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "atty"
|
|
||||||
version = "0.2.14"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8"
|
|
||||||
dependencies = [
|
|
||||||
"hermit-abi",
|
|
||||||
"libc",
|
|
||||||
"winapi",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "autocfg"
|
name = "autocfg"
|
||||||
version = "1.1.0"
|
version = "1.1.0"
|
||||||
|
@ -54,9 +34,9 @@ checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "backtrace"
|
name = "backtrace"
|
||||||
version = "0.3.66"
|
version = "0.3.69"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "cab84319d616cfb654d03394f38ab7e6f0919e181b1b57e1fd15e7fb4077d9a7"
|
checksum = "2089b7e3f35b9dd2d0ed921ead4f6d318c27680d4a5bd167b3ee120edb105837"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"addr2line",
|
"addr2line",
|
||||||
"cc",
|
"cc",
|
||||||
|
@ -69,24 +49,24 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "bindgen"
|
name = "bindgen"
|
||||||
version = "0.59.2"
|
version = "0.66.1"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "2bd2a9a458e8f4304c52c43ebb0cfbd520289f8379a52e329a38afda99bf8eb8"
|
checksum = "f2b84e06fc203107bfbad243f4aba2af864eb7db3b1cf46ea0a023b0b433d2a7"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bitflags",
|
"bitflags 2.4.1",
|
||||||
"cexpr",
|
"cexpr",
|
||||||
"clang-sys",
|
"clang-sys",
|
||||||
"clap",
|
|
||||||
"env_logger",
|
|
||||||
"lazy_static",
|
"lazy_static",
|
||||||
"lazycell",
|
"lazycell",
|
||||||
"log",
|
"log",
|
||||||
"peeking_take_while",
|
"peeking_take_while",
|
||||||
|
"prettyplease",
|
||||||
"proc-macro2",
|
"proc-macro2",
|
||||||
"quote 1.0.20",
|
"quote 1.0.33",
|
||||||
"regex",
|
"regex",
|
||||||
"rustc-hash",
|
"rustc-hash",
|
||||||
"shlex",
|
"shlex",
|
||||||
|
"syn 2.0.38",
|
||||||
"which",
|
"which",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
@ -97,10 +77,19 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a"
|
checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "cc"
|
name = "bitflags"
|
||||||
version = "1.0.73"
|
version = "2.4.1"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "2fff2a6927b3bb87f9595d67196a70493f627687a71d87a0d692242c33f58c11"
|
checksum = "327762f6e5a765692301e5bb513e0d9fef63be86bbc14528052b1cd3e6f03e07"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "cc"
|
||||||
|
version = "1.0.83"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "f1174fb0b6ec23863f8b971027804a42614e347eafb0a95bf0b12cdae21fc4d0"
|
||||||
|
dependencies = [
|
||||||
|
"libc",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "cexpr"
|
name = "cexpr"
|
||||||
|
@ -119,30 +108,15 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "clang-sys"
|
name = "clang-sys"
|
||||||
version = "1.3.3"
|
version = "1.6.1"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "5a050e2153c5be08febd6734e29298e844fdb0fa21aeddd63b4eb7baa106c69b"
|
checksum = "c688fc74432808e3eb684cae8830a86be1d66a2bd58e1f248ed0960a590baf6f"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"glob",
|
"glob",
|
||||||
"libc",
|
"libc",
|
||||||
"libloading",
|
"libloading",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "clap"
|
|
||||||
version = "2.34.0"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "a0610544180c38b88101fecf2dd634b174a62eef6946f84dfc6a7127512b381c"
|
|
||||||
dependencies = [
|
|
||||||
"ansi_term",
|
|
||||||
"atty",
|
|
||||||
"bitflags",
|
|
||||||
"strsim 0.8.0",
|
|
||||||
"textwrap",
|
|
||||||
"unicode-width",
|
|
||||||
"vec_map",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "convert_case"
|
name = "convert_case"
|
||||||
version = "0.4.0"
|
version = "0.4.0"
|
||||||
|
@ -151,9 +125,9 @@ checksum = "6245d59a3e82a7fc217c5828a6692dbc6dfb63a0c8c90495621f7b9d79704a0e"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "darling"
|
name = "darling"
|
||||||
version = "0.12.4"
|
version = "0.14.4"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "5f2c43f534ea4b0b049015d00269734195e6d3f0f6635cb692251aca6f9f8b3c"
|
checksum = "7b750cb3417fd1b327431a470f388520309479ab0bf5e323505daf0290cd3850"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"darling_core",
|
"darling_core",
|
||||||
"darling_macro",
|
"darling_macro",
|
||||||
|
@ -161,58 +135,58 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "darling_core"
|
name = "darling_core"
|
||||||
version = "0.12.4"
|
version = "0.14.4"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "8e91455b86830a1c21799d94524df0845183fa55bafd9aa137b01c7d1065fa36"
|
checksum = "109c1ca6e6b7f82cc233a97004ea8ed7ca123a9af07a8230878fcfda9b158bf0"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"fnv",
|
"fnv",
|
||||||
"ident_case",
|
"ident_case",
|
||||||
"proc-macro2",
|
"proc-macro2",
|
||||||
"quote 1.0.20",
|
"quote 1.0.33",
|
||||||
"strsim 0.10.0",
|
"strsim",
|
||||||
"syn 1.0.98",
|
"syn 1.0.109",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "darling_macro"
|
name = "darling_macro"
|
||||||
version = "0.12.4"
|
version = "0.14.4"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "29b5acf0dea37a7f66f7b25d2c5e93fd46f8f6968b1a5d7a3e02e97768afc95a"
|
checksum = "a4aab4dbc9f7611d8b55048a3a16d2d010c2c8334e46304b40ac1cc14bf3b48e"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"darling_core",
|
"darling_core",
|
||||||
"quote 1.0.20",
|
"quote 1.0.33",
|
||||||
"syn 1.0.98",
|
"syn 1.0.109",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "derive_builder"
|
name = "derive_builder"
|
||||||
version = "0.10.2"
|
version = "0.12.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "d13202debe11181040ae9063d739fa32cfcaaebe2275fe387703460ae2365b30"
|
checksum = "8d67778784b508018359cbc8696edb3db78160bab2c2a28ba7f56ef6932997f8"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"derive_builder_macro",
|
"derive_builder_macro",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "derive_builder_core"
|
name = "derive_builder_core"
|
||||||
version = "0.10.2"
|
version = "0.12.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "66e616858f6187ed828df7c64a6d71720d83767a7f19740b2d1b6fe6327b36e5"
|
checksum = "c11bdc11a0c47bc7d37d582b5285da6849c96681023680b906673c5707af7b0f"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"darling",
|
"darling",
|
||||||
"proc-macro2",
|
"proc-macro2",
|
||||||
"quote 1.0.20",
|
"quote 1.0.33",
|
||||||
"syn 1.0.98",
|
"syn 1.0.109",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "derive_builder_macro"
|
name = "derive_builder_macro"
|
||||||
version = "0.10.2"
|
version = "0.12.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "58a94ace95092c5acb1e97a7e846b310cfbd499652f72297da7493f618a98d73"
|
checksum = "ebcda35c7a396850a55ffeac740804b40ffec779b98fffbb1738f4033f0ee79e"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"derive_builder_core",
|
"derive_builder_core",
|
||||||
"syn 1.0.98",
|
"syn 1.0.109",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
|
@ -223,16 +197,16 @@ checksum = "4fb810d30a7c1953f91334de7244731fc3f3c10d7fe163338a35b9f640960321"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"convert_case",
|
"convert_case",
|
||||||
"proc-macro2",
|
"proc-macro2",
|
||||||
"quote 1.0.20",
|
"quote 1.0.33",
|
||||||
"rustc_version",
|
"rustc_version",
|
||||||
"syn 1.0.98",
|
"syn 1.0.109",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "either"
|
name = "either"
|
||||||
version = "1.7.0"
|
version = "1.9.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "3f107b87b6afc2a64fd13cac55fe06d6c8859f12d4b14cbcdd2c67d0976781be"
|
checksum = "a26ae43d7bcc3b814de94796a5e736d4029efb0ee900c12e2d54c993ad1a1e07"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "enum-primitive-derive"
|
name = "enum-primitive-derive"
|
||||||
|
@ -246,16 +220,13 @@ dependencies = [
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "env_logger"
|
name = "errno"
|
||||||
version = "0.9.0"
|
version = "0.3.5"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "0b2cf0344971ee6c64c31be0d530793fba457d322dfec2810c453d0ef228f9c3"
|
checksum = "ac3e13f66a2f95e32a39eaa81f6b95d42878ca0e1db0c7543723dfe12557e860"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"atty",
|
"libc",
|
||||||
"humantime",
|
"windows-sys",
|
||||||
"log",
|
|
||||||
"regex",
|
|
||||||
"termcolor",
|
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
|
@ -266,9 +237,9 @@ checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "getrandom"
|
name = "getrandom"
|
||||||
version = "0.2.7"
|
version = "0.2.10"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "4eb1a864a501629691edf6c15a593b7a51eebaa1e8468e9ddc623de7c9b58ec6"
|
checksum = "be4136b2a15dd319360be1c07d9933517ccf0be8f16bf62a3bee4f0d618df427"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"cfg-if",
|
"cfg-if",
|
||||||
"libc",
|
"libc",
|
||||||
|
@ -277,37 +248,31 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "gimli"
|
name = "gimli"
|
||||||
version = "0.26.2"
|
version = "0.28.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "22030e2c5a68ec659fde1e949a745124b48e6fa8b045b7ed5bd1fe4ccc5c4e5d"
|
checksum = "6fb8d784f27acf97159b40fc4db5ecd8aa23b9ad5ef69cdd136d3bc80665f0c0"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "glob"
|
name = "glob"
|
||||||
version = "0.3.0"
|
version = "0.3.1"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "9b919933a397b79c37e33b77bb2aa3dc8eb6e165ad809e58ff75bc7db2e34574"
|
checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "heck"
|
name = "heck"
|
||||||
version = "0.4.0"
|
version = "0.4.1"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "2540771e65fc8cb83cd6e8a237f70c319bd5c29f78ed1084ba5d50eeac86f7f9"
|
checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "hermit-abi"
|
name = "home"
|
||||||
version = "0.1.19"
|
version = "0.5.5"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33"
|
checksum = "5444c27eef6923071f7ebcc33e3444508466a76f7a2b93da00ed6e19f30c1ddb"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"libc",
|
"windows-sys",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "humantime"
|
|
||||||
version = "2.1.0"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4"
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "ident_case"
|
name = "ident_case"
|
||||||
version = "1.0.1"
|
version = "1.0.1"
|
||||||
|
@ -316,9 +281,9 @@ checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "itoa"
|
name = "itoa"
|
||||||
version = "1.0.2"
|
version = "1.0.9"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "112c678d4050afce233f4f2852bb2eb519230b3cf12f33585275537d7e41578d"
|
checksum = "af150ab688ff2122fcef229be89cb50dd66af9e01a4ff320cc137eecc9bacc38"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "lazy_static"
|
name = "lazy_static"
|
||||||
|
@ -334,15 +299,15 @@ checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "libc"
|
name = "libc"
|
||||||
version = "0.2.126"
|
version = "0.2.149"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "349d5a591cd28b49e1d1037471617a32ddcda5731b99419008085f72d5a53836"
|
checksum = "a08173bc88b7955d1b3145aa561539096c421ac8debde8cbc3612ec635fee29b"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "libloading"
|
name = "libloading"
|
||||||
version = "0.7.3"
|
version = "0.7.4"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "efbc0f03f9a775e9f6aed295c6a1ba2253c5757a9e03d55c6caa46a681abcddd"
|
checksum = "b67380fd3b2fbe7527a606e18729d21c6f3951633d0500574c4dc22d2d638b9f"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"cfg-if",
|
"cfg-if",
|
||||||
"winapi",
|
"winapi",
|
||||||
|
@ -350,8 +315,8 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "libmcaptcha"
|
name = "libmcaptcha"
|
||||||
version = "0.1.4"
|
version = "0.2.4"
|
||||||
source = "git+https://github.com/mCaptcha/libmcaptcha?branch=master#374dcc936ad5d030517be73a4d939cbe245fd9ac"
|
source = "git+https://github.com/mCaptcha/libmcaptcha?tag=0.2.4#681a5c6380373440f56f4c0bda2ffac5654df773"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"derive_builder",
|
"derive_builder",
|
||||||
"derive_more",
|
"derive_more",
|
||||||
|
@ -361,14 +326,37 @@ dependencies = [
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "log"
|
name = "linkme"
|
||||||
version = "0.4.17"
|
version = "0.3.17"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "abb12e687cfb44aa40f41fc3978ef76448f9b6038cad6aef4259d3c095a2382e"
|
checksum = "91ed2ee9464ff9707af8e9ad834cffa4802f072caad90639c583dd3c62e6e608"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"cfg-if",
|
"linkme-impl",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "linkme-impl"
|
||||||
|
version = "0.3.17"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "ba125974b109d512fccbc6c0244e7580143e460895dfd6ea7f8bbb692fd94396"
|
||||||
|
dependencies = [
|
||||||
|
"proc-macro2",
|
||||||
|
"quote 1.0.33",
|
||||||
|
"syn 2.0.38",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "linux-raw-sys"
|
||||||
|
version = "0.4.10"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "da2479e8c062e40bf0066ffa0bc823de0a9368974af99c9f6df941d2c231e03f"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "log"
|
||||||
|
version = "0.4.20"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "mcaptcha-cache"
|
name = "mcaptcha-cache"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
|
@ -385,9 +373,18 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "memchr"
|
name = "memchr"
|
||||||
version = "2.5.0"
|
version = "2.6.4"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d"
|
checksum = "f665ee40bc4a3c5590afb1e9677db74a508659dfd71e126420da8274909a0167"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "memoffset"
|
||||||
|
version = "0.7.1"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "5de893c32cde5f383baa4c04c5d6dbdd735cfd4a794b0debdb2bb1b421da5ff4"
|
||||||
|
dependencies = [
|
||||||
|
"autocfg",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "minimal-lexical"
|
name = "minimal-lexical"
|
||||||
|
@ -397,18 +394,31 @@ checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "miniz_oxide"
|
name = "miniz_oxide"
|
||||||
version = "0.5.3"
|
version = "0.7.1"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "6f5c75688da582b8ffc1f1799e9db273f32133c49e048f614d22ec3256773ccc"
|
checksum = "e7810e0be55b428ada41041c41f32c9f1a42817901b4ccf45fa3d4b6561e74c7"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"adler",
|
"adler",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "nom"
|
name = "nix"
|
||||||
version = "7.1.1"
|
version = "0.26.4"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "a8903e5a29a317527874d0402f867152a3d21c908bb0b933e416c65e301d4c36"
|
checksum = "598beaf3cc6fdd9a5dfb1630c2800c7acd31df7aaf0f565796fba2b53ca1af1b"
|
||||||
|
dependencies = [
|
||||||
|
"bitflags 1.3.2",
|
||||||
|
"cfg-if",
|
||||||
|
"libc",
|
||||||
|
"memoffset",
|
||||||
|
"pin-utils",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "nom"
|
||||||
|
version = "7.1.3"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "d273983c5a657a70a3e8f2a01329822f3b8c8172b73826411a55751e404a0a4a"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"memchr",
|
"memchr",
|
||||||
"minimal-lexical",
|
"minimal-lexical",
|
||||||
|
@ -420,27 +430,33 @@ version = "0.1.43"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "92e5113e9fd4cc14ded8e499429f396a20f98c772a47cc8622a736e1ec843c31"
|
checksum = "92e5113e9fd4cc14ded8e499429f396a20f98c772a47cc8622a736e1ec843c31"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"num-traits 0.2.15",
|
"num-traits 0.2.17",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "num-traits"
|
name = "num-traits"
|
||||||
version = "0.2.15"
|
version = "0.2.17"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "578ede34cf02f8924ab9447f50c28075b4d3e5b269972345e7e0372b38c6cdcd"
|
checksum = "39e3200413f237f41ab11ad6d161bc7239c84dcb631773ccd7de3dfe4b5c267c"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"autocfg",
|
"autocfg",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "object"
|
name = "object"
|
||||||
version = "0.29.0"
|
version = "0.32.1"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "21158b2c33aa6d4561f1c0a6ea283ca92bc54802a93b263e910746d679a7eb53"
|
checksum = "9cf5f9dd3933bd50a9e1f149ec995f39ae2c496d31fd772c1fd45ebc27e902b0"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"memchr",
|
"memchr",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "once_cell"
|
||||||
|
version = "1.18.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "dd8b5dd2ae5ed71462c540258bedcb51965123ad7e7ccf4b9a8cafaa4a63576d"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "peeking_take_while"
|
name = "peeking_take_while"
|
||||||
version = "0.1.2"
|
version = "0.1.2"
|
||||||
|
@ -449,21 +465,37 @@ checksum = "19b17cddbe7ec3f8bc800887bab5e717348c95ea2ca0b1bf0837fb964dc67099"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "pin-project-lite"
|
name = "pin-project-lite"
|
||||||
version = "0.2.9"
|
version = "0.2.13"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "e0a7ae3ac2f1173085d398531c705756c94a4c56843785df85a60c1a0afac116"
|
checksum = "8afb450f006bf6385ca15ef45d71d2288452bc3683ce2e2cacc0d18e4be60b58"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "pin-utils"
|
||||||
|
version = "0.1.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "ppv-lite86"
|
name = "ppv-lite86"
|
||||||
version = "0.2.16"
|
version = "0.2.17"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "eb9f9e6e233e5c4a35559a617bf40a4ec447db2e84c20b55a6f83167b7e57872"
|
checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "prettyplease"
|
||||||
|
version = "0.2.15"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "ae005bd773ab59b4725093fd7df83fd7892f7d8eafb48dbd7de6e024e4215f9d"
|
||||||
|
dependencies = [
|
||||||
|
"proc-macro2",
|
||||||
|
"syn 2.0.38",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "proc-macro2"
|
name = "proc-macro2"
|
||||||
version = "1.0.40"
|
version = "1.0.69"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "dd96a1e8ed2596c337f8eae5f24924ec83f5ad5ab21ea8e455d3566c69fbcaf7"
|
checksum = "134c189feb4956b20f6f547d2cf727d4c0fe06722b20a0eec87ed445a97f92da"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"unicode-ident",
|
"unicode-ident",
|
||||||
]
|
]
|
||||||
|
@ -476,9 +508,9 @@ checksum = "7a6e920b65c65f10b2ae65c831a81a073a89edd28c7cce89475bff467ab4167a"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "quote"
|
name = "quote"
|
||||||
version = "1.0.20"
|
version = "1.0.33"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "3bcdf212e9776fbcb2d23ab029360416bb1706b1aea2d1a5ba002727cbcab804"
|
checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"proc-macro2",
|
"proc-macro2",
|
||||||
]
|
]
|
||||||
|
@ -506,35 +538,65 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "rand_core"
|
name = "rand_core"
|
||||||
version = "0.6.3"
|
version = "0.6.4"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "d34f1408f55294453790c48b2f1ebbb1c5b4b7563eb1f418bcfcfdbb06ebb4e7"
|
checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"getrandom",
|
"getrandom",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "redis-module"
|
name = "redis-module"
|
||||||
version = "1.0.1"
|
version = "2.0.5"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "04133364fe1a1fce0d9e3b6baf2877bec48c01c9cfea1ed3f76b862b0ac09032"
|
checksum = "5d56e69a7b714b77ac2b43f5ae97b401b9174b7f4548553481cfa113f73c810f"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"backtrace",
|
"backtrace",
|
||||||
"bindgen",
|
"bindgen",
|
||||||
"bitflags",
|
"bitflags 2.4.1",
|
||||||
"cc",
|
"cc",
|
||||||
|
"cfg-if",
|
||||||
"enum-primitive-derive",
|
"enum-primitive-derive",
|
||||||
"libc",
|
"libc",
|
||||||
"num-traits 0.2.15",
|
"linkme",
|
||||||
|
"log",
|
||||||
|
"nix",
|
||||||
|
"num-traits 0.2.17",
|
||||||
|
"redis-module-macros-internals",
|
||||||
"regex",
|
"regex",
|
||||||
|
"serde",
|
||||||
"strum_macros",
|
"strum_macros",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "regex"
|
name = "redis-module-macros-internals"
|
||||||
version = "1.6.0"
|
version = "2.0.5"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "4c4eb3267174b8c6c2f654116623910a0fef09c4753f8dd83db29c48a0df988b"
|
checksum = "21305e9453d5a343287d2c93d285941de0faa1b6ca6151a4d62bcfe6090a2082"
|
||||||
|
dependencies = [
|
||||||
|
"lazy_static",
|
||||||
|
"proc-macro2",
|
||||||
|
"quote 1.0.33",
|
||||||
|
"syn 1.0.109",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "regex"
|
||||||
|
version = "1.10.2"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "380b951a9c5e80ddfd6136919eef32310721aa4aacd4889a8d39124b026ab343"
|
||||||
|
dependencies = [
|
||||||
|
"aho-corasick",
|
||||||
|
"memchr",
|
||||||
|
"regex-automata",
|
||||||
|
"regex-syntax",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "regex-automata"
|
||||||
|
version = "0.4.3"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "5f804c7828047e88b2d32e2d7fe5a105da8ee3264f01902f796c8e067dc2483f"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"aho-corasick",
|
"aho-corasick",
|
||||||
"memchr",
|
"memchr",
|
||||||
|
@ -543,15 +605,15 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "regex-syntax"
|
name = "regex-syntax"
|
||||||
version = "0.6.27"
|
version = "0.8.2"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "a3f87b73ce11b1619a3c6332f45341e0047173771e8b8b73f87bfeefb7b56244"
|
checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "rustc-demangle"
|
name = "rustc-demangle"
|
||||||
version = "0.1.21"
|
version = "0.1.23"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "7ef03e0a2b150c7a90d01faf6254c9c48a41e95fb2a8c2ac1c6f0d2b9aefc342"
|
checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "rustc-hash"
|
name = "rustc-hash"
|
||||||
|
@ -569,48 +631,61 @@ dependencies = [
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "rustversion"
|
name = "rustix"
|
||||||
version = "1.0.8"
|
version = "0.38.19"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "24c8ad4f0c00e1eb5bc7614d236a7f1300e3dbd76b68cac8e06fb00b015ad8d8"
|
checksum = "745ecfa778e66b2b63c88a61cb36e0eea109e803b0b86bf9879fbc77c70e86ed"
|
||||||
|
dependencies = [
|
||||||
|
"bitflags 2.4.1",
|
||||||
|
"errno",
|
||||||
|
"libc",
|
||||||
|
"linux-raw-sys",
|
||||||
|
"windows-sys",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "rustversion"
|
||||||
|
version = "1.0.14"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "7ffc183a10b4478d04cbbbfc96d0873219d962dd5accaff2ffbd4ceb7df837f4"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "ryu"
|
name = "ryu"
|
||||||
version = "1.0.10"
|
version = "1.0.15"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "f3f6f92acf49d1b98f7a81226834412ada05458b7364277387724a237f062695"
|
checksum = "1ad4cc8da4ef723ed60bced201181d83791ad433213d8c24efffda1eec85d741"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "semver"
|
name = "semver"
|
||||||
version = "1.0.12"
|
version = "1.0.20"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "a2333e6df6d6598f2b1974829f853c2b4c5f4a6e503c10af918081aa6f8564e1"
|
checksum = "836fa6a3e1e547f9a2c4040802ec865b5d85f4014efe00555d7090a3dcaa1090"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "serde"
|
name = "serde"
|
||||||
version = "1.0.140"
|
version = "1.0.189"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "fc855a42c7967b7c369eb5860f7164ef1f6f81c20c7cc1141f2a604e18723b03"
|
checksum = "8e422a44e74ad4001bdc8eede9a4570ab52f71190e9c076d14369f38b9200537"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"serde_derive",
|
"serde_derive",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "serde_derive"
|
name = "serde_derive"
|
||||||
version = "1.0.140"
|
version = "1.0.189"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "6f2122636b9fe3b81f1cb25099fcf2d3f542cdb1d45940d56c713158884a05da"
|
checksum = "1e48d1f918009ce3145511378cf68d613e3b3d9137d67272562080d68a2b32d5"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"proc-macro2",
|
"proc-macro2",
|
||||||
"quote 1.0.20",
|
"quote 1.0.33",
|
||||||
"syn 1.0.98",
|
"syn 2.0.38",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "serde_json"
|
name = "serde_json"
|
||||||
version = "1.0.82"
|
version = "1.0.107"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "82c2c1fdcd807d1098552c5b9a36e425e42e9fbd7c6a37a8425f390f781f7fa7"
|
checksum = "6b420ce6e3d8bd882e9b243c6eed35dbc9a6110c9769e74b584e0d68d1f20c65"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"itoa",
|
"itoa",
|
||||||
"ryu",
|
"ryu",
|
||||||
|
@ -619,15 +694,9 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "shlex"
|
name = "shlex"
|
||||||
version = "1.1.0"
|
version = "1.2.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "43b2853a4d09f215c24cc5489c992ce46052d359b5109343cbafbf26bc62f8a3"
|
checksum = "a7cee0529a6d40f580e7a5e6c495c8fbfe21b7b52795ed4bb5e62cdf92bc6380"
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "strsim"
|
|
||||||
version = "0.8.0"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "8ea5119cdb4c55b55d432abb513a0429384878c15dde60cc77b1c99de1a95a6a"
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "strsim"
|
name = "strsim"
|
||||||
|
@ -637,15 +706,15 @@ checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "strum_macros"
|
name = "strum_macros"
|
||||||
version = "0.24.2"
|
version = "0.24.3"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "4faebde00e8ff94316c01800f9054fd2ba77d30d9e922541913051d1d978918b"
|
checksum = "1e385be0d24f186b4ce2f9982191e7101bb737312ad61c1f2f984f34bcf85d59"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"heck",
|
"heck",
|
||||||
"proc-macro2",
|
"proc-macro2",
|
||||||
"quote 1.0.20",
|
"quote 1.0.33",
|
||||||
"rustversion",
|
"rustversion",
|
||||||
"syn 1.0.98",
|
"syn 1.0.109",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
|
@ -661,12 +730,23 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "syn"
|
name = "syn"
|
||||||
version = "1.0.98"
|
version = "1.0.109"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "c50aef8a904de4c23c788f104b7dddc7d6f79c647c7c8ce4cc8f73eb0ca773dd"
|
checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"proc-macro2",
|
"proc-macro2",
|
||||||
"quote 1.0.20",
|
"quote 1.0.33",
|
||||||
|
"unicode-ident",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "syn"
|
||||||
|
version = "2.0.38"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "e96b79aaa137db8f61e26363a0c9b47d8b4ec75da28b7d1d614c2303e232408b"
|
||||||
|
dependencies = [
|
||||||
|
"proc-macro2",
|
||||||
|
"quote 1.0.33",
|
||||||
"unicode-ident",
|
"unicode-ident",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
@ -679,45 +759,21 @@ dependencies = [
|
||||||
"unicode-xid",
|
"unicode-xid",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "termcolor"
|
|
||||||
version = "1.1.3"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "bab24d30b911b2376f3a13cc2cd443142f0c81dda04c118693e35b3835757755"
|
|
||||||
dependencies = [
|
|
||||||
"winapi-util",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "textwrap"
|
|
||||||
version = "0.11.0"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "d326610f408c7a4eb6f51c37c330e496b08506c9457c9d34287ecc38809fb060"
|
|
||||||
dependencies = [
|
|
||||||
"unicode-width",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "tokio"
|
name = "tokio"
|
||||||
version = "1.20.0"
|
version = "1.33.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "57aec3cfa4c296db7255446efb4928a6be304b431a806216105542a67b6ca82e"
|
checksum = "4f38200e3ef7995e5ef13baec2f432a6da0aa9ac495b2c0e8f3b7eec2c92d653"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"autocfg",
|
"backtrace",
|
||||||
"pin-project-lite",
|
"pin-project-lite",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "unicode-ident"
|
name = "unicode-ident"
|
||||||
version = "1.0.2"
|
version = "1.0.12"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "15c61ba63f9235225a22310255a29b806b907c9b8c964bcbd0a2c70f3f2deea7"
|
checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b"
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "unicode-width"
|
|
||||||
version = "0.1.9"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "3ed742d4ea2bd1176e236172c8429aaf54486e7ac098db29ffe6529e0ce50973"
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "unicode-xid"
|
name = "unicode-xid"
|
||||||
|
@ -725,12 +781,6 @@ version = "0.0.4"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "8c1f860d7d29cf02cb2f3f359fd35991af3d30bac52c57d265a3c461074cb4dc"
|
checksum = "8c1f860d7d29cf02cb2f3f359fd35991af3d30bac52c57d265a3c461074cb4dc"
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "vec_map"
|
|
||||||
version = "0.8.2"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "f1bddf1187be692e79c5ffeab891132dfb0f236ed36a43c7ed39f1165ee20191"
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "wasi"
|
name = "wasi"
|
||||||
version = "0.11.0+wasi-snapshot-preview1"
|
version = "0.11.0+wasi-snapshot-preview1"
|
||||||
|
@ -739,13 +789,14 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "which"
|
name = "which"
|
||||||
version = "4.2.5"
|
version = "4.4.2"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "5c4fb54e6113b6a8772ee41c3404fb0301ac79604489467e0a9ce1f3e97c24ae"
|
checksum = "87ba24419a2078cd2b0f2ede2691b6c66d8e47836da3b6db8265ebad47afbfc7"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"either",
|
"either",
|
||||||
"lazy_static",
|
"home",
|
||||||
"libc",
|
"once_cell",
|
||||||
|
"rustix",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
|
@ -764,17 +815,74 @@ version = "0.4.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6"
|
checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6"
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "winapi-util"
|
|
||||||
version = "0.1.5"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178"
|
|
||||||
dependencies = [
|
|
||||||
"winapi",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "winapi-x86_64-pc-windows-gnu"
|
name = "winapi-x86_64-pc-windows-gnu"
|
||||||
version = "0.4.0"
|
version = "0.4.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f"
|
checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "windows-sys"
|
||||||
|
version = "0.48.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9"
|
||||||
|
dependencies = [
|
||||||
|
"windows-targets",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "windows-targets"
|
||||||
|
version = "0.48.5"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c"
|
||||||
|
dependencies = [
|
||||||
|
"windows_aarch64_gnullvm",
|
||||||
|
"windows_aarch64_msvc",
|
||||||
|
"windows_i686_gnu",
|
||||||
|
"windows_i686_msvc",
|
||||||
|
"windows_x86_64_gnu",
|
||||||
|
"windows_x86_64_gnullvm",
|
||||||
|
"windows_x86_64_msvc",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "windows_aarch64_gnullvm"
|
||||||
|
version = "0.48.5"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "windows_aarch64_msvc"
|
||||||
|
version = "0.48.5"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "windows_i686_gnu"
|
||||||
|
version = "0.48.5"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "windows_i686_msvc"
|
||||||
|
version = "0.48.5"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "windows_x86_64_gnu"
|
||||||
|
version = "0.48.5"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "windows_x86_64_gnullvm"
|
||||||
|
version = "0.48.5"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "windows_x86_64_msvc"
|
||||||
|
version = "0.48.5"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538"
|
||||||
|
|
12
Cargo.toml
12
Cargo.toml
|
@ -9,22 +9,24 @@ homepage = "https://github.com/mcaptcha/cache"
|
||||||
license = "AGPLv3 or later version"
|
license = "AGPLv3 or later version"
|
||||||
|
|
||||||
[lib]
|
[lib]
|
||||||
crate-type = ["cdylib"]
|
crate-type = ["cdylib", "rlib"]
|
||||||
name = "cache"
|
name = "cache"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
redis-module = { version="1", features = ["experimental-api"]}
|
redis-module = { version="2.0.5", features = ["min-redis-compatibility-version-6-0"], default-features=false}
|
||||||
libc = "0.2"
|
libc = "0.2"
|
||||||
serde_json = "1.0.81"
|
serde_json = "1.0.81"
|
||||||
serde = {version = "1.0.137", features = ["derive"]}
|
serde = {version = "1.0.137", features = ["derive"]}
|
||||||
lazy_static = "1.4"
|
lazy_static = "1.4"
|
||||||
rand = "0.8"
|
rand = "0.8"
|
||||||
derive_more = "0.99"
|
derive_more = "0.99"
|
||||||
libmcaptcha = { branch = "master", git = "https://github.com/mCaptcha/libmcaptcha", features = ["minimal"], default-features = false }
|
libmcaptcha = { version = "0.2.4", tag="0.2.4", git = "https://github.com/mCaptcha/libmcaptcha", features = ["minimal"], default-features = false }
|
||||||
#libmcaptcha = { path = "../libmcaptcha", features = ["minimal"], default-features = false}
|
#libmcaptcha = { path = "../libmcaptcha", features = ["minimal"], default-features = false}
|
||||||
|
|
||||||
#[target.x86_64-unknown-linux-musl]
|
#[target.x86_64-unknown-linux-musl]
|
||||||
#linker = "cc"
|
#linker = "cc"
|
||||||
|
|
||||||
[features]
|
#[features]
|
||||||
test = ["redis-module/test"]
|
#test = ["redis-module/test"]
|
||||||
|
[dev-dependencies]
|
||||||
|
redis-module = { version="2.0.5", features = ["min-redis-compatibility-version-7-2"], default-features=false}
|
||||||
|
|
|
@ -85,7 +85,10 @@ impl Bucket {
|
||||||
|
|
||||||
let bucket_name = bucket_name.unwrap();
|
let bucket_name = bucket_name.unwrap();
|
||||||
|
|
||||||
let bucket = ctx.open_key_writable(&RedisString::create(ctx.ctx, bucket_name));
|
let bucket = ctx.open_key_writable(&RedisString::create_from_slice(
|
||||||
|
ctx.ctx,
|
||||||
|
bucket_name.as_bytes(),
|
||||||
|
));
|
||||||
if bucket.key_type() == KeyType::Empty {
|
if bucket.key_type() == KeyType::Empty {
|
||||||
ctx.log_debug(&format!("Bucket doesn't exist: {}", key_name));
|
ctx.log_debug(&format!("Bucket doesn't exist: {}", key_name));
|
||||||
} else {
|
} else {
|
||||||
|
@ -125,8 +128,10 @@ impl Bucket {
|
||||||
"reading captcha: {} with decr count {}",
|
"reading captcha: {} with decr count {}",
|
||||||
&captcha, count
|
&captcha, count
|
||||||
));
|
));
|
||||||
let stored_captcha =
|
let stored_captcha = ctx.open_key_writable(&RedisString::create_from_slice(
|
||||||
ctx.open_key_writable(&RedisString::create(ctx.ctx, &captcha));
|
ctx.ctx,
|
||||||
|
captcha.as_bytes(),
|
||||||
|
));
|
||||||
if stored_captcha.key_type() == KeyType::Empty {
|
if stored_captcha.key_type() == KeyType::Empty {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
@ -146,24 +151,27 @@ impl Bucket {
|
||||||
// get bucket
|
// get bucket
|
||||||
let bucket_name = get_bucket_name(bucket_instant);
|
let bucket_name = get_bucket_name(bucket_instant);
|
||||||
|
|
||||||
let timer = ctx.open_key_writable(&RedisString::create(
|
let timer = ctx.open_key_writable(&RedisString::create_from_slice(
|
||||||
ctx.ctx,
|
ctx.ctx,
|
||||||
&get_timer_name_from_bucket_name(&bucket_name),
|
get_timer_name_from_bucket_name(&bucket_name).as_bytes(),
|
||||||
));
|
));
|
||||||
let _ = timer.delete();
|
let _ = timer.delete();
|
||||||
|
|
||||||
ctx.log_debug(&format!("Bucket instant: {}", &bucket_instant));
|
ctx.log_debug(&format!("Bucket instant: {}", &bucket_instant));
|
||||||
|
|
||||||
let bucket = ctx.open_key_writable(&RedisString::create(ctx.ctx, &bucket_name));
|
let bucket = ctx.open_key_writable(&RedisString::create_from_slice(
|
||||||
|
ctx.ctx,
|
||||||
|
bucket_name.as_bytes(),
|
||||||
|
));
|
||||||
Bucket::decrement_runner(ctx, &bucket);
|
Bucket::decrement_runner(ctx, &bucket);
|
||||||
|
|
||||||
if let Err(e) = bucket.delete() {
|
if let Err(e) = bucket.delete() {
|
||||||
ctx.log_warning(&format!("enountered error while deleting hashmap: {:?}", e));
|
ctx.log_warning(&format!("enountered error while deleting hashmap: {:?}", e));
|
||||||
}
|
}
|
||||||
|
|
||||||
let timer = ctx.open_key_writable(&RedisString::create(
|
let timer = ctx.open_key_writable(&RedisString::create_from_slice(
|
||||||
ctx.ctx,
|
ctx.ctx,
|
||||||
&get_timer_name_from_bucket_name(&bucket_name),
|
get_timer_name_from_bucket_name(&bucket_name).as_bytes(),
|
||||||
));
|
));
|
||||||
if let Err(e) = timer.delete() {
|
if let Err(e) = timer.delete() {
|
||||||
ctx.log_warning(&format!(
|
ctx.log_warning(&format!(
|
||||||
|
@ -179,7 +187,10 @@ impl Bucket {
|
||||||
let captcha_name = get_captcha_key(&captcha);
|
let captcha_name = get_captcha_key(&captcha);
|
||||||
// ctx.log_debug(&captcha_name);
|
// ctx.log_debug(&captcha_name);
|
||||||
// increment
|
// increment
|
||||||
let captcha = ctx.open_key_writable(&RedisString::create(ctx.ctx, &captcha_name));
|
let captcha = ctx.open_key_writable(&RedisString::create_from_slice(
|
||||||
|
ctx.ctx,
|
||||||
|
captcha_name.as_bytes(),
|
||||||
|
));
|
||||||
ctx.log_debug("loading mcaptcha");
|
ctx.log_debug("loading mcaptcha");
|
||||||
let captcha = MCaptcha::get_mut_mcaptcha(&captcha)?;
|
let captcha = MCaptcha::get_mut_mcaptcha(&captcha)?;
|
||||||
|
|
||||||
|
@ -216,7 +227,10 @@ impl Bucket {
|
||||||
// ctx.log_debug(&format!("Bucket name: {}", &bucket_name));
|
// ctx.log_debug(&format!("Bucket name: {}", &bucket_name));
|
||||||
|
|
||||||
// get bucket
|
// get bucket
|
||||||
let bucket = ctx.open_key_writable(&RedisString::create(ctx.ctx, &bucket_name));
|
let bucket = ctx.open_key_writable(&RedisString::create_from_slice(
|
||||||
|
ctx.ctx,
|
||||||
|
bucket_name.as_bytes(),
|
||||||
|
));
|
||||||
|
|
||||||
match bucket.get_value::<Bucket>(&MCAPTCHA_BUCKET_TYPE)? {
|
match bucket.get_value::<Bucket>(&MCAPTCHA_BUCKET_TYPE)? {
|
||||||
Some(bucket) => match bucket.decrement.get_mut(&captcha_name) {
|
Some(bucket) => match bucket.decrement.get_mut(&captcha_name) {
|
||||||
|
@ -230,9 +244,9 @@ impl Bucket {
|
||||||
let mut counter = Bucket::new(ctx, duration)?;
|
let mut counter = Bucket::new(ctx, duration)?;
|
||||||
counter.decrement.insert(captcha_name, 1);
|
counter.decrement.insert(captcha_name, 1);
|
||||||
bucket.set_value(&MCAPTCHA_BUCKET_TYPE, counter)?;
|
bucket.set_value(&MCAPTCHA_BUCKET_TYPE, counter)?;
|
||||||
let timer = ctx.open_key_writable(&RedisString::create(
|
let timer = ctx.open_key_writable(&RedisString::create_from_slice(
|
||||||
ctx.ctx,
|
ctx.ctx,
|
||||||
&get_timer_name_from_bucket_name(&bucket_name),
|
get_timer_name_from_bucket_name(&bucket_name).as_bytes(),
|
||||||
));
|
));
|
||||||
timer.write("1")?;
|
timer.write("1")?;
|
||||||
timer.set_expire(Duration::from_secs(duration + BUCKET_EXPIRY_OFFSET))?;
|
timer.set_expire(Duration::from_secs(duration + BUCKET_EXPIRY_OFFSET))?;
|
||||||
|
@ -265,16 +279,21 @@ pub static MCAPTCHA_BUCKET_TYPE: RedisType = RedisType::new(
|
||||||
|
|
||||||
// Currently unused by Redis
|
// Currently unused by Redis
|
||||||
mem_usage: None,
|
mem_usage: None,
|
||||||
|
mem_usage2: None,
|
||||||
digest: None,
|
digest: None,
|
||||||
|
|
||||||
// Aux data
|
// Aux data
|
||||||
aux_load: None,
|
aux_load: None,
|
||||||
aux_save: None,
|
aux_save: None,
|
||||||
|
aux_save2: None,
|
||||||
aux_save_triggers: 0,
|
aux_save_triggers: 0,
|
||||||
|
|
||||||
free_effort: None,
|
free_effort: None,
|
||||||
|
free_effort2: None,
|
||||||
unlink: None,
|
unlink: None,
|
||||||
|
unlink2: None,
|
||||||
copy: None,
|
copy: None,
|
||||||
|
copy2: None,
|
||||||
defrag: None,
|
defrag: None,
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|
|
@ -52,7 +52,10 @@ impl Challenge {
|
||||||
|
|
||||||
let challenge_name = get_challenge_name(&captcha, &add_challenge.challenge);
|
let challenge_name = get_challenge_name(&captcha, &add_challenge.challenge);
|
||||||
|
|
||||||
let key = ctx.open_key_writable(&RedisString::create(ctx.ctx, &challenge_name));
|
let key = ctx.open_key_writable(&RedisString::create_from_slice(
|
||||||
|
ctx.ctx,
|
||||||
|
challenge_name.as_bytes(),
|
||||||
|
));
|
||||||
if key.key_type() != KeyType::Empty {
|
if key.key_type() != KeyType::Empty {
|
||||||
return Err(CacheError::DuplicateChallenge.into());
|
return Err(CacheError::DuplicateChallenge.into());
|
||||||
}
|
}
|
||||||
|
@ -71,7 +74,10 @@ impl Challenge {
|
||||||
|
|
||||||
let challenge_name = get_challenge_name(&captcha, &challenge);
|
let challenge_name = get_challenge_name(&captcha, &challenge);
|
||||||
|
|
||||||
let key = ctx.open_key_writable(&RedisString::create(ctx.ctx, &challenge_name));
|
let key = ctx.open_key_writable(&RedisString::create_from_slice(
|
||||||
|
ctx.ctx,
|
||||||
|
challenge_name.as_bytes(),
|
||||||
|
));
|
||||||
if key.key_type() == KeyType::Empty {
|
if key.key_type() == KeyType::Empty {
|
||||||
Err(CacheError::ChallengeNotFound.into())
|
Err(CacheError::ChallengeNotFound.into())
|
||||||
} else {
|
} else {
|
||||||
|
@ -87,7 +93,10 @@ impl Challenge {
|
||||||
|
|
||||||
let challenge_name = get_challenge_name(&captcha, &challenge);
|
let challenge_name = get_challenge_name(&captcha, &challenge);
|
||||||
|
|
||||||
let key = ctx.open_key_writable(&RedisString::create(ctx.ctx, &challenge_name));
|
let key = ctx.open_key_writable(&RedisString::create_from_slice(
|
||||||
|
ctx.ctx,
|
||||||
|
challenge_name.as_bytes(),
|
||||||
|
));
|
||||||
if key.key_type() == KeyType::Empty {
|
if key.key_type() == KeyType::Empty {
|
||||||
return Err(CacheError::ChallengeNotFound.into());
|
return Err(CacheError::ChallengeNotFound.into());
|
||||||
}
|
}
|
||||||
|
@ -114,16 +123,21 @@ pub static MCAPTCHA_CHALLENGE_TYPE: RedisType = RedisType::new(
|
||||||
|
|
||||||
// Currently unused by Redis
|
// Currently unused by Redis
|
||||||
mem_usage: None,
|
mem_usage: None,
|
||||||
|
mem_usage2: None,
|
||||||
digest: None,
|
digest: None,
|
||||||
|
|
||||||
// Aux data
|
// Aux data
|
||||||
aux_load: None,
|
aux_load: None,
|
||||||
aux_save: None,
|
aux_save: None,
|
||||||
|
aux_save2: None,
|
||||||
aux_save_triggers: 0,
|
aux_save_triggers: 0,
|
||||||
|
|
||||||
free_effort: None,
|
free_effort: None,
|
||||||
|
free_effort2: None,
|
||||||
unlink: None,
|
unlink: None,
|
||||||
|
unlink2: None,
|
||||||
copy: None,
|
copy: None,
|
||||||
|
copy2: None,
|
||||||
defrag: None,
|
defrag: None,
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|
25
src/lib.rs
25
src/lib.rs
|
@ -15,11 +15,15 @@
|
||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
use lazy_static::lazy_static;
|
use lazy_static::lazy_static;
|
||||||
use redis_module::NotifyEvent;
|
//use redis_module::{NotifyEvent, key};
|
||||||
use redis_module::{redis_command, redis_event_handler, redis_module};
|
//use redis_module::{redis_command, redis_event_handler, redis_module};
|
||||||
use redis_module::{NextArg, RedisResult};
|
use redis_module::{
|
||||||
|
key, redis_command, redis_event_handler, redis_module, Context, NextArg, NotifyEvent,
|
||||||
|
RedisError, RedisResult, RedisString, RedisValue, Status,
|
||||||
|
};
|
||||||
|
//use redis_module::{NextArg, RedisResult};
|
||||||
//use redis_module::RedisError;
|
//use redis_module::RedisError;
|
||||||
use redis_module::Context;
|
//use redis_module::Context;
|
||||||
|
|
||||||
mod bucket;
|
mod bucket;
|
||||||
mod challenge;
|
mod challenge;
|
||||||
|
@ -64,17 +68,19 @@ lazy_static! {
|
||||||
pub static ref PREFIX_CHALLENGE: String = format!("{}:CHALLENGE", PKG_NAME);
|
pub static ref PREFIX_CHALLENGE: String = format!("{}:CHALLENGE", PKG_NAME);
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn on_delete(ctx: &Context, event_type: NotifyEvent, event: &str, key_name: &str) {
|
pub fn on_delete(ctx: &Context, event_type: NotifyEvent, event: &str, key_name: &[u8]) {
|
||||||
|
let key_name = redis_module::RedisString::create_from_slice(ctx.ctx, key_name);
|
||||||
|
let key_name = key_name.to_string();
|
||||||
let msg = format!(
|
let msg = format!(
|
||||||
"Received event: {:?} on key: {} via event: {}",
|
"Received event: {:?} on key: {} via event: {}",
|
||||||
event_type, key_name, event
|
event_type, key_name, event
|
||||||
);
|
);
|
||||||
ctx.log_debug(msg.as_str());
|
ctx.log_debug(msg.as_str());
|
||||||
|
|
||||||
if utils::is_bucket_timer(key_name) {
|
if utils::is_bucket_timer(&key_name) {
|
||||||
bucket::Bucket::on_delete(ctx, event_type, event, key_name);
|
bucket::Bucket::on_delete(ctx, event_type, event, &key_name);
|
||||||
} else if utils::is_mcaptcha_safety(key_name) {
|
} else if utils::is_mcaptcha_safety(&key_name) {
|
||||||
crate::safety::MCaptchaSafety::on_delete(ctx, event_type, event, key_name);
|
crate::safety::MCaptchaSafety::on_delete(ctx, event_type, event, &key_name);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -85,6 +91,7 @@ pub mod redis {
|
||||||
redis_module! {
|
redis_module! {
|
||||||
name: "mcaptcha_cache",
|
name: "mcaptcha_cache",
|
||||||
version: PKG_VERSION,
|
version: PKG_VERSION,
|
||||||
|
allocator: (redis_module::alloc::RedisAlloc, redis_module::alloc::RedisAlloc),
|
||||||
data_types: [MCAPTCHA_BUCKET_TYPE, MCAPTCHA_MCAPTCHA_TYPE, MCAPTCHA_SAFETY_TYPE, MCAPTCHA_CHALLENGE_TYPE],
|
data_types: [MCAPTCHA_BUCKET_TYPE, MCAPTCHA_MCAPTCHA_TYPE, MCAPTCHA_SAFETY_TYPE, MCAPTCHA_CHALLENGE_TYPE],
|
||||||
commands: [
|
commands: [
|
||||||
["MCAPTCHA_CACHE.ADD_VISITOR", bucket::Bucket::counter_create, "write", 1, 1, 1],
|
["MCAPTCHA_CACHE.ADD_VISITOR", bucket::Bucket::counter_create, "write", 1, 1, 1],
|
||||||
|
|
|
@ -112,7 +112,10 @@ impl MCaptcha {
|
||||||
let key_name = args.next_string()?;
|
let key_name = args.next_string()?;
|
||||||
let key_name = get_captcha_key(&key_name);
|
let key_name = get_captcha_key(&key_name);
|
||||||
|
|
||||||
let stored_captcha = ctx.open_key(&RedisString::create(ctx.ctx, &key_name));
|
let stored_captcha = ctx.open_key(&RedisString::create_from_slice(
|
||||||
|
ctx.ctx,
|
||||||
|
key_name.as_bytes(),
|
||||||
|
));
|
||||||
if stored_captcha.key_type() == KeyType::Empty {
|
if stored_captcha.key_type() == KeyType::Empty {
|
||||||
return CacheError::new(format!("key {} not found", key_name)).into();
|
return CacheError::new(format!("key {} not found", key_name)).into();
|
||||||
}
|
}
|
||||||
|
@ -137,7 +140,10 @@ impl MCaptcha {
|
||||||
#[inline]
|
#[inline]
|
||||||
fn add_captcha_runner(ctx: &Context, key_name: &str, mcaptcha: MCaptcha) -> RedisResult {
|
fn add_captcha_runner(ctx: &Context, key_name: &str, mcaptcha: MCaptcha) -> RedisResult {
|
||||||
let duration = mcaptcha.get_duration();
|
let duration = mcaptcha.get_duration();
|
||||||
let key = ctx.open_key_writable(&RedisString::create(ctx.ctx, key_name));
|
let key = ctx.open_key_writable(&RedisString::create_from_slice(
|
||||||
|
ctx.ctx,
|
||||||
|
key_name.as_bytes(),
|
||||||
|
));
|
||||||
if key.key_type() == KeyType::Empty {
|
if key.key_type() == KeyType::Empty {
|
||||||
key.set_value(&MCAPTCHA_MCAPTCHA_TYPE, mcaptcha)?;
|
key.set_value(&MCAPTCHA_MCAPTCHA_TYPE, mcaptcha)?;
|
||||||
ctx.log_debug(&format!("mcaptcha {} created", key_name));
|
ctx.log_debug(&format!("mcaptcha {} created", key_name));
|
||||||
|
@ -155,7 +161,10 @@ impl MCaptcha {
|
||||||
let mut args = args.into_iter().skip(1);
|
let mut args = args.into_iter().skip(1);
|
||||||
let key_name = get_captcha_key(&args.next_string()?);
|
let key_name = get_captcha_key(&args.next_string()?);
|
||||||
|
|
||||||
let key = ctx.open_key(&RedisString::create(ctx.ctx, &key_name));
|
let key = ctx.open_key(&RedisString::create_from_slice(
|
||||||
|
ctx.ctx,
|
||||||
|
key_name.as_bytes(),
|
||||||
|
));
|
||||||
if Self::captcha_exists_runner(&key) {
|
if Self::captcha_exists_runner(&key) {
|
||||||
Ok(RedisValue::Integer(0))
|
Ok(RedisValue::Integer(0))
|
||||||
} else {
|
} else {
|
||||||
|
@ -175,7 +184,10 @@ impl MCaptcha {
|
||||||
let key_name = get_captcha_key(&args.next_string()?);
|
let key_name = get_captcha_key(&args.next_string()?);
|
||||||
let new_name = get_captcha_key(&args.next_string()?);
|
let new_name = get_captcha_key(&args.next_string()?);
|
||||||
|
|
||||||
let key = ctx.open_key(&RedisString::create(ctx.ctx, &key_name));
|
let key = ctx.open_key(&RedisString::create_from_slice(
|
||||||
|
ctx.ctx,
|
||||||
|
key_name.as_bytes(),
|
||||||
|
));
|
||||||
if Self::captcha_exists_runner(&key) {
|
if Self::captcha_exists_runner(&key) {
|
||||||
if let Some(mcaptcha) = Self::get_mcaptcha(&key)? {
|
if let Some(mcaptcha) = Self::get_mcaptcha(&key)? {
|
||||||
let mcaptcha = MCaptcha {
|
let mcaptcha = MCaptcha {
|
||||||
|
@ -202,7 +214,10 @@ impl MCaptcha {
|
||||||
|
|
||||||
#[inline]
|
#[inline]
|
||||||
fn delete_captcha_runner(ctx: &Context, key_name: &str) -> RedisResult {
|
fn delete_captcha_runner(ctx: &Context, key_name: &str) -> RedisResult {
|
||||||
let key = ctx.open_key_writable(&RedisString::create(ctx.ctx, key_name));
|
let key = ctx.open_key_writable(&RedisString::create_from_slice(
|
||||||
|
ctx.ctx,
|
||||||
|
key_name.as_bytes(),
|
||||||
|
));
|
||||||
if key.key_type() == KeyType::Empty {
|
if key.key_type() == KeyType::Empty {
|
||||||
Err(RedisError::nonexistent_key())
|
Err(RedisError::nonexistent_key())
|
||||||
} else {
|
} else {
|
||||||
|
@ -224,16 +239,21 @@ pub static MCAPTCHA_MCAPTCHA_TYPE: RedisType = RedisType::new(
|
||||||
|
|
||||||
// Currently unused by Redis
|
// Currently unused by Redis
|
||||||
mem_usage: None,
|
mem_usage: None,
|
||||||
|
mem_usage2: None,
|
||||||
digest: None,
|
digest: None,
|
||||||
|
|
||||||
// Aux data
|
// Aux data
|
||||||
aux_load: None,
|
aux_load: None,
|
||||||
aux_save: None,
|
aux_save: None,
|
||||||
|
aux_save2: None,
|
||||||
aux_save_triggers: 0,
|
aux_save_triggers: 0,
|
||||||
|
|
||||||
free_effort: None,
|
free_effort: None,
|
||||||
|
free_effort2: None,
|
||||||
unlink: None,
|
unlink: None,
|
||||||
|
unlink2: None,
|
||||||
copy: None,
|
copy: None,
|
||||||
|
copy2: None,
|
||||||
defrag: None,
|
defrag: None,
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|
|
@ -48,7 +48,10 @@ impl MCaptchaSafety {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
let mcaptcha_name = mcaptcha_name.unwrap();
|
let mcaptcha_name = mcaptcha_name.unwrap();
|
||||||
let mcaptcha = ctx.open_key(&RedisString::create(ctx.ctx, mcaptcha_name));
|
let mcaptcha = ctx.open_key(&RedisString::create_from_slice(
|
||||||
|
ctx.ctx,
|
||||||
|
mcaptcha_name.as_bytes(),
|
||||||
|
));
|
||||||
if mcaptcha.key_type() == KeyType::Empty {
|
if mcaptcha.key_type() == KeyType::Empty {
|
||||||
ctx.log_warning(&format!("mcaptcha {} is empty", mcaptcha_name));
|
ctx.log_warning(&format!("mcaptcha {} is empty", mcaptcha_name));
|
||||||
return;
|
return;
|
||||||
|
@ -101,7 +104,10 @@ impl MCaptchaSafety {
|
||||||
#[allow(clippy::new_ret_no_self)]
|
#[allow(clippy::new_ret_no_self)]
|
||||||
pub fn new(ctx: &Context, duration: u64, mcaptcha_name: &str) -> CacheResult<()> {
|
pub fn new(ctx: &Context, duration: u64, mcaptcha_name: &str) -> CacheResult<()> {
|
||||||
let safety_name = get_safety_name(mcaptcha_name);
|
let safety_name = get_safety_name(mcaptcha_name);
|
||||||
let safety = ctx.open_key_writable(&RedisString::create(ctx.ctx, &safety_name));
|
let safety = ctx.open_key_writable(&RedisString::create_from_slice(
|
||||||
|
ctx.ctx,
|
||||||
|
safety_name.as_bytes(),
|
||||||
|
));
|
||||||
|
|
||||||
if safety.key_type() == KeyType::Empty {
|
if safety.key_type() == KeyType::Empty {
|
||||||
let safety_val = MCaptchaSafety {};
|
let safety_val = MCaptchaSafety {};
|
||||||
|
@ -130,7 +136,10 @@ impl MCaptchaSafety {
|
||||||
|
|
||||||
/// executes when timer goes off. Refreshes expiry timer and resets timer
|
/// executes when timer goes off. Refreshes expiry timer and resets timer
|
||||||
fn boost(ctx: &Context, (safety_name, duration): (String, u64)) {
|
fn boost(ctx: &Context, (safety_name, duration): (String, u64)) {
|
||||||
let safety = ctx.open_key_writable(&RedisString::create(ctx.ctx, &safety_name));
|
let safety = ctx.open_key_writable(&RedisString::create_from_slice(
|
||||||
|
ctx.ctx,
|
||||||
|
safety_name.as_bytes(),
|
||||||
|
));
|
||||||
|
|
||||||
// if safety is available in cache then refresh timer
|
// if safety is available in cache then refresh timer
|
||||||
if let Ok(Some(_safety_val)) = safety.get_value::<Self>(&MCAPTCHA_SAFETY_TYPE) {
|
if let Ok(Some(_safety_val)) = safety.get_value::<Self>(&MCAPTCHA_SAFETY_TYPE) {
|
||||||
|
@ -149,7 +158,10 @@ impl MCaptchaSafety {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
let mcaptcha_name = mcaptcha_name.unwrap();
|
let mcaptcha_name = mcaptcha_name.unwrap();
|
||||||
let mcaptcha = ctx.open_key(&RedisString::create(ctx.ctx, mcaptcha_name));
|
let mcaptcha = ctx.open_key(&RedisString::create_from_slice(
|
||||||
|
ctx.ctx,
|
||||||
|
mcaptcha_name.as_bytes(),
|
||||||
|
));
|
||||||
if mcaptcha.key_type() == KeyType::Empty {
|
if mcaptcha.key_type() == KeyType::Empty {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -180,16 +192,21 @@ pub static MCAPTCHA_SAFETY_TYPE: RedisType = RedisType::new(
|
||||||
|
|
||||||
// Currently unused by Redis
|
// Currently unused by Redis
|
||||||
mem_usage: None,
|
mem_usage: None,
|
||||||
|
mem_usage2: None,
|
||||||
digest: None,
|
digest: None,
|
||||||
|
|
||||||
// Aux data
|
// Aux data
|
||||||
aux_load: None,
|
aux_load: None,
|
||||||
aux_save: None,
|
aux_save: None,
|
||||||
|
aux_save2: None,
|
||||||
aux_save_triggers: 0,
|
aux_save_triggers: 0,
|
||||||
|
|
||||||
free_effort: None,
|
free_effort: None,
|
||||||
|
free_effort2: None,
|
||||||
unlink: None,
|
unlink: None,
|
||||||
|
unlink2: None,
|
||||||
copy: None,
|
copy: None,
|
||||||
|
copy2: None,
|
||||||
defrag: None,
|
defrag: None,
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|
Loading…
Reference in a new issue