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

feat: add new_filtered_adapter() to FileAdapter to make it act as a FilterAdapter. #319

Merged
merged 2 commits into from
Dec 1, 2023

Conversation

HGZ-20
Copy link
Contributor

@HGZ-20 HGZ-20 commented Nov 30, 2023

fix: #304

add new_filtered_adapter() to FileAdapter to make it act as a FilterAdapter.

And does not automatically load the policy when using the filter adapter.

…ilterAdapter.

fix: casbin#304

add new_filtered_adapter() to FileAdapter to make it act as a FilterAdapter.

And does not automatically load the policy when using the filter adapter.
Copy link

Benchmark for 49f090e

Click to view benchmark
Test PR Benchmark Master Benchmark %
b_benchmark_rbac_model_large 11.3±0.67ms 11.2±0.15ms +0.89%
benchmark priority model 4.9±0.14µs 4.9±0.09µs 0.00%
benchmark_abac_model 2.7±0.06µs 3.0±0.03µs -10.00%
benchmark_basic_model 4.3±0.07µs 4.3±0.05µs 0.00%
benchmark_key_match 8.2±0.17µs 8.2±0.10µs 0.00%
benchmark_raw 0.0±0.00ns 0.0±0.00ns NaN%
benchmark_rbac_model 7.1±0.22µs 7.1±0.19µs 0.00%
benchmark_rbac_model_medium 953.8±11.35µs 963.3±9.19µs -0.99%
benchmark_rbac_model_with_domains 7.0±0.14µs 7.1±0.07µs -1.41%
benchmark_rbac_with_deny 9.8±0.16µs 9.9±0.18µs -1.01%
benchmark_rbac_with_resource_roles 5.2±0.10µs 5.3±0.06µs -1.89%
benchmark_role_manager_large 4.6±0.03ms 4.7±0.19ms -2.13%
benchmark_role_manager_medium 317.1±9.40µs 315.1±2.59µs +0.63%
benchmark_role_manager_small 97.4±1.13µs 97.8±2.00µs -0.41%

Copy link

codecov bot commented Dec 1, 2023

Codecov Report

Attention: 1 lines in your changes are missing coverage. Please review.

Comparison is base (49f090e) 63.79% compared to head (023e525) 64.11%.

Files Patch % Lines
src/adapter/null_adapter.rs 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #319      +/-   ##
==========================================
+ Coverage   63.79%   64.11%   +0.32%     
==========================================
  Files          24       24              
  Lines        1878     1881       +3     
==========================================
+ Hits         1198     1206       +8     
+ Misses        680      675       -5     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

…ilterAdapter.

fix: casbin#304

add new_filtered_adapter() to FileAdapter to make it act as a FilterAdapter.

And does not automatically load the policy when using the filter adapter.
Copy link

github-actions bot commented Dec 1, 2023

Benchmark for 49f090e

Click to view benchmark
Test PR Benchmark Master Benchmark %
b_benchmark_rbac_model_large 10.2±0.14ms 10.3±0.28ms -0.97%
benchmark priority model 4.9±0.07µs 5.0±0.05µs -2.00%
benchmark_abac_model 2.6±0.07µs 2.6±0.13µs 0.00%
benchmark_basic_model 4.4±0.08µs 4.3±0.06µs +2.33%
benchmark_key_match 8.1±0.15µs 8.5±0.24µs -4.71%
benchmark_raw 0.0±0.00ns 0.0±0.00ns NaN%
benchmark_rbac_model 7.3±0.09µs 7.2±0.19µs +1.39%
benchmark_rbac_model_medium 872.5±12.88µs 872.8±13.83µs -0.03%
benchmark_rbac_model_with_domains 7.1±0.28µs 7.4±0.46µs -4.05%
benchmark_rbac_with_deny 9.8±0.13µs 9.6±0.16µs +2.08%
benchmark_rbac_with_resource_roles 5.3±0.07µs 5.3±0.10µs 0.00%
benchmark_role_manager_large 4.8±0.03ms 4.7±0.04ms +2.13%
benchmark_role_manager_medium 327.5±3.72µs 322.2±3.17µs +1.64%
benchmark_role_manager_small 88.4±1.41µs 88.0±1.65µs +0.45%

@hsluoyz hsluoyz merged commit 7d909e8 into casbin:master Dec 1, 2023
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Enforcer shouldn't load full policy when loading a filtered adapter
2 participants