Skip to content

🧠 Refactor: Migrate Auth Nonces to Redis #86

@Cedarich

Description

@Cedarich

Title: refactor(auth): move nonce storage from memory to redis
Complexity Score: 150 points

Description
The current AuthService stores login nonces in a local Map. This will fail if we scale to multiple backend instances. We need to move this state to Redis.

Requirements and Context

  • Dependency: Use cache-manager with redis store.
  • Logic:
    • generateChallenge: await cacheManager.set(\nonce:${publicKey}`, nonce, ttl)`.
    • login: await cacheManager.get(\nonce:${publicKey}`)`.

Suggested Execution

  1. Configure Redis in AppModule.
  2. Inject CACHE_MANAGER into AuthService.
  3. Replace this.activeNonces.set() with cache set.
  4. Replace this.activeNonces.get() with cache get and delete after use.

Test and Commit

  • Commit Message: refactor(auth): move nonce storage from memory to redis

Metadata

Metadata

Assignees

No one assigned

    Labels

    Stellar WaveIssues in the Stellar wave program

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions