1
0
mirror of https://github.com/actix/examples synced 2024-11-30 09:12:54 +01:00

Fix casbin example for actix-web v3 (#467)

This commit is contained in:
Christian Beier 2022-01-04 12:41:17 +01:00 committed by GitHub
parent 06ffe40945
commit 16447351c1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 32 additions and 41 deletions

66
Cargo.lock generated
View File

@ -55,6 +55,8 @@ dependencies = [
"actix-web 3.3.2", "actix-web 3.3.2",
"casbin", "casbin",
"loge", "loge",
"rhai",
"rhai_codegen",
] ]
[[package]] [[package]]
@ -240,7 +242,7 @@ dependencies = [
"actix-service 2.0.0", "actix-service 2.0.0",
"actix-tls 3.0.0-beta.5", "actix-tls 3.0.0-beta.5",
"actix-utils 3.0.0", "actix-utils 3.0.0",
"ahash", "ahash 0.7.4",
"base64 0.13.0", "base64 0.13.0",
"bitflags", "bitflags",
"brotli2", "brotli2",
@ -658,7 +660,7 @@ dependencies = [
"actix-service 2.0.0", "actix-service 2.0.0",
"actix-utils 3.0.0", "actix-utils 3.0.0",
"actix-web-codegen 0.5.0-beta.4", "actix-web-codegen 0.5.0-beta.4",
"ahash", "ahash 0.7.4",
"bytes 1.1.0", "bytes 1.1.0",
"cfg-if 1.0.0", "cfg-if 1.0.0",
"cookie 0.15.1", "cookie 0.15.1",
@ -828,6 +830,17 @@ dependencies = [
"opaque-debug 0.3.0", "opaque-debug 0.3.0",
] ]
[[package]]
name = "ahash"
version = "0.6.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "796540673305a66d127804eef19ad696f1f204b8c1025aaca4958c17eab32877"
dependencies = [
"getrandom 0.2.3",
"once_cell",
"version_check 0.9.3",
]
[[package]] [[package]]
name = "ahash" name = "ahash"
version = "0.7.4" version = "0.7.4"
@ -1601,7 +1614,7 @@ version = "2.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1dcc15cd0b9aff8e8326561dcf0bb6e56d0e559f3a4897f615b4a5075ab54c46" checksum = "1dcc15cd0b9aff8e8326561dcf0bb6e56d0e559f3a4897f615b4a5075ab54c46"
dependencies = [ dependencies = [
"ahash", "ahash 0.7.4",
"base64 0.13.0", "base64 0.13.0",
"chrono", "chrono",
"hex", "hex",
@ -1739,19 +1752,18 @@ checksum = "631ae5198c9be5e753e5cc215e1bd73c2b466a3565173db433f52bb9d3e66dba"
[[package]] [[package]]
name = "casbin" name = "casbin"
version = "2.0.9" 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 = "e3be2866a3a3174b9d31a11d9f9ef219ab84a444d107981c51bf79d7be221adc" checksum = "f19b7973e30bea3de9b47e425fb256375f71b8359c7402c624d697e38ea8fea0"
dependencies = [ dependencies = [
"async-std",
"async-trait", "async-trait",
"indexmap",
"lazy_static", "lazy_static",
"parking_lot",
"regex", "regex",
"rhai", "rhai",
"ritelinked",
"serde 1.0.130", "serde 1.0.130",
"thiserror", "thiserror",
"tokio 1.12.0",
] ]
[[package]] [[package]]
@ -2308,7 +2320,6 @@ dependencies = [
"env_logger 0.8.4", "env_logger 0.8.4",
"failure", "failure",
"futures", "futures",
"r2d2",
"serde 1.0.130", "serde 1.0.130",
"serde_json", "serde_json",
"uuid", "uuid",
@ -3025,9 +3036,6 @@ name = "hashbrown"
version = "0.11.2" version = "0.11.2"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ab5ef0d4909ef3724cc8cce6ccc8572c5c817592e9285f5464f8e86f8bd3726e" checksum = "ab5ef0d4909ef3724cc8cce6ccc8572c5c817592e9285f5464f8e86f8bd3726e"
dependencies = [
"ahash",
]
[[package]] [[package]]
name = "heck" name = "heck"
@ -3961,18 +3969,6 @@ dependencies = [
"version_check 0.9.3", "version_check 0.9.3",
] ]
[[package]]
name = "multipart-async-std-example"
version = "0.3.0"
dependencies = [
"actix-multipart",
"actix-web 3.3.2",
"async-std",
"futures-util",
"sanitize-filename",
"uuid",
]
[[package]] [[package]]
name = "multipart-example" name = "multipart-example"
version = "0.3.0" version = "0.3.0"
@ -4995,24 +4991,23 @@ dependencies = [
[[package]] [[package]]
name = "rhai" name = "rhai"
version = "1.0.6" version = "0.19.14"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1a2bb3d4236f1aac51ab8f1dccbe7e1c32ce2369ba5b3729affa1e65787a72d7" checksum = "309d2e139896eccb9487d8ddc4147dc98062a54d52916d0d638b100de8b1fcac"
dependencies = [ dependencies = [
"ahash", "ahash 0.6.3",
"instant", "instant",
"num-traits 0.2.14", "num-traits 0.2.14",
"rhai_codegen", "rhai_codegen",
"serde 1.0.130", "serde 1.0.130",
"smallvec", "smallvec",
"smartstring",
] ]
[[package]] [[package]]
name = "rhai_codegen" name = "rhai_codegen"
version = "1.0.0" version = "0.3.3"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4a340b02636b22e61d94ee53e6bcc2d01d339958766b2003b860d178ccf5ae5e" checksum = "16f2da2116fb882e3977223ab21acb2176bdc995a794aff3c727e6491476c0ef"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
@ -5034,16 +5029,6 @@ dependencies = [
"winapi 0.3.9", "winapi 0.3.9",
] ]
[[package]]
name = "ritelinked"
version = "0.3.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "98f2771d255fd99f0294f13249fecd0cae6e074f86b4197ec1f1689d537b44d3"
dependencies = [
"ahash",
"hashbrown",
]
[[package]] [[package]]
name = "run-in-thread" name = "run-in-thread"
version = "2.0.0" version = "2.0.0"
@ -6033,6 +6018,7 @@ version = "2.0.0"
dependencies = [ dependencies = [
"actix-web 3.3.2", "actix-web 3.3.2",
"askama", "askama",
"env_logger 0.8.4",
] ]
[[package]] [[package]]

View File

@ -6,5 +6,10 @@ edition = "2018"
[dependencies] [dependencies]
actix-web = "3" actix-web = "3"
casbin = "2" # from v2.0.6 on casbin only supports tokio 1 which conflicts with actix-web 3,
# see see https://github.com/casbin/casbin-rs#installation
casbin = "=2.0.5"
# these rhai deps are needed for casbin v2.0.5
rhai = "=0.19.14"
rhai_codegen = "=0.3.3"
loge = {version = "0.4", default-features = false, features = ["colored", "chrono"]} loge = {version = "0.4", default-features = false, features = ["colored", "chrono"]}