Skip to content

Conversation

@millerjason
Copy link

Summary:

  • Adds challenge-response provider abstraction to enable pluggable authentication backends (hardware YubiKey, mock implementations, future smart cards, etc.) via the new ChallengeResponseProvider ABC
  • Implements MockYubiKey for testing YubiKey functionality without physical hardware, supporting both zero-secret (for basic testing) and custom secret configurations
  • Adds touch prompting for YubiKey operations that require physical touch, improving user experience during challenge-response authentication (library would previously hang without notice)
  • Improves error hierarchy by introducing ChallengeResponseError as base class with YubiKeyError as implementation-specific subclass
  • Enhances test coverage with comprehensive tests for both hardware (when available) and mock YubiKey scenarios (always)

Key Changes:

  • src/kdbxtool/security/challenge_response.py (new): Abstract base class for challenge-response authentication
  • src/kdbxtool/security/yubikey.py: Split into HardwareYubiKey and MockYubiKey classes
  • src/kdbxtool/database.py: Refactored to use provider interface instead of direct YubiKey parameters
  • src/kdbxtool/exceptions.py: Added ChallengeResponseError base class in hierarchy
  • tests/test_yubikey.py: Updated with extensive mock-based tests (allows testing without hardware)
  • tests/test_yubikey_hardware.py: Separated hardware-specific tests

Minor:

  • Update init.py and uv versions to 0.1.5 to match github release version.

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.

1 participant