Skip to content

feat(auth): provide named actor fixtures for common role matrices - #546

Merged
0xsamuel1 merged 2 commits into
soroban-testkit:mainfrom
MissHarah:feature/403-named-actor-fixtures
Oct 22, 2026
Merged

0xsamuel1 merged 2 commits into
soroban-testkit:mainfrom
MissHarah:feature/403-named-actor-fixtures

Conversation

@MissHarah

Copy link
Copy Markdown
Contributor

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

…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.
@drips-wave

drips-wave Bot commented Oct 19, 2026

Copy link
Copy Markdown

@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! 🚀

Learn more about application limits

@0xsamuel1
0xsamuel1 merged commit 8f5cb28 into soroban-testkit:main Oct 22, 2026
4 of 9 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.

[Feature][tokens] add helpers for deterministic token fixture setup [Feature][auth] provide named actor fixtures for common role matrices

2 participants