Skip to content

Release KSM CLI v1.5.0#1065

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

Release KSM CLI v1.5.0#1065
stas-schaller wants to merge 27 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: three 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.

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
  • Installer-side: KSM-1018, KSM-1105, KSM-1106, KSM-1116
  • Deferred: KSM-859
  • REL-5258

maksimu and others added 18 commits May 24, 2026 23:36
…SM-975)

When keyring is unavailable, the fallback warning now distinguishes between
binary and pip installs:

- Binary install (sys.frozen=True): directs user to download the '-keyring'
  version of the binary from the GitHub releases page. Previously, binary
  users were incorrectly told to run 'pip install', which is not applicable.

- Pip install: corrects the suggested command to use single-quoted brackets
  so it works on zsh (macOS default shell since Catalina). Unquoted [] is
  a glob pattern in zsh and causes 'zsh: no matches found'.

Adds two unit tests covering both code paths.
…ning

fix(cli): context-aware keyring warning for binary vs pip installs (KSM-975)
When sys.frozen is True (PyInstaller binary), get_default_ini_file() now
uses $HOME instead of os.getcwd(), matching the launched_from_app=True path.
Pip installs are unaffected.
Switch query() from get_secrets() to get_secrets_with_options() with
request_links=True so the server actually returns link data. Add
record.links to _record_to_dict() output and a Links section to
_format_record() text output. Without request_links=True the server
never sends link data regardless of what the record contains.
…SM-1003)

Frozen (PyInstaller) binaries wrote ksm_cache.bin to the current working
directory when caching was enabled, the same pollution KSM-980 fixed for
keeper.ini. The CLI now resolves a cache directory with the same policy as
Config.get_default_ini_file (KSM_INI_DIR, else HOME/USERPROFILE when frozen)
and sets KSM_CACHE_DIR before importing the SDK core, since
KSMCache.kms_cache_file_name is evaluated at import time. Pip/source installs
keep the CWD default; an explicit KSM_CACHE_DIR is always honored.
…startup (KSM-1005)

update-checker 1.0.0 (PyPI 2026-06-08) made UpdateChecker.check() keyword-only:
check(self, *, package_name, package_version). The unpinned dependency in
setup.py meant every fresh install resolved 1.0.0, and the positional call at
__main__.py:200 crashed 'ksm shell' on launch with a TypeError.

Call check() with keyword arguments (package_name/package_version) — compatible
with both 0.18.0 and 1.0.0, so no version pin is needed. Also wrap the shell
startup update check in try/except, matching version_command and
base_command_help, so a failed update check can never block the shell.
fix(cli): ksm shell crash from update-checker 1.0.0 keyword-only check() (KSM-1005)
…t output

The KSM-981 links output rendered one bare-UID row per link: settings
self-links (meta/ai_settings/jit_settings, recordUid == the record's
own UID) were indistinguishable from real linked records, and link data
was never decoded - JSON output carried opaque base64/ciphertext blobs.
A pamUser with no linked records still showed a links table containing
its own UID.

- JSON: each link entry keeps the raw recordUid/data/path fields
  untouched and gains a "decoded" object via the core 17.3.0 typed
  accessor KeeperRecordLink.get_link_data(record_key) - plain link
  payloads are parsed and ai_settings/jit_settings are decrypted with
  the record key
- Text: the Links table now has three columns (Linked Record UID with
  a "(self)" label, Path, decoded Link Data) so PAM meta settings and
  AI/JIT configuration are distinguishable from links to other records
- keeper-secrets-manager-core pin bumped >=17.2.0 -> >=17.3.0
  (KeeperRecordLink/get_links only exist from 17.3.0)
- Link tests upgraded to live-shape fixtures (meta self-link,
  credential link with flags, data-less reference) asserting decoded
  JSON output and the labeled text table

Verified live against a QA PAM app: all 24 links across 14 records
render with decoded data, including decrypted ai/jit settings.
fix(cli): KSM-1015 decode link data and label self-links in secret get output
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.
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.

4 participants