-
Notifications
You must be signed in to change notification settings - Fork 11
Open
Description
Description
Create detailed usage examples and documentation for all TokenManager implementations to help developers understand and implement token management strategies.
Background
CodeRabbit review of PR #105 identified missing documentation for TokenManager usage patterns. Current 40 undocumented public declarations include key TokenManager methods.
Required Examples
1. InMemoryTokenStorage
- Basic setup and configuration
- Token storage and retrieval
- Memory management considerations
- Use case scenarios
2. Custom TokenManager Implementation
- Protocol conformance examples
- Persistent storage implementations
- Thread safety considerations
- Error handling patterns
3. Integration Examples
- TokenManager with MistKitConfiguration
- Token refresh workflows
- Multiple environment management
- Testing with mock TokenManagers
Documentation Tasks
- Add @throws and @returns documentation for all TokenManager methods
- Document TokenManagerError types and handling
- Create comprehensive code examples
- Add performance and security considerations
- Document testing strategies for token management
Code Examples Needed
// InMemoryTokenStorage usage
let tokenStorage = InMemoryTokenStorage()
let config = MistKitConfiguration(tokenManager: tokenStorage, ...)
// Custom TokenManager implementation
class CustomTokenManager: TokenManager {
// Implementation example
}
// Error handling patterns
do {
let token = try await tokenManager.getToken()
} catch let error as TokenManagerError {
// Handle specific token errors
}Acceptance Criteria
- All TokenManager implementations have usage examples
- Error handling patterns are documented
- Performance and security guidelines exist
- Examples cover common use cases and edge cases
Related
- PR Adding Server to Server Authentication #105 feedback
- API documentation improvements
- Authentication system documentation
Labels
documentation, token-management, examples, api
Metadata
Metadata
Assignees
Labels
No labels