Skip to content

Conversation

@pmathew92
Copy link
Contributor

@pmathew92 pmathew92 commented Jan 12, 2026

This PR improves the thread-safety implementation in the DPoP flow by replacing explicit synchronization with modern atomic operations.

Changes Made

1. DPoP Nonce Management (DPoP.kt)

  • Replaced @Volatile var _auth0Nonce: String? with AtomicReference<String?>
  • Removed synchronized block in storeNonce() method
  • Updated all nonce read/write operations to use atomic .get() and .set() methods
  • Updated test file to use AtomicReference API

2. KeyStore Property (DPoPUtil.kt)

  • Removed unnecessary @Volatile annotation from keyStore property

Testing

  • ✅ All existing unit tests pass (64 tasks completed successfully)
  • ✅ Concurrent access test verified (storeNonce should handle concurrent access safely)
  • ✅ No behavioral changes - purely an implementation refactor

This is a code quality improvement with no functional changes to the public API.

@pmathew92 pmathew92 requested a review from a team as a code owner January 12, 2026 16:09
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.

2 participants