Skip to content

Add admin-rotation expiry test asserting accept_admin_rotation rejects past a documented staleness window #423

@thlpkee20-wq

Description

@thlpkee20-wq

Description

propose_admin_rotation and accept_admin_rotation form a two-step flow but no expiry analogous to ISSUER_TRANSFER_EXPIRY_SECS constrains how long a pending admin rotation can sit. A long-pending rotation is a latent compromise risk. Add a configurable expiry and a test asserting acceptance past the window returns a typed error.

Requirements and context

  • Must be secure, tested, and documented
  • Should be efficient and easy to review
  • Relevant code: src/lib.rs (propose_admin_rotation, accept_admin_rotation, cancel_admin_rotation, NoAdminRotationPending)
  • Reuse the per-offering-expiry pattern with an ADMIN_ROTATION_EXPIRY_SECS default

Suggested execution

  • Fork the repo and create a branch
  • git checkout -b feat/admin-rotation-expiry
  • Implement changes
    • Store proposal timestamp alongside the pending admin
    • Reject accept_admin_rotation past expiry
    • Add boundary test at exact expiry and one-past
  • Validate security and correctness assumptions

Test and commit

  • Run tests
    • cargo test --all
  • Cover edge cases
    • Cancel before expiry, accept at expiry, accept one-past expiry, re-propose after expiry
  • Include test output and security notes

Example commit message

feat: enforce admin-rotation expiry window

Guidelines

  • Minimum 95 percent test coverage
  • Clear documentation
  • Timeframe: 96 hours

Metadata

Metadata

Assignees

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions