casbin / casbin-rs

An authorization library that supports access control models like ACL, RBAC, ABAC in Rust.
https://casbin.org
Apache License 2.0
828 stars 67 forks source link

feat: replace `ritelinked` with `hashlink` #327

Closed ChosunOne closed 7 months ago

ChosunOne commented 7 months ago

Replaces the dependency on ritelinked with the more popular and maintained hashlink (of which ritelinked was originally just a fork of). Also removes the amortized feature since that applied exclusively to ritelinked.

Closes #326

CLAassistant commented 7 months ago

CLA assistant check
All committers have signed the CLA.

github-actions[bot] commented 7 months ago

Benchmark for 4884cd2

Click to view benchmark | Test | PR Benchmark | Master Benchmark | % | |------|--------------|------------------|---| | b_benchmark_rbac_model_large | **9.9±0.10ms** | 10.1±0.05ms | **-1.98%** | | benchmark priority model | **4.6±0.09µs** | 4.8±0.06µs | **-4.17%** | | benchmark_abac_model | 2.5±0.03µs | 2.5±0.02µs | 0.00% | | benchmark_basic_model | **4.2±0.06µs** | 4.3±0.06µs | **-2.33%** | | benchmark_key_match | 8.0±0.10µs | **7.8±0.06µs** | **+2.56%** | | benchmark_raw | 0.0±0.00ns | 0.0±0.00ns | NaN% | | benchmark_rbac_model | 7.0±0.29µs | 7.0±0.06µs | 0.00% | | benchmark_rbac_model_medium | 830.3±17.26µs | 823.4±12.04µs | +0.84% | | benchmark_rbac_model_with_domains | 6.7±0.13µs | **6.6±0.10µs** | **+1.52%** | | benchmark_rbac_with_deny | 9.3±0.75µs | 9.3±0.14µs | 0.00% | | benchmark_rbac_with_resource_roles | **4.9±0.12µs** | 5.0±0.04µs | **-2.00%** | | benchmark_role_manager_large | 4.6±0.03ms | 4.6±0.02ms | 0.00% | | benchmark_role_manager_medium | 304.1±4.00µs | 306.3±2.98µs | -0.72% | | benchmark_role_manager_small | **85.5±1.45µs** | 89.0±0.88µs | **-3.93%** |
github-actions[bot] commented 7 months ago

Benchmark for 4884cd2

Click to view benchmark | Test | PR Benchmark | Master Benchmark | % | |------|--------------|------------------|---| | b_benchmark_rbac_model_large | **9.8±0.09ms** | 10.1±0.04ms | **-2.97%** | | benchmark priority model | **4.6±0.09µs** | 5.1±0.09µs | **-9.80%** | | benchmark_abac_model | **2.4±0.04µs** | 2.6±0.04µs | **-7.69%** | | benchmark_basic_model | **4.1±0.07µs** | 4.2±0.06µs | **-2.38%** | | benchmark_key_match | **7.8±0.07µs** | 8.1±0.11µs | **-3.70%** | | benchmark_raw | 0.0±0.00ns | 0.0±0.00ns | NaN% | | benchmark_rbac_model | **6.8±0.08µs** | 7.0±0.10µs | **-2.86%** | | benchmark_rbac_model_medium | **803.6±27.38µs** | 844.1±12.52µs | **-4.80%** | | benchmark_rbac_model_with_domains | **6.7±0.12µs** | 7.0±0.10µs | **-4.29%** | | benchmark_rbac_with_deny | **9.2±0.09µs** | 9.4±0.24µs | **-2.13%** | | benchmark_rbac_with_resource_roles | **4.8±0.05µs** | 5.1±0.07µs | **-5.88%** | | benchmark_role_manager_large | 4.6±0.01ms | 4.6±0.02ms | 0.00% | | benchmark_role_manager_medium | **303.5±8.43µs** | 315.7±58.75µs | **-3.86%** | | benchmark_role_manager_small | 29.7±0.54µs | 29.6±0.58µs | +0.34% |
hsluoyz commented 7 months ago

@ChosunOne plz fix CI

image

codecov[bot] commented 7 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Comparison is base (4884cd2) 64.11% compared to head (7306c14) 64.01%.

:exclamation: Current head 7306c14 differs from pull request most recent head a9cb66c. Consider uploading reports for the commit a9cb66c to get more accurate results

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #327 +/- ## ========================================== - Coverage 64.11% 64.01% -0.10% ========================================== Files 24 24 Lines 1878 1876 -2 ========================================== - Hits 1204 1201 -3 - Misses 674 675 +1 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

github-actions[bot] commented 7 months ago

Benchmark for 4884cd2

Click to view benchmark | Test | PR Benchmark | Master Benchmark | % | |------|--------------|------------------|---| | b_benchmark_rbac_model_large | 11.1±0.09ms | **9.9±0.17ms** | **+12.12%** | | benchmark priority model | 4.7±0.08µs | 4.7±0.06µs | 0.00% | | benchmark_abac_model | 2.5±0.04µs | 2.5±0.04µs | 0.00% | | benchmark_basic_model | 4.2±0.08µs | 4.2±0.03µs | 0.00% | | benchmark_key_match | 7.9±0.17µs | 7.9±0.13µs | 0.00% | | benchmark_raw | 0.0±0.00ns | 0.0±0.00ns | NaN% | | benchmark_rbac_model | **6.9±0.14µs** | 7.1±0.87µs | **-2.82%** | | benchmark_rbac_model_medium | 969.4±11.66µs | **873.2±9.58µs** | **+11.02%** | | benchmark_rbac_model_with_domains | 6.7±0.15µs | 6.8±0.11µs | -1.47% | | benchmark_rbac_with_deny | 9.5±0.17µs | **9.3±0.16µs** | **+2.15%** | | benchmark_rbac_with_resource_roles | 4.8±0.09µs | 4.8±0.04µs | 0.00% | | benchmark_role_manager_large | 4.6±0.02ms | 4.6±0.03ms | 0.00% | | benchmark_role_manager_medium | **304.2±4.65µs** | 311.5±7.53µs | **-2.34%** | | benchmark_role_manager_small | 101.4±3.95µs | **87.4±0.98µs** | **+16.02%** |
github-actions[bot] commented 7 months ago

Benchmark for 4884cd2

Click to view benchmark | Test | PR Benchmark | Master Benchmark | % | |------|--------------|------------------|---| | b_benchmark_rbac_model_large | 11.0±0.33ms | **10.8±0.04ms** | **+1.85%** | | benchmark priority model | **4.7±0.08µs** | 5.0±0.06µs | **-6.00%** | | benchmark_abac_model | **2.5±0.04µs** | 2.6±0.05µs | **-3.85%** | | benchmark_basic_model | 4.3±0.28µs | **4.1±0.06µs** | **+4.88%** | | benchmark_key_match | 8.0±0.08µs | **7.8±0.13µs** | **+2.56%** | | benchmark_raw | 0.0±0.00ns | 0.0±0.00ns | NaN% | | benchmark_rbac_model | 7.0±0.11µs | 7.0±0.13µs | 0.00% | | benchmark_rbac_model_medium | 972.0±75.44µs | **915.6±8.51µs** | **+6.16%** | | benchmark_rbac_model_with_domains | 6.7±0.16µs | 6.8±0.14µs | -1.47% | | benchmark_rbac_with_deny | 9.8±0.15µs | **9.5±0.17µs** | **+3.16%** | | benchmark_rbac_with_resource_roles | 4.9±0.05µs | 4.9±0.04µs | 0.00% | | benchmark_role_manager_large | 5.0±0.02ms | **4.7±0.09ms** | **+6.38%** | | benchmark_role_manager_medium | 347.6±2.01µs | **306.1±5.48µs** | **+13.56%** | | benchmark_role_manager_small | 100.5±2.78µs | **95.3±1.32µs** | **+5.46%** |