Repository navigation
feat(auth): provide named actor fixtures for common role matrices - #546
Merged
0xsamuel1 merged 2 commits intoOct 22, 2026
Merged
Conversation
…roban-testkit#403) Add four ready-made actor-set fixtures to crates/testkit/src/auth/fixtures.rs so test authors can state a contract's role shape instead of building the address lists by hand each time: - OwnerActors – single privileged owner + unprivileged attacker - AdminUserActors – admin / user / outsider (two-tier access control) - RbacActors – admin / operator / viewer / outsider (three-tier RBAC) - PeerActors – N equal-privilege peers + outsider (multisig / shared pools) All four fixtures are re-exported from the crate root (auth::), the prelude module, and carry full rustdoc with runnable examples and positive / negative / edge-case unit tests. Integration tests added to crates/testkit/tests/auth.rs cover: - each fixture enforcing a correct matrix (pass case) - each fixture catching a deliberate auth bug (fail case) - address distinctness, reproducibility from seed, and non-overlap between fixtures drawn from the same env - PeerActors boundary validation (MIN_PEERS=2, MAX_PEERS=16) All 314 library tests, 22 auth integration tests, and 21 fixture doc tests pass; cargo fmt --check is clean.
|
@MissHarah Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds four ready-made actor fixtures to the auth module so test authors don't have to build address lists by hand every time they write an AuthMatrix test.
OwnerActors gives you a single privileged owner and an attacker. AdminUserActors covers the two-tier admin/user/outsider pattern. RbacActors handles three-tier admin/operator/viewer/outsider access control. PeerActors generates N equal-privilege peers plus an outsider for multisig and shared-pool contracts.
All fixtures are seeded and reproducible, wire directly into AuthMatrix.entry_point, and are exported from both soroban_testkit::auth and the prelude. Includes 22 integration tests and 21 doc tests. All existing tests continue to pass.
Closes #403
Closes #404