Skip to content

Conversation

@leonhausdorf
Copy link
Collaborator

Summary

Adds interactive account decommissioning feature with selective SSH key retention to both TUI and CLI. Users can now safely remove accounts while choosing which SSH keys to keep on the remote host.

Motivation

When decommissioning an account, users often want to revoke Keymaster's access (remove the system key) while preserving certain user keys for continued access. Previously, decommissioning was an all-or-nothing operation that either removed the entire authorized_keys file or everything Keymaster managed. This enhancement provides fine-grained control over which keys remain on the host during decommissioning, making it safer and more flexible to transition accounts away from Keymaster management.

Changes

  • After confirming deletion, users can select which SSH keys to keep
  • Checkbox-based UI with keyboard navigation (↑/↓, Space, Tab)
  • Consistent modal interface matching other TUI dialogs
  • System key is always removed; user keys are kept by default (user can deselect)
  • Enhanced GenerateSelectiveKeysContent to support generating content without system key
  • Proper newline handling that ensures authorized_keys files end with newline (prevents terminal formatting issues)
  • Fixed extractNonKeymasterContent to correctly identify and preserve non-Keymaster keys
  • Fixed modal rendering and message passing in TUI

Testing

  • Decommissioning with selective key retention (TUI)
  • Decommissioning with --keep-file flag (CLI)
  • Verified system key is always removed
  • Verified user keys can be selectively kept/removed
  • Verified non-Keymaster keys are preserved
  • Verified proper file formatting (trailing newlines)

Additional Notes

You can decommission in style now 😎
Fixes #17

@leonhausdorf leonhausdorf added this to the v1.4 milestone Sep 30, 2025
@leonhausdorf leonhausdorf self-assigned this Sep 30, 2025
@leonhausdorf leonhausdorf added tui Everything related to our Text User Interface component cli Everything related to our CLI component feature Not a Volkswagen Beetle. labels Sep 30, 2025
@ToeiRei ToeiRei merged commit 190ea92 into main Oct 1, 2025
3 checks passed
@ToeiRei
Copy link
Owner

ToeiRei commented Oct 1, 2025

Sieht geil aus.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cli Everything related to our CLI component feature Not a Volkswagen Beetle. tui Everything related to our Text User Interface component

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Decomission host

3 participants