Skip to content

Conversation

@pditommaso
Copy link
Contributor

Summary

  • Add HxAuth immutable container for JWT credentials with SHA-256 key computation
  • Add HxTokenStore interface for pluggable token storage (default: HxMapTokenStore using ConcurrentHashMap)
  • Extend HxTokenManager with multi-token methods for per-request authentication
  • Add tokenStore() builder method to HxClient for custom token store implementations
  • Support automatic token refresh per authentication session with coordination to prevent duplicate refreshes

Test plan

  • Unit tests for HxAuth (key computation, equals/hashCode)
  • Unit tests for HxMapTokenStore (get/put/remove)
  • Unit tests for HxTokenManager multi-token methods
  • Unit tests for HxClient.Builder.tokenStore()
  • All existing tests pass (159 tests)

🤖 Generated with Claude Code

pditommaso and others added 3 commits January 5, 2026 18:42
Introduce HxAuth, HxTokenStore, and HxMapTokenStore to support
multiple authentication sessions with automatic token refresh.

- HxAuth: Immutable JWT credential container with SHA-256 key
- HxTokenStore: Interface for pluggable token storage
- HxMapTokenStore: Default ConcurrentHashMap implementation
- HxTokenManager: Extended with multi-token methods
- HxClient.Builder: Added tokenStore() method for custom stores

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <[email protected]>
- Move key() method from HxTokenStore to HxAuth as static method
- Add keyOrDefault(auth, defaultValue) for null-safe key computation
- Remove key() default method from HxTokenStore interface
- key() now throws IllegalArgumentException for null auth

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <[email protected]>
Refactored no-arg methods to delegate to their HxAuth counterparts:
- addAuthHeader() - delegates with basic auth fallback
- canRefreshToken() - delegates to canRefreshToken(HxAuth)
- refreshToken() - delegates to refreshToken(HxAuth)
- doRefreshToken() - delegates to doRefreshToken(HxAuth)
- refreshTokenAsync() - delegates to refreshTokenAsync(HxAuth)
- getOrRefreshTokenAsync() - delegates to getOrRefreshTokenAsync(HxAuth)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <[email protected]>
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