feat(preferences): the File transfer section (SSH keys self-service) #10

Merged
KofTwentyTwo merged 6 commits from feature/preferences-file-transfer into develop 2026-10-14 21:28:21 +00:00
KofTwentyTwo commented 2026-10-14 14:29:39 +00:00 (Migrated from github.com)

Implements DESIGN.md §3.5 on core's user-preferences API (QRun-IO/qqq#1162, merged).

  • Section file-transfer ("File transfer"). It's visible only with file_gateway.connect, and it has read-only fields for the SFTP username, the host (publicHostName, when configured), the port and the host-key fingerprint.
  • List keys. Shows the caller's unrevoked keys: label, fingerprint, type, last used and expiry. The label and expiry are editable through PATCH.
  • Actions:
    • Add key (list action): takes the public key, a label and an optional expiry. On first use it creates the user's USER account, with a username derived from the user id and made unique. It inserts the key through the table, so the weak-key and duplicate checks and the audits apply.
    • Revoke (row action): sets revoked_at, and the key can no longer sign in over SFTP.
  • Ownership. The provider uses only UserPreferenceRequestContext.getUserId(). Another user's key answers "isn't a setting here".
  • Spec. DESIGN.md §3.5 drops the stand-in wording; README, CHANGELOG and CLAUDE/AGENTS are updated.

Tests: 99, 11 of them new, covering:

  • visibility by permission;
  • account creation and reuse;
  • weak and duplicate keys;
  • a username collision;
  • isolation from other users' keys;
  • revoke, with SFTP sign-in refused afterwards;
  • PATCH, including rejection of read-only fields;
  • an added key signing in over SFTP end to end.

JaCoCo is at 92.6% instructions and 97.7% classes.

Builds on the develop SNAPSHOT for now. The RC.7 pin is on feature/pin-qqq-rc7 and goes in once RC.7 publishes.

🤖 Generated with Claude Code

Implements DESIGN.md §3.5 on core's user-preferences API (QRun-IO/qqq#1162, merged). - **Section `file-transfer`** ("File transfer"). It's visible only with `file_gateway.connect`, and it has read-only fields for the SFTP username, the host (`publicHostName`, when configured), the port and the host-key fingerprint. - **List `keys`.** Shows the caller's unrevoked keys: label, fingerprint, type, last used and expiry. The label and expiry are editable through PATCH. - **Actions:** - **Add key** (list action): takes the public key, a label and an optional expiry. On first use it creates the user's USER account, with a username derived from the user id and made unique. It inserts the key through the table, so the weak-key and duplicate checks and the audits apply. - **Revoke** (row action): sets `revoked_at`, and the key can no longer sign in over SFTP. - **Ownership.** The provider uses only `UserPreferenceRequestContext.getUserId()`. Another user's key answers "isn't a setting here". - **Spec.** DESIGN.md §3.5 drops the stand-in wording; README, CHANGELOG and CLAUDE/AGENTS are updated. **Tests:** 99, 11 of them new, covering: - visibility by permission; - account creation and reuse; - weak and duplicate keys; - a username collision; - isolation from other users' keys; - revoke, with SFTP sign-in refused afterwards; - PATCH, including rejection of read-only fields; - an added key signing in over SFTP end to end. JaCoCo is at 92.6% instructions and 97.7% classes. Builds on the develop SNAPSHOT for now. The RC.7 pin is on `feature/pin-qqq-rc7` and goes in once RC.7 publishes. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Sign in to join this conversation.