Skip to content

Conversation

@luannmoreira
Copy link
Member

Description

This update introduces support for authenticating terminal sessions using SSH private keys via WebSocket challenge signing. It enhances the terminal experience with a more secure and flexible login flow, alongside various maintainability improvements.

Features

Private key-based authentication:

  • The Terminal.vue component now accepts a privateKey prop.
  • Implements challenge-response signing using the validate utility functions.
  • Handles kind: 3 WebSocket messages (SSH challenges).

Updated terminal dialog logic:

  • TerminalDialog.vue tracks privateKey and passes it to the terminal.
  • Private key-based connection flow now derives a fingerprint but defers signing to Terminal.vue.
  • WebSocket robustness improvements:
  • Introduces isReady flag to reliably track socket state.
  • Enhances handling of socket open, message, and close events.

Tests

  • Improved mocking of WebSocket.readyState in unit tests.
  • Ensured socket closes properly on unmount.
  • Added test for WebSocket message dispatch when terminal input is received.

Cleanup & Comments

  • Rich inline comments added across the codebase for maintainability.
  • Consistent naming, enhanced readability, and logical grouping of functions.

@luannmoreira luannmoreira self-assigned this Jun 11, 2025
@luannmoreira luannmoreira requested a review from a team as a code owner June 11, 2025 21:27
@luannmoreira luannmoreira added kind/feature New feature or request area/ui status/needs-review javascript Pull requests that update Javascript code status/require-tests labels Jun 11, 2025
@henrybarreto henrybarreto force-pushed the feat/use-users-key-signature-web-session branch from 1597473 to 622c93a Compare June 12, 2025 13:26
@henrybarreto henrybarreto requested a review from a team as a code owner June 12, 2025 13:26
@luannmoreira luannmoreira force-pushed the feat/ssh-private-key-terminal-auth branch from 73ce289 to 332c832 Compare June 12, 2025 13:58
@luannmoreira luannmoreira force-pushed the feat/ssh-private-key-terminal-auth branch from 332c832 to fdc0079 Compare June 12, 2025 15:00
@luannmoreira luannmoreira requested a review from luizhf42 June 12, 2025 15:09
luizhf42
luizhf42 previously approved these changes Jun 12, 2025
Base automatically changed from feat/use-users-key-signature-web-session to master June 16, 2025 14:12
@gustavosbarreto gustavosbarreto dismissed luizhf42’s stale review June 16, 2025 14:12

The base branch was changed.

@luannmoreira luannmoreira force-pushed the feat/ssh-private-key-terminal-auth branch from fdc0079 to 99ff5eb Compare June 16, 2025 14:13
Add support for signing WebSocket SSH challenges using a private key.
Pass `privateKey` prop to Terminal component and handle key-based
authentication in TerminalDialog. Enhance robustness of WebSocket
handling and improve inline comments for maintainability.
@luannmoreira luannmoreira force-pushed the feat/ssh-private-key-terminal-auth branch from 99ff5eb to 42d58ad Compare June 16, 2025 14:17
@gustavosbarreto gustavosbarreto merged commit 0dbd68d into master Jun 16, 2025
8 checks passed
@gustavosbarreto gustavosbarreto deleted the feat/ssh-private-key-terminal-auth branch June 16, 2025 14:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/ui javascript Pull requests that update Javascript code kind/feature New feature or request status/needs-review status/ready-for-testing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants