Skip to content

Release KSM CLI v1.5.0 - #1065

Open
stas-schaller wants to merge 18 commits into
masterfrom
release/tool/cli/v1.5.0
Open

Release KSM CLI v1.5.0#1065
stas-schaller wants to merge 18 commits into
masterfrom
release/tool/cli/v1.5.0

Conversation

@stas-schaller

@stas-schaller stas-schaller commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

Summary

Release branch for v1.5.0: five CLI bug fixes and a dependency cleanup, plus four installer-level fixes shipped from the cli-binaries repo that affect the same release.

Changes

Bug Fixes

  • SSH keyring silent empty return (KSM-929): When the OS keyring (e.g. gnome-keyring) was running but locked with no interactive session to unlock it (common over SSH), the CLI silently returned no profiles. Now raises an actionable error naming the cause and pointing at --ini-file/KSM_CONFIG as a fallback.
  • Config search path resolution (KSM-1113): Windows looked for %APPDIR%\Keeper (a Linux AppImage variable, not a Windows one) instead of %APPDATA%\Keeper; on Linux, the /etc search entry resolved against the current working directory instead of /etc. Both are now resolved correctly.
  • Clone exits 0 on missing source (KSM-1107): ksm secret add clone exited 0 even when the source UID did not exist, masking the failure from scripts. Now exits non-zero with an error message.
  • Clone crashes on empty complex field (KSM-1118): ksm secret add clone crashed with "list index out of range" when the source record contained any unpopulated complex field (name, address, host, etc.) — fields the server legitimately returns as value: []. Empty-value fields are now skipped before the create payload is assembled. Root cause in the helper library is tracked separately as KSM-1119.
  • Add file/editor crashes on empty complex field (KSM-1126): ksm secret add file and ksm secret add editor crashed with the same "list index out of range" error as KSM-1118 when the record script contained an unpopulated complex field with value: []. The file/editor load path had no filter; empty-value fields are now stripped before the create payload is assembled, matching the behavior introduced for add clone in KSM-1118. Root cause in the helper library is tracked as KSM-1119.

Dependency

  • colorama removal (KSM-1114): Replaced the unmaintained colorama package with click.style(), already available via the existing click-help-colors dependency. Includes a shim so the Windows-only config-permission warning (which duck-types its color argument against colorama's Fore/Style shape) keeps its coloring.

Maintenance

  • Removed ticket ID references from test names and inline comments (test clarity cleanup).

Deferred

  • AWS profile setup non-EC2 crash (KSM-859): fix was written but touched the shared storage package rather than CLI-only code, so it was reverted from this branch. Root-cause fix now tracked as KSM-1115 against the storage package (v1.2.0); KSM-859 will close out once CLI bumps its pinned storage dependency.

Installer fixes (cli-binaries repo — not in this diff, but user-facing for this release and included in the CHANGELOG)

  • macOS installer crash on every command (KSM-1018): the bundled libssl.3.dylib predated OpenSSL 3.2.0, which cryptography now requires, causing ImportError: Symbol not found: _SSL_get0_group_name on every ksm invocation. Both x64 and arm64 macOS builds now bundle an up-to-date libssl.
  • Windows post-install launch blocked by endpoint security (KSM-1105): InnoSetup's extracted Setup engine parent process in %TEMP% was unsigned, causing EDR/AV to block the post-install launch of ksm.exe. Fixed so the launch no longer trips endpoint security.
  • macOS PKG installer ignored component checkboxes (KSM-1106): Keyring and Cloud Sync components were always installed in GUI mode regardless of the checkboxes selected. The installer now respects the user's selection.
  • Windows installer deployed to Program Files (x86) (KSM-1116): The Inno Setup script was missing ArchitecturesAllowed and ArchitecturesInstallIn64BitMode directives, so the 64-bit binary was placed in C:\Program Files (x86) on 64-bit systems. The installer now correctly targets C:\Program Files.

Breaking Changes

None.

Related Issues

  • KSM-929, KSM-1107, KSM-1113, KSM-1114, KSM-1118, KSM-1126
  • Installer-side: KSM-1018, KSM-1105, KSM-1106, KSM-1116
  • Deferred: KSM-859
  • Follow-up (helper root cause): KSM-1119
  • REL-5258

Ticket IDs in test docstrings/comments rot when the tracker changes
and distract readers into looking something up the comment should
just explain inline; the substance (why each test exists) is kept,
only the KSM-#### / REL-#### / URL references are removed.
_get_instance_region() constructed IMDSFetcher with botocore's default
timeout/retries, so 'ksm profile setup -t aws' stalled on every one of
the four region-lookup calls against an unreachable 169.254.169.254
before eventually surfacing a raw botocore NoRegionError. IMDSFetcher
now uses a 1s/1-attempt timeout, and _get_client() raises a message
naming the non-EC2 cause and the --fallback option instead. read_config()
also logs AWS errors it previously swallowed silently.
…profiles

KeyringUtilityStorage.__load_config() caught every exception, including
keyring.errors.KeyringLocked, behind a blanket except-and-log-at-debug,
so a locked keyring (e.g. gnome-keyring running but locked in an SSH
session with no display server) was indistinguishable from no profile
ever being configured. Reproduced empirically against the actual
published keeper-secrets-manager-cli==1.3.0 package in a Docker
container with a real dbus-daemon + gnome-keyring-daemon, locking a
collection with a stored secret and confirming the silent None return.

__load_config() now catches KeyringLocked specifically and raises the
new KsmCliKeyringLockedException with an actionable message; existing
KsmCliException handling in profile.py surfaces it without further
changes. Keyring-less installs are unaffected (the guarded keyring
import falls back to a tuple that matches nothing on ImportError).
The IMDS timeout fix and _get_client() error handling belong in the
storage package (keeper-secrets-manager-storage), not the CLI release.
These changes will land in storage v1.2.0 via KSM-977-aws-load-config-raise.
APPDIR is a Linux AppImage variable, not a standard Windows env var.
Replace with APPDATA joined with "Keeper" so %APPDATA%\Keeper\keeper.ini
is correctly included in the config path search, consistent with the
existing PROGRAMDATA\Keeper and PROGRAMFILES\Keeper entries.

KSM-1113
Relative ["etc"] entries in find_ksm_path resolved against CWD, not /etc.
os.path.join produces /etc/keeper.ini only when the first component is
an absolute path. No behavior change on Windows where /etc does not exist.

KSM-1113
KSM-1114 dropped colorama, which left check_config_mode()'s Windows
icacls permission warning uncolored (that function, in the Core SDK,
duck-types its color_mod arg against colorama's Fore/Style shape).
A small click.style()-backed shim gives it the same shape without
reintroducing colorama as a dependency.

KSM-1114
…ng entries

Removes the KSM-859 entry (fix was reverted from this branch via 29c5997;
CLI v1.5.0 ships without it, tracked as KSM-1115 for a future release).
Adds KSM-1113, KSM-1107, and the installer-level KSM-1018/1105/1106 fixes,
which were merged on this branch or the same release but missing from
the changelog.
stas-schaller and others added 4 commits July 27, 2026 13:47
FieldType.__init__ in keeper-secrets-manager-helper crashes with
IndexError when a complex field (name, address, host, etc.) has
value: [] — the server's normal representation of an unpopulated field.

Strip fields with empty value lists from the source record before
passing to RecordV3.create_from_data so the helper never receives
value: [] for a dict-typed field. Empty fields on the source are
absent from the clone payload; the server still creates them as empty
on the cloned record.

A proper fix for the root cause in the helper is tracked in KSM-1119.
helper FieldType.__init__ crashes with IndexError when a dict-typed
field (address, name, host, passkey, etc.) has value: [] -- the
server's normal representation of an unpopulated complex field.

The add-file path called Record.create_from_file with no filter, so
any record script containing an unpopulated complex field crashed with
an opaque "list index out of range" error naming neither the field nor
the cause. add editor shares the same loader and is fixed by the same
change.

Fix: load the file via load_file, strip fields where value is empty
before calling RecordV3.create_from_data, matching the pattern
introduced for add clone in KSM-1118 (commit b0d660e). Also adds
cleanup comments at both workaround sites (add file and add clone)
so they can be removed once the helper ships the "if self.value:"
guard in FieldType.__init__ (KSM-1119).

Pre-existing since 1.4.0; not a 1.5.0 regression.
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.

3 participants