-
-
Notifications
You must be signed in to change notification settings - Fork 78
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* upgrade async-std to 1.6 beta * add ip feature * add glob feature * add cacehd feature * fix runtime-tokio clippy warnings * add watcher feature * don't clone if watcher feature has been disabled * use async-rs/async-std#768 for fixing tests * activate all features for bench test over previous version * benchmark pull_request and decrease the threshold * switch to github actions * fix typo * Fix: cargo test features doesn't like space * better management of feature:logging and feature:watcher * use async-std/master for testing * add basic wasm32 support * use runtime-async-std for wasm32 test * fix clippy warnings * fix typo * make other tests avalaible only on no-wasm32 target * finish split code into features && bump version
- Loading branch information
Showing
23 changed files
with
892 additions
and
280 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
name: CI | ||
|
||
on: | ||
pull_request: | ||
push: | ||
branches: | ||
- master | ||
|
||
jobs: | ||
build: | ||
name: Auto Build CI | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout Repository | ||
uses: actions/checkout@master | ||
|
||
- name: Install Rust toolchain | ||
uses: actions-rs/toolchain@v1 | ||
with: | ||
profile: minimal | ||
toolchain: stable | ||
components: rustfmt, clippy | ||
override: true | ||
|
||
- name: Install Dependencies | ||
run: sudo apt-get install libssl-dev | ||
|
||
- name: Cargo Clean | ||
uses: actions-rs/cargo@v1 | ||
with: | ||
command: clean | ||
|
||
- name: Cargo Build | ||
uses: actions-rs/cargo@v1 | ||
with: | ||
command: build | ||
|
||
# Todo: https://github.com/rust-lang/cargo/issues/2980 | ||
- name: Cargo Test For All Features Using async-std | ||
uses: actions-rs/cargo@v1 | ||
with: | ||
command: test | ||
args: --no-default-features --features runtime-async-std,cached,glob,ip,watcher,logging | ||
|
||
- name: Cargo Test For All Features Using tokio | ||
uses: actions-rs/cargo@v1 | ||
with: | ||
command: test | ||
args: --no-default-features --features runtime-tokio,cached,glob,ip,watcher,logging | ||
|
||
- name: Cargo Check Wasm | ||
uses: actions-rs/cargo@v1 | ||
with: | ||
command: check | ||
target: wasm32-unknown-unknown | ||
override: true | ||
args: --no-default-features --features runtime-async-std,cached,glob,ip,watcher,logging | ||
|
||
- name: Cargo Clippy | ||
uses: actions-rs/cargo@v1 | ||
with: | ||
command: clippy | ||
args: -- -D warnings | ||
|
||
- name: Cargo Fmt Check | ||
uses: actions-rs/cargo@v1 | ||
with: | ||
command: fmt | ||
args: --all -- --check |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
name: Coverage | ||
|
||
on: | ||
pull_request: | ||
push: | ||
branches: | ||
- master | ||
|
||
jobs: | ||
cover: | ||
name: Auto Codecov Coverage | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout Repository | ||
uses: actions/checkout@master | ||
|
||
- name: Install Rust toolchain | ||
uses: actions-rs/toolchain@v1 | ||
with: | ||
profile: minimal | ||
toolchain: stable | ||
override: true | ||
|
||
- name: Run cargo-tarpaulin | ||
uses: actions-rs/[email protected] | ||
with: | ||
args: --out Xml | ||
|
||
- name: Upload to codecov.io | ||
uses: codecov/codecov-action@v1 | ||
with: | ||
token: ${{secrets.CODECOV_TOKEN}} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
[package] | ||
name = "casbin" | ||
version = "0.7.1" | ||
version = "0.7.2" | ||
authors = ["Joey <[email protected]>", "Cheng JIANG <[email protected]>"] | ||
edition = "2018" | ||
license = "Apache-2.0" | ||
|
@@ -15,27 +15,34 @@ keywords = ["auth", "authorization", "rbac", "acl", "abac"] | |
[dependencies] | ||
regex = "1.3.1" | ||
rhai = { version = "0.13.0", default-features = false, features = ["sync", "only_i32", "no_function", "no_float"] } | ||
ip_network = "0.3.4" | ||
ttl_cache = "0.5.1" | ||
ip_network = { version = "0.3.4", optional = true } | ||
ttl_cache = { version = "0.5.1", optional = true } | ||
lazy_static = "1.4.0" | ||
indexmap = "1.3.1" | ||
async-std = { version = "1.5.0", optional = true } | ||
async-trait = "0.1.24" | ||
log = { version = "0.4.8", optional = true } | ||
tokio = { version = "0.2.11", optional = true, default-features = false } | ||
globset = "0.4.5" | ||
globset = { version = "0.4.5", optional = true } | ||
thiserror = "1.0.14" | ||
|
||
[features] | ||
default = ["runtime-async-std"] | ||
|
||
runtime-tokio = ["tokio/fs", "tokio/io-util", "tokio/stream", "tokio/rt-threaded", "tokio/blocking"] | ||
runtime-tokio = ["tokio/fs", "tokio/io-util"] | ||
runtime-async-std = ["async-std"] | ||
logging = ["log"] | ||
ip = ["ip_network"] | ||
glob = ["globset"] | ||
cached = ["ttl_cache"] | ||
watcher = [] | ||
|
||
[profile.release.build-override] | ||
opt-level = 0 | ||
|
||
[dev-dependencies] | ||
[target.'cfg(target_arch = "wasm32")'.dev-dependencies] | ||
async-std = { version = "1.5.0", features = [ "attributes" ] } | ||
|
||
[target.'cfg(not(target_arch = "wasm32"))'.dev-dependencies] | ||
tokio = { version = "0.2.11", features = [ "full" ] } | ||
async-std = { version = "1.5.0", features = [ "attributes" ] } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
23af2bf
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rust Benchmark
b_benchmark_abac_model
6770
ns/iter (± 919
)6978
ns/iter (± 1313
)0.97
b_benchmark_basic_model
7086
ns/iter (± 999
)7023
ns/iter (± 1190
)1.01
b_benchmark_key_match
23709
ns/iter (± 3191
)25305
ns/iter (± 3271
)0.94
b_benchmark_priority_model
8425
ns/iter (± 1024
)8981
ns/iter (± 1303
)0.94
b_benchmark_raw
8
ns/iter (± 1
)8
ns/iter (± 1
)1
b_benchmark_rbac_model
20621
ns/iter (± 2827
)22176
ns/iter (± 2143
)0.93
b_benchmark_rbac_model_large
61145960
ns/iter (± 6755344
)66588398
ns/iter (± 4405553
)0.92
b_benchmark_rbac_model_medium
5889772
ns/iter (± 1155067
)6128903
ns/iter (± 865542
)0.96
b_benchmark_rbac_model_small
579908
ns/iter (± 86440
)638322
ns/iter (± 60206
)0.91
b_benchmark_rbac_model_with_domains
12167
ns/iter (± 2039
)12799
ns/iter (± 1465
)0.95
b_benchmark_rbac_with_deny
34374
ns/iter (± 5191
)37412
ns/iter (± 8135
)0.92
b_benchmark_rbac_with_resource_roles
9377
ns/iter (± 1428
)9790
ns/iter (± 879
)0.96
This comment was automatically generated by workflow using github-action-benchmark.