Skip to content

feat(rbac): preload and propagate wildcard/pattern domain role links#387

Merged
hsluoyz merged 7 commits into
apache:masterfrom
cici0602:fix-wildcard
Sep 17, 2025
Merged

feat(rbac): preload and propagate wildcard/pattern domain role links#387
hsluoyz merged 7 commits into
apache:masterfrom
cici0602:fix-wildcard

Conversation

@cici0602
Copy link
Copy Markdown
Contributor

@cici0602 cici0602 commented Sep 14, 2025

Fix: #380

- Preload: when a concrete domain is first accessed/created (get_or_create_role),
  copy role relationships from matching wildcard/pattern domains so the domain's
  graph contains inherited links (preload/copy mechanism).

- Propagate: when adding a role inheritance (add_link), if a domain-matching
  function is set, propagate the new Link to all affected/matching domains so
  subsequent queries find the complete inheritance path in a single domain graph.

- Tests: add a unit test that verifies cross-domain inheritance for wildcard/pattern
  domains (covers both preload and propagation behaviors).
@CLAassistant
Copy link
Copy Markdown

CLAassistant commented Sep 14, 2025

CLA assistant check
All committers have signed the CLA.

@github-actions
Copy link
Copy Markdown

Benchmark for 06159a3

Click to view benchmark
Test PR Benchmark Master Benchmark %
b_benchmark_rbac_model_large 9.5±0.02ms 9.5±0.03ms 0.00%
benchmark priority model 4.0±0.06µs 4.0±0.06µs 0.00%
benchmark_abac_model 2.4±0.09µs 2.4±0.03µs 0.00%
benchmark_basic_model 3.6±0.03µs 3.6±0.04µs 0.00%
benchmark_key_match 6.8±0.11µs 6.7±0.19µs +1.49%
benchmark_raw 0.0±0.00ns 0.0±0.00ns NaN%
benchmark_rbac_model 5.9±0.06µs 5.8±0.07µs +1.72%
benchmark_rbac_model_medium 794.9±18.05µs 793.4±8.97µs +0.19%
benchmark_rbac_model_with_domains 5.7±0.08µs 5.7±0.07µs 0.00%
benchmark_rbac_with_deny 8.0±0.11µs 7.9±0.10µs +1.27%
benchmark_rbac_with_resource_roles 4.3±0.04µs 4.2±0.11µs +2.38%
benchmark_role_manager_large 4.2±0.01ms 4.3±0.01ms -2.33%
benchmark_role_manager_medium 269.1±20.09µs 271.1±1.45µs -0.74%
benchmark_role_manager_small 28.4±0.49µs 28.1±0.40µs +1.07%

@hsluoyz hsluoyz merged commit 0d8b9db into apache:master Sep 17, 2025
10 checks passed
@codecov
Copy link
Copy Markdown

codecov Bot commented Sep 17, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 0.00%. Comparing base (c5a05d3) to head (d2433a8).
⚠️ Report is 18 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff            @@
##           master   #387       +/-   ##
=========================================
- Coverage   65.54%      0   -65.55%     
=========================================
  Files          25      0       -25     
  Lines        1956      0     -1956     
=========================================
- Hits         1282      0     -1282     
+ Misses        674      0      -674     

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

github-actions Bot pushed a commit that referenced this pull request Sep 17, 2025
# [2.12.0](v2.11.0...v2.12.0) (2025-09-17)

### Features

* **rbac:** preload and propagate wildcard/pattern domain role links ([#387](#387)) ([0d8b9db](0d8b9db))
@github-actions
Copy link
Copy Markdown

🎉 This PR is included in version 2.12.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@cici0602 cici0602 deleted the fix-wildcard branch September 17, 2025 13:22
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.

Resolve wildcard domains on nested roles

3 participants