Skip to content

test(security): add negative auth tests for progress-tracker and credential-nft admin functions (#495) - #519

Open
lmduy2612 wants to merge 1 commit into
ChainLearnOfficial:mainfrom
lmduy2612:test/auth-progress-credential-495
Open

lmduy2612 wants to merge 1 commit into
ChainLearnOfficial:mainfrom
lmduy2612:test/auth-progress-credential-495

Conversation

@lmduy2612

Copy link
Copy Markdown

Summary of Changes

Closes #495.

This PR adds comprehensive negative authorization tests in tests/integration/security_auth_tests.rs for progress-tracker and credential-nft admin functions to prevent unauthorized invocation:

  1. progress-tracker Admin Functions Tested:

    • create_course
    • archive_course
    • set_course_content_hash
    • set_course_difficulty
    • set_course_tags
    • update_course_version
    • set_prerequisites
    • emergency_pause
    • unpause
    • transfer_admin
    • cancel_admin_transfer
    • set_admin_transfer_delay
  2. credential-nft Admin Functions Tested:

    • mint_credential
    • renew_credential
    • set_credential_display
    • transfer_admin
    • cancel_admin_transfer
    • set_admin_transfer_delay
    • emergency_pause
    • unpause

Each test uses targeted authorization verification rather than blanket mock_all_auths(), asserting that non-authorized callers are strictly rejected.

Verification

  • cargo test --test security_auth_tests: All 35 tests passing (15 token + 12 progress-tracker + 8 credential-nft).
  • Clippy: 0 warnings on modified files.

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.

No authorization tests for progress-tracker admin functions (create_course, archive_course, set_prerequisites, etc.)

2 participants