fix: Add YubiKey support for password input#146
Open
majiayu000 wants to merge 1 commit intoyitsushi:mainfrom
Open
fix: Add YubiKey support for password input#146majiayu000 wants to merge 1 commit intoyitsushi:mainfrom
majiayu000 wants to merge 1 commit intoyitsushi:mainfrom
Conversation
This commit implements YubiKey integration for password authentication by adding support for the TOTP_YUBIKEY environment variable. When enabled, users can use YubiKey static passwords, OTP slots, or any hardware token that supports keyboard emulation as their encryption password. Changes: - Added TOTP_YUBIKEY environment variable support - Modified password prompts to indicate YubiKey mode when enabled - Added comprehensive test coverage for YubiKey functionality - Updated README with YubiKey usage documentation The implementation avoids external dependencies by leveraging YubiKey's keyboard emulation capabilities, making it compatible with various hardware tokens without requiring specialized libraries. Fixes yitsushi#77 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com> Signed-off-by: majiayu000 <1835304752@qq.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR fixes #77 by implementing YubiKey (and similar hardware token) support for password authentication.
Changes
TOTP_YUBIKEYenvironment variable to enable YubiKey modeTestYubiKeyModeWithPassword)Implementation Details
The implementation leverages YubiKey's keyboard emulation capabilities, avoiding the need for external YubiKey libraries. This keeps the solution simple and compatible with various hardware tokens.
When
TOTP_YUBIKEY=1is set:TOTP_PASSenvironment variable for automationTesting
All tests pass including the new YubiKey test case:
Generated with Claude Code