Skip to content

Add pam launch from SuperShell#2025

Merged
sk-keeper merged 2 commits intoreleasefrom
feature/pam-launch-supershell
May 7, 2026
Merged

Add pam launch from SuperShell#2025
sk-keeper merged 2 commits intoreleasefrom
feature/pam-launch-supershell

Conversation

@craiglurey
Copy link
Copy Markdown
Contributor

Summary

  • Adds a one-key path (L) from the SuperShell TUI to a KeeperPAM terminal session for pamMachine and pamDatabase records, suspending Textual while the session is live.
  • Cleans up the Detail view for those record types — hides the noisy raw pamHostname / pamSettings / trafficEncryptionSeed / checkbox:* fields and replaces them with a parsed Launch section showing protocol, host, credential, and a visual "Press L to Launch " button. JSON view is unchanged.
  • Makes pam launch interactive when allowSupplyHost: True and the record has no static hostname — prompts for host:port instead of erroring out, with retries and the format spelled out in the prompt.
  • Drive-by: fixes the misleading Use login --server <region> hint that keeper login prints in batch mode (it was dispatching to login(1) instead of keeper).

Notable design choices

  • is_launchable() and get_launch_info() are now module-level helpers in pam_launch/launch.py so the TUI and the CLI share eligibility logic. Both read only cached vault data — safe for SuperShell's render path (no API calls during init/sync).
  • SuperShell uses App.suspend() to release the terminal during launch, then resumes after the session ends. CommandError is caught and shown without a traceback; generic exceptions still log with traceback. Both pause for Enter so the user sees the message before the TUI redraws.
  • Multi-line dict values (like pamSettings) are stripped from Detail view via brace-counting in _strip_pam_internal_fields, so continuation lines don't leak through.
  • L follows the existing capital-letter action convention (P, W, D); lowercase l is taken by vim cursor-right.

Test plan

  • keeper supershell — pamMachine record with static host + userRecords (image Make loading of a record from data into a utility function #1 in design discussion): Detail panel shows Launch section with resolved host:port and credential title; pressing L connects.
  • pamMachine with allowSupplyHost: True and no hostname: Launch section shows Host: (prompted at launch); pressing L prompts for host:port with the format hint, accepts a valid value, and connects. Bad input (e.g. 127.0.0.1 with no port) re-prompts with the validation error in red rather than crashing.
  • pamMachine with allowSupplyUser: True plus a static credential: Launch section shows Credential: <title> (or supplied at launch).
  • Non-launchable record (login type, pamUser): no Launch section, no L hint in shortcuts bar; pressing L shows "This record is not launchable".
  • JSON view (t toggle) on a pamMachine: still shows full pamSettings / pamHostname raw — only Detail view is filtered.
  • keeper pam launch <uid> from keeper shell (no SuperShell): existing CLI behavior unchanged for records with static hostnames.
  • keeper login from system shell (batch mode): hint reads keeper login --server <region>. Inside keeper shell: hint reads login --server <region>.
  • ? in SuperShell: Help modal lists the new L shortcut under Actions.

craiglurey added 2 commits May 7, 2026 07:51
Adds a one-key path from the SuperShell TUI to a KeeperPAM connection
for pamMachine and pamDatabase records.

* `is_launchable(params, record_uid)` and `get_launch_info(...)` exposed
  as module-level helpers in `pam_launch/launch.py` so the TUI and CLI
  share the same eligibility/protocol logic without duplicating it.
* SuperShell `L` keybinding suspends the Textual app, runs
  `PAMLaunchCommand` in the released terminal, and resumes the TUI when
  the session ends. `CommandError` failures show a clean message; other
  exceptions still log a traceback. Both pause for Enter so the user
  sees the message before the TUI redraws.
* Detail view for pamMachine/pamDatabase strips the noisy
  `pamHostname`, `pamSettings`, `trafficEncryptionSeed`, and
  `checkbox:*` fields (multi-line dict continuations included via brace
  counting). JSON view is unchanged.
* New "Launch" section rendered after the Title shows protocol, host,
  credential, and a visual "Press L to Launch <PROTOCOL>" button.
  `(prompted at launch)` placeholders cover `allowSupplyHost` /
  `allowSupplyUser` records that have no static value.
* `pam launch` now prompts for `host:port` instead of erroring when
  `allowSupplyHost: True`, no `--host` is given, and the record has no
  static hostname. Up to 3 retries on bad input with the expected
  format shown in the prompt; non-TTY behavior preserved.
* Help modal lists the new `L` action.
When `keeper login` runs from the system shell (batch mode), the hint
to change the data center previously suggested `login --server <region>`
which dispatches to macOS/Linux `login(1)` instead of Commander.

The hint now reads `keeper login --server <region>` in batch mode and
keeps `login --server <region>` for the interactive Keeper shell.
@sk-keeper sk-keeper merged commit 54de71c into release May 7, 2026
4 checks passed
@sk-keeper sk-keeper deleted the feature/pam-launch-supershell branch May 7, 2026 15:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants