Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feta: bump version 0.4.0 #17

Merged
merged 2 commits into from
Aug 31, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "actix-casbin-auth"
version = "0.3.2"
version = "0.4.0"
authors = ["Eason Chai <[email protected]>","Cheng JIANG <[email protected]>"]
edition = "2018"
license = "Apache-2.0"
Expand All @@ -13,7 +13,7 @@ name = "actix_casbin_auth"
path = "src/lib.rs"

[dependencies]
casbin = { version = "1.1.3", default-features = false, features = ["incremental", "cached"] }
casbin = { version = "2.0.1", default-features = false, features = ["incremental", "cached"] }
tokio = { version = "0.2.22", default-features = false, optional = true }
async-std = { version = "1.6.3", default-features = false, optional = true }
actix-web = "2.0.0"
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
Add it to `Cargo.toml`

```rust
actix-casbin-auth = "0.3.2"
actix-casbin-auth = "0.4.0"
actix-rt = "1.1.1"
actix-web = "2.0.0"
```
Expand Down
8 changes: 4 additions & 4 deletions src/middleware.rs
Original file line number Diff line number Diff line change
Expand Up @@ -119,12 +119,12 @@ where
return Ok(req.into_response(HttpResponse::Unauthorized().finish().into_body()))
}
};
let subject = &vals.subject;
let subject = vals.subject.clone();

if !vals.subject.is_empty() {
if let Some(domain) = &vals.domain {
if let Some(domain) = vals.domain {
let lock = cloned_enforcer.write().await;
match lock.enforce(&[subject, domain, &path, &action]) {
match lock.enforce(vec![subject, domain, path, action]) {
Ok(true) => {
drop(lock);
srv.call(req).await
Expand All @@ -140,7 +140,7 @@ where
}
} else {
let lock = cloned_enforcer.write().await;
match lock.enforce(&[subject, &path, &action]) {
match lock.enforce(vec![subject, path, action]) {
Ok(true) => {
drop(lock);
srv.call(req).await
Expand Down