Skip to content

Match shared folder by UID in import - #2334

Open
lthievenaz-keeper wants to merge 3 commits into
Keeper-Security:releasefrom
lthievenaz-keeper:feat-import/match-sf-by-uid
Open

Match shared folder by UID in import#2334
lthievenaz-keeper wants to merge 3 commits into
Keeper-Security:releasefrom
lthievenaz-keeper:feat-import/match-sf-by-uid

Conversation

@lthievenaz-keeper

Copy link
Copy Markdown
Contributor

Builds on top of PR #2326 (--unsafe flag for apply-membership)

Problem

During an import (e.g. JSON), shared folders are matched by path, not UID.
If a vault has a shared folder with the same UID, but different path (e.g. the shared folder is nested in a personal folder), the import will create a new shared folder.

Changes

  • If the import includes a UID which matches that of a shared folder in the vault, the folder will not be duplicated.
  • If the path is different, the existing folder will be moved to the new path.

Limitations

Currently only wired up for Classic folders, awaiting the upcoming NSF folder-move API (#2324) to apply this to NSF.

Sample test

{
  "shared_folders": [
    {
      "path": "Root folder\\Test_SF",
      "uid": "sue7EIW-KQxYLyhbCE-BQA",
      "manage_users": false,
      "manage_records": false,
      "can_edit": false,
      "can_share": false,
      "permissions": []
    },
	{
      "path": "Test_SF2",
	  "uid": "fG_yHn_uTlbWyEY2yslXRw",
      "manage_users": true,
      "manage_records": true,
      "can_edit": false,
      "can_share": true,
      "permissions": []
    }
  ]
}
  • Import these folders with import --format json
  • Make sure to update the UIDs so they match with the generated folders in the vault
  • Run new imports, with updated paths for the folders (the import will move the folder into / out of their existing personal folder nesting.

Add unsafe flag and manual documentation.
Unsafe flag allows the apply-membership to remove yourself from the folders if set.
Currently, apply-membership --full-sync will remove folder permissions so that it matches the JSON file, however it won't remove yourself.
Added --unsafe flag, which will allow removing yourself if you're not set on the folder permissions.
This can be useful:
- If the folder is only meant to be shared to your team and not you.
- To reproduce enterprise-push behavior with shared folders at scale
In import (e.g. JSON), shared folders are matched by path, not UID.
If a vault has a shared folder with the same UID, but different path (e.g. the shared folder is nested in a personal folder), the import will create a new shared folder.

This changes the import process so that if the import includes a UID which matches that of a shared folder in the vault, the folder will not be duplicated. If the path is different, the existing folder will be moved to the new path.

Currently only wired up for Classic folders, awaiting the upcoming NSF folder-move API (Keeper-Security#2324) to apply this to NSF.
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.

1 participant