Skip to content

Overhaul connection settings: saved per-institution username, private-key detection, connect-once-on-open #20

Description

@matt-pharr

Goal

Make remote-pull auth smooth and mostly invisible. Today every pull re-enters the same connection details and re-establishes (and tears down) the SSH connection. We should remember who the user is, detect when no interactive auth is even needed, and warm the connection once when the tool opens.

Motivation

  • The GUI PullControl shows username/password/Duo fields and asks for them every time, even when the user has key-based SSH set up (no password/Duo needed at all — see remote_run: direct env python (no conda/module) + ssh-config aliases #19, which already makes creds optional with a key-based ssh-config alias).
  • remote_run opens an SSH ControlMaster per pull and tears it down at the end (ssh -O exit), so every pull pays connection + (for password users) a full Duo round-trip again.
  • Different institutions (DIII-D/GA, NSTX-U, …) have different usernames and gateways; users shouldn't re-type them.

Proposed work

  1. Saved per-institution connection profiles. Persist {institution → {username, host/alias, gateway}} (localStorage on the GUI; optionally a small backend config). Selecting a device/institution pre-fills the connection. Default to the user's last-used profile.

  2. Private-key detection → hide the password/Duo fields. Probe whether the configured host authenticates with a key (e.g. a fast ssh -o BatchMode=yes -o ConnectTimeout=5 <host> true from the backend). If it succeeds, the connection is key-based → don't show or send password/Duo. Only fall back to the password+Duo UI when key auth isn't available. Surface the detected state in the UI ("● key auth — no password needed").

  3. Connect once when the tool opens (pre-warm). Establish the SSH ControlMaster when the pull panel mounts (or on app load if a profile exists), so the first pull is already warm. Pairs with: stop tearing the master down after each pull — let ControlPersist keep it alive so back-to-back pulls reuse it (biggest win for password+Duo users: one Duo prompt per session instead of per pull). A run_remote(prewarm=True) entry point + a longer ControlPersist.

  4. Status surfacing. Show connection state in the GUI (disconnected / warming / connected · key|password), so users know a pull will be instant vs. need a Duo tap.

Relationship to other work

Acceptance

  • A returning user with key-based SSH opens the tool, sees their institution/username pre-filled and "key auth — connected", and pulls a shot with no credential entry and no per-pull reconnect.
  • A password+Duo user authenticates once per session, not once per pull.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions