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: Implement key_match4/key_match5 functions and generic EnforceArgs<T> #367

Merged
merged 2 commits into from
Feb 4, 2025

Conversation

liulifox233
Copy link
Contributor

Type

  • Feature

Changes

  1. Added key_match4 and key_match5 functions

    • Implemented new pattern-matching logic for extended policy rule support.
    • Converted inline comments to Rust doc comments (///) for improved API documentation.
  2. Generic implementation for EnforceArgs

    • Refactored EnforceArgs implementation from Vec<String> to generic Vec<T>.
    • Enables compatibility with any vector type while maintaining type safety.

- Convert impl specifically for Vec<String> to generic impl<T> for Vec<T>
Copy link

github-actions bot commented Feb 4, 2025

Benchmark for 37a84a9

Click to view benchmark
Test PR Benchmark Master Benchmark %
b_benchmark_rbac_model_large 10.1±0.05ms 9.7±0.39ms +4.12%
benchmark priority model 4.3±0.06µs 4.2±0.05µs +2.38%
benchmark_abac_model 2.4±0.04µs 2.4±0.04µs 0.00%
benchmark_basic_model 3.8±0.08µs 3.8±0.05µs 0.00%
benchmark_key_match 7.0±0.11µs 6.9±0.08µs +1.45%
benchmark_raw 0.0±0.00ns 0.0±0.00ns NaN%
benchmark_rbac_model 6.2±0.09µs 6.1±0.08µs +1.64%
benchmark_rbac_model_medium 850.5±5.37µs 841.7±15.99µs +1.05%
benchmark_rbac_model_with_domains 6.0±0.05µs 5.9±0.10µs +1.69%
benchmark_rbac_with_deny 8.8±0.12µs 8.4±0.11µs +4.76%
benchmark_rbac_with_resource_roles 4.5±0.36µs 4.4±0.06µs +2.27%
benchmark_role_manager_large 4.5±0.03ms 4.5±0.03ms 0.00%
benchmark_role_manager_medium 295.3±5.83µs 294.2±4.50µs +0.37%
benchmark_role_manager_small 29.5±0.30µs 28.6±1.31µs +3.15%

@hsluoyz hsluoyz merged commit b6b3be1 into casbin:master Feb 4, 2025
10 checks passed
Copy link

github-actions bot commented Feb 4, 2025

🎉 This PR is included in version 2.9.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants