Skip to content

test(security): add regression test for migrate auth check - #639

Merged
Austinaminu2 merged 2 commits into
FlowwStar:mainfrom
joshfatoye0011-bit:fix/464-migrate-auth-regression-test
Aug 27, 2026
Merged

Austinaminu2 merged 2 commits into
FlowwStar:mainfrom
joshfatoye0011-bit:fix/464-migrate-auth-regression-test

Conversation

@joshfatoye0011-bit

@joshfatoye0011-bit joshfatoye0011-bit commented Aug 26, 2026 •

Copy link
Copy Markdown
Contributor

Summary Adds est_auth_non_admin_cannot_migrate to est_security.rs to guard against regression of the bug fixed in commit 7fe0b2e, where migrate() did not enforce authorization at all. ## What changed - Added est_auth_non_admin_cannot_migrate in contracts/streaming/src/test_security.rs - Follows the same pattern as est_auth_non_admin_cannot_upgrade: mocks the attacker's auth for the migrate invocation and asserts the call panics, because

equire_auth() inside migrate rejects a non-admin caller ## Why est_migrate() in est.rs only verifies the happy path (admin can call migrate without panicking). It does not verify that a non-admin is rejected. Without this test, the
equire_auth() line could be accidentally removed and CI would not catch it. ## Testing Existing: est_migrate — happy path, admin succeeds New: est_auth_non_admin_cannot_migrate — sad path, non-admin panics Closes #464

…ey::Migrated(u64) variant was declared in the DataKey enum but never read or written anywhere in the codebase. A repo-wide grep confirmed zero references outside the declaration itself. The variant has been removed to keep the enum clean and avoid confusing future contributors about a key that serves no purpose. Closes FlowwStar#463
…auth_non_admin_cannot_migrate to test_security.rs to guard against regression of the bug fixed in commit 7fe0b2e, where migrate() did not enforce authorization at all. The test follows the same pattern as test_auth_non_admin_cannot_upgrade: mock the attacker auth for the migrate invocation and assert the call panics because require_auth() rejects a non-admin caller. Closes FlowwStar#464
@joshfatoye0011-bit joshfatoye0011-bit changed the title fix: remove dead DataKey::Migrated(u64) variant (closes #463) test(security): add regression test for migrate auth check Aug 26, 2026
@drips-wave

drips-wave Bot commented Aug 26, 2026

Copy link
Copy Markdown

@joshfatoye0011-bit 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

@Austinaminu2
Austinaminu2 merged commit 9d15456 into FlowwStar:main Aug 27, 2026
2 of 7 checks passed

This branch had an error being deployed

1 failed deployment
staging — 093e81e3 Deployed Aug 26, 2026 by joshfatoye0011-bit via deploy-staging #207
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.

Add a non-admin-rejection test for migrate()

2 participants