Skip to content

KC-1335, KC-1336: Fix nsf-mkdir parent UID path resolution and get to return consistent folder JSON by name vs UID#2184

Merged
sk-keeper merged 1 commit into
releasefrom
nsf-mkdir-and-get-command-fix
Jul 1, 2026
Merged

KC-1335, KC-1336: Fix nsf-mkdir parent UID path resolution and get to return consistent folder JSON by name vs UID#2184
sk-keeper merged 1 commit into
releasefrom
nsf-mkdir-and-get-command-fix

Conversation

@sshrushanth-ks

Copy link
Copy Markdown
Contributor

Summary

Fixes nsf-mkdir and get --format json folder behavior. nsf-mkdir now resolves existing parent folder UIDs in paths instead of creating a folder named after the UID, while name-based paths continue to work. get returns the same folder JSON schema whether the folder is looked up by name or UID.

Changes

  • Added _resolve_segment() to resolve known NSF folder UIDs globally before falling back to name lookup via _find_existing_child()
  • Prevents paths like tY6D-RanxY252zzBY_xU4A/My Child Folder from creating a folder named after the UID
  • Name-based paths (e.g. Engineering/New Folder KD 1 June) still resolve parent folders by name and create intermediate segments when needed
  • Updated nsf-mkdir parser help to document parent segments as folder names or UIDs
  • Added/updated unit tests in test_nested_share_folder.py (test_mkdir_resolves_parent_uid_in_path, name-path and intermediate-segment cases)
  • Pointed mkdir test mocks at folder_commands._nsf.create_folder_v3 to avoid lazy-import caching issues
  • When a single folder is matched by name, recurse into execute() with the resolved folder UID instead of building a minimal inline JSON payload
  • Name and UID lookups now share the same folder JSON builder (classic_folder, path, parent_uid, folder, records, etc.)
  • Added test_get_user_folder_json_consistent_by_name_and_uid in test_command_record.py

… return consistent folder JSON by name vs UID (#2178)

* Fix nsf-mkdir to reject UID path segments and get to return consistent folder JSON by name vs UID

* KC-1335, KC-1336: Fix nsf-mkdir parent UID path resolution and get folder JSON consistency

nsf-mkdir now resolves existing parent folder UIDs in paths instead of treating them as literal folder names. get --format json returns the same folder schema whether the folder is looked up by name or UID.

* Align get folder detail output with JSON schema

---------

Co-authored-by: amangalampalli-ks <amangalampalli@keepersecurity.com>
@sshrushanth-ks sshrushanth-ks self-assigned this Jul 1, 2026
@sshrushanth-ks sshrushanth-ks marked this pull request as ready for review July 1, 2026 13:16
@sk-keeper sk-keeper merged commit 9d5ed3b into release Jul 1, 2026
4 checks passed
@sk-keeper sk-keeper deleted the nsf-mkdir-and-get-command-fix branch July 1, 2026 17:19
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