Skip to content

Commit

Permalink
Merge pull request #42 from hackerchai/master
Browse files Browse the repository at this point in the history
Feat: bump version 0.7.1
  • Loading branch information
hackerchai authored Jun 30, 2020
2 parents b4a9f73 + 7b3c16a commit 3f8e2d5
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 40 deletions.
22 changes: 11 additions & 11 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
[package]
name = "diesel-adapter"
version = "0.7.0"
version = "0.7.1"
authors = ["Cheng JIANG <[email protected]>"]
edition = "2018"
license = "Apache-2.0"
description = "Diesel adapter for casbin-rs"
homepage="https://github.com/casbin-rs/diesel-adapter"
readme="README.md"
homepage= "https://github.com/casbin-rs/diesel-adapter"
readme= "README.md"

[dependencies]
casbin = { version = "0.9.2", default-features = false, features = ["incremental"] }
diesel = { version = "1.4.4", features = ["r2d2"] }
async-trait = "0.1.30"
futures = "0.3.4"
tokio = { version = "0.2.20", default-features = false, optional = true }
async-std = { version = "1.5.0", default-features = false, optional = true }
casbin = { version = "1.0.0", default-features = false, features = ["incremental"] }
diesel = { version = "1.4.5", features = ["r2d2"] }
async-trait = "0.1.36"
futures = "0.3.5"
tokio = { version = "0.2.21", default-features = false, optional = true }
async-std = { version = "1.6.2", default-features = false, optional = true }
dotenv = { version = "0.15.0", default-features = false }

[features]
Expand All @@ -27,6 +27,6 @@ runtime-tokio = ["casbin/runtime-tokio", "tokio/blocking", "tokio/rt-core"]
runtime-async-std = ["casbin/runtime-async-std", "async-std/unstable"]

[dev-dependencies]
async-std = { version = "1.5.0", features = [ "attributes", "unstable"] }
tokio = { version = "0.2.20", features = [ "full" ] }
async-std = { version = "1.6.2", features = [ "attributes", "unstable"] }
tokio = { version = "0.2.21", features = [ "full" ] }

4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ Based on [Diesel](https://github.com/diesel-rs/diesel), The current supported da
Add it to `Cargo.toml`

```
diesel-adapter = { version = "0.7.0", features = ["postgres"] }
async-std = "1.5.0"
diesel-adapter = { version = "0.7.1", features = ["postgres"] }
async-std = "1.6.2"
```

## Configure
Expand Down
30 changes: 6 additions & 24 deletions src/adapter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -598,29 +598,11 @@ mod tests {
};

e.load_filtered_policy(filter).await.unwrap();
assert!(e
.enforce(&["alice", "domain1", "data1", "read"])
.await
.unwrap());
assert!(e
.enforce(&["alice", "domain1", "data1", "write"])
.await
.unwrap());
assert!(!e
.enforce(&["alice", "domain1", "data2", "read"])
.await
.unwrap());
assert!(!e
.enforce(&["alice", "domain1", "data2", "write"])
.await
.unwrap());
assert!(!e
.enforce(&["bob", "domain2", "data2", "read"])
.await
.unwrap());
assert!(!e
.enforce(&["bob", "domain2", "data2", "write"])
.await
.unwrap());
assert!(e.enforce(&["alice", "domain1", "data1", "read"]).unwrap());
assert!(e.enforce(&["alice", "domain1", "data1", "write"]).unwrap());
assert!(!e.enforce(&["alice", "domain1", "data2", "read"]).unwrap());
assert!(!e.enforce(&["alice", "domain1", "data2", "write"]).unwrap());
assert!(!e.enforce(&["bob", "domain2", "data2", "read"]).unwrap());
assert!(!e.enforce(&["bob", "domain2", "data2", "write"]).unwrap());
}
}
3 changes: 0 additions & 3 deletions test.env

This file was deleted.

0 comments on commit 3f8e2d5

Please sign in to comment.