Skip to content

test(auth): expand auth flow tests with comprehensive edge cases#171

Merged
GoSTEAN merged 4 commits intoNetwalls:mainfrom
Ndifreke000:main
Feb 23, 2026
Merged

test(auth): expand auth flow tests with comprehensive edge cases#171
GoSTEAN merged 4 commits intoNetwalls:mainfrom
Ndifreke000:main

Conversation

@Ndifreke000
Copy link
Contributor

  • Add nonce generation and expiry tests (5 tests)

    • Unique nonce generation
    • Timestamp and expiry validation
    • Expired nonce rejection
    • Auto-delete after TTL
    • Prevent nonce reuse across public keys
  • Add valid/invalid signature login tests (4 tests)

    • Accept valid signature from correct keypair
    • Reject signature from wrong keypair
    • Reject malformed signature
    • Reject signature for tampered message
  • Add token refresh and rotation tests (5 tests)

    • Generate new tokens on refresh
    • Rotate session and invalidate old token
    • Reject expired refresh token
    • Reject refresh token used as access token
    • Maintain user session count during rotation
  • Add logout and session cleanup tests (5 tests)

    • Delete single session on logout
    • Delete all user sessions on logout all
    • Blacklist token on logout
    • Remove blacklisted token after TTL
    • Clean up user session set on delete all
  • Add concurrent session limits tests (6 tests)

    • Track multiple concurrent sessions
    • Retrieve all active sessions for user
    • Enforce session limit by deleting oldest
    • Handle concurrent session creation race condition
    • Clean up stale session references

Total: 33 tests passing (25 new tests added)

Closes #133

- Add nonce generation and expiry tests (5 tests)
  - Unique nonce generation
  - Timestamp and expiry validation
  - Expired nonce rejection
  - Auto-delete after TTL
  - Prevent nonce reuse across public keys

- Add valid/invalid signature login tests (4 tests)
  - Accept valid signature from correct keypair
  - Reject signature from wrong keypair
  - Reject malformed signature
  - Reject signature for tampered message

- Add token refresh and rotation tests (5 tests)
  - Generate new tokens on refresh
  - Rotate session and invalidate old token
  - Reject expired refresh token
  - Reject refresh token used as access token
  - Maintain user session count during rotation

- Add logout and session cleanup tests (5 tests)
  - Delete single session on logout
  - Delete all user sessions on logout all
  - Blacklist token on logout
  - Remove blacklisted token after TTL
  - Clean up user session set on delete all

- Add concurrent session limits tests (6 tests)
  - Track multiple concurrent sessions
  - Retrieve all active sessions for user
  - Enforce session limit by deleting oldest
  - Handle concurrent session creation race condition
  - Clean up stale session references

Total: 33 tests passing (25 new tests added)

Closes Netwalls#133

chore: remove documentation markdown files
- Keep README.md and WAVE1_SUMMARY.md
- Remove implementation docs, PR descriptions, and temporary notes
@Ndifreke000
Copy link
Contributor Author

@GoSTEAN but i did not touch contract, why is it failing??

@GoSTEAN GoSTEAN merged commit 76653de into Netwalls:main Feb 23, 2026
2 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.

[Testing] Expand auth flow tests

2 participants