feat: Add Touch ID authentication for non-GET requests#3777
Draft
chap wants to merge 2 commits into
Draft
Conversation
Add Touch ID biometric authentication for mutating HTTP requests on macOS. Provides enhanced security via native LocalAuthentication framework. Features: - Touch ID authentication for POST/PUT/PATCH/DELETE requests - GET/HEAD requests bypass authentication (read-only operations) - Native macOS authentication dialog with fingerprint icon - Platform detection with graceful fallback - Environment control via HEROKU_TOUCH_ID_ENABLED - Optional 'ht' command with Touch ID enabled by default Implementation: - Swift script for native LocalAuthentication framework - Init and prerun hooks wrap APIClient for request interception - Secure execFile usage (prevents command injection) - Comprehensive documentation and unit tests Usage: # Enable Touch ID for heroku command export HEROKU_TOUCH_ID_ENABLED=true heroku config:set KEY=value -a app-name # Or use ht command (Touch ID enabled by default) ht config:set KEY=value -a app-name Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: Claude <noreply@anthropic.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
Adds Touch ID biometric authentication to Heroku CLI for mutating operations on macOS devices with Touch ID support. Provides native macOS authentication with proper fingerprint icon dialog.
Changes
Touch ID Authentication
Implementation Details
src/lib/biometric/: Touch ID module with API client wrapperscripts/touch-id-auth.swift: Swift script for native LocalAuthenticationsrc/hooks/init/touch-id.ts: Hook to wrap APIClient gettersrc/hooks/prerun/touch-id.ts: Additional prerun hook supportbin/ht: Optional command with Touch ID enabled by defaultConfiguration
HEROKU_TOUCH_ID_ENABLED=trueenvironment variableHEROKU_DISABLE_TOUCH_ID=trueenvironment variablehtcommand for Touch ID enabled by defaultUsage
Option 1: Environment Variable
export HEROKU_TOUCH_ID_ENABLED=true heroku config:set DATABASE_URL=... -a my-app heroku apps:create new-appOption 2: ht Command
Testing
Enable Touch ID and run a mutating command:
You should see:
🔐 Touch ID authentication required for PATCH requestTouch ID authenticated... ✓Debug mode:
Platform Support
Security
execFileimplementation (prevents command injection)Notes
mainbranchhtcommand is optional - primary usage is via environment variableherokucommand behavior