MCPcopy Create free account
hub / github.com/Keeper-Security/Commander / get_folder_key

Function get_folder_key

keepercommander/nested_share_folder/common.py:66–77  ·  view source on GitHub ↗

Retrieve the unencrypted folder key from nested_share_folders or subfolder_cache.

(params, folder_uid: str, raise_on_missing: bool = True)

Source from the content-addressed store, hash-verified

64# ═══════════════════════════════════════════════════════════════════════════
65
66def get_folder_key(params, folder_uid: str, raise_on_missing: bool = True) -> Optional[bytes]:
67 """Retrieve the unencrypted folder key from nested_share_folders or subfolder_cache."""
68 for cache in (getattr(params, 'nested_share_folders', {}),
69 getattr(params, 'subfolder_cache', {})):
70 obj = cache.get(folder_uid)
71 if obj and 'folder_key_unencrypted' in obj:
72 return obj['folder_key_unencrypted']
73 if raise_on_missing:
74 raise ValueError(
75 f"Folder key not found for folder {folder_uid}. "
76 f"Try running 'sync-down' first.")
77 return None
78
79
80def get_record_key(params, record_uid: str, raise_on_missing: bool = True) -> Optional[bytes]:

Callers 15

build_nsf_record_addFunction · 0.85
classify_secretMethod · 0.85
_send_nsf_batchesMethod · 0.85
_create_recordsMethod · 0.85
_get_target_folderFunction · 0.85
_build_record_metadataFunction · 0.85
move_record_v3Function · 0.85
_build_update_dataFunction · 0.85

Calls 1

getMethod · 0.45

Tested by

no test coverage detected