The Authenticator REST API changed and broke the online flows. Realign
them with the contract used by the current official Battle.net client.
- Retrieve moved from POST /v1/authenticator/device to
POST /v2/authenticator/device and now requires an accountIdentifier
(account email or phone) alongside serial and restoreCode.
- Drop the SSO/bearer requirement from retrieve: the v2 endpoint
authenticates via accountIdentifier + serial + restoreCode, mirroring
restoreAuthenticator in the official app.
- Split the hardcoded base URL into host + per-endpoint versioned paths
(attach stays on v1: POST /v1/authenticator).
- Surface the server's {errorCode, message} and add root-cause hints
(404 route-moved vs 401/403 server-side gating) on HTTP errors.
- Handle requireHealup responses with a clear message instead of
emitting invalid credentials.
This small update focuses on a significant refactoring of the codebase to improve maintainability, readability, and structure.
The core functionality remains unchanged.
Key changes include:
- Documentation Removal: Docstrings and comments have been removed to reduce code clutter.
- Configuration Consolidation: All global constants (e.g., version info, API URLs, cryptographic parameters) are now centralized in a single AppConfig class for better organization and easier management.
- Streamlined Logic: Simplified the error handling for API requests and refined several helper functions for improved clarity and more idiomatic Python.
- Structural Enhancements: Minor improvements to the overall code structure for a cleaner and more direct implementation.
Refactors some of the code, making it cleaner and more concise.
Added an offline method of reconstructing TOTP keys and QR code provided the user has the required information.