Skip to content

fix: align interactive mode authentication with exec mode#17

Merged
inureyes merged 1 commit into
mainfrom
fix/interactive-auth-consistency
Aug 27, 2025
Merged

fix: align interactive mode authentication with exec mode#17
inureyes merged 1 commit into
mainfrom
fix/interactive-auth-consistency

Conversation

@inureyes
Copy link
Copy Markdown
Member

Summary

  • Fixed interactive mode connection failures when using cluster configurations with SSH keys
  • Aligned authentication behavior between interactive and exec modes for consistency

Changes

  • Added authentication parameters (key_path, use_agent, use_password, strict_mode) to InteractiveCommand struct
  • Refactored determine_auth_method() in interactive mode to use the same logic as exec mode
  • Updated CLI to pass authentication parameters from command-line arguments and config to interactive mode
  • Updated all tests and examples to include the new authentication fields

Problem Solved

Previously, interactive mode ignored CLI authentication parameters and cluster SSH key configurations, causing connection failures when running commands like bssh -c orin interactive. The mode had its own simplified authentication logic that only checked for SSH agent and default key locations.

Now interactive mode respects:

  • Cluster-specific SSH keys from config files
  • CLI parameters like -i/--identity, --use-agent, --password
  • The same authentication priority order as exec mode

Test Plan

  • Code builds successfully with cargo build --all-targets
  • All clippy warnings resolved
  • Code formatted with cargo fmt
  • Manual testing with cluster configurations
  • Interactive mode connects successfully with SSH key authentication

- Add authentication parameters (key_path, use_agent, use_password, strict_mode) to InteractiveCommand struct
- Reuse the same authentication logic from exec mode's determine_auth_method
- Pass CLI auth parameters from main.rs to interactive command
- Update tests and examples to include new authentication fields

This ensures consistent authentication behavior between interactive and exec modes,
fixing connection failures when using cluster configurations with SSH keys.
@inureyes inureyes added the type:bug Something isn't working label Aug 27, 2025
@inureyes inureyes self-assigned this Aug 27, 2025
@inureyes inureyes merged commit b289462 into main Aug 27, 2025
3 checks passed
@inureyes inureyes added priority:medium Medium priority issue status:done Completed labels Sep 9, 2025
@inureyes inureyes deleted the fix/interactive-auth-consistency branch October 30, 2025 01:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

priority:medium Medium priority issue status:done Completed type:bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant