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

Function get_folder_key

keepercommander/nested_share_folder/common.py:22–33  ·  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

20# ═══════════════════════════════════════════════════════════════════════════
21
22def get_folder_key(params, folder_uid: str, raise_on_missing: bool = True) -> Optional[bytes]:
23 """Retrieve the unencrypted folder key from nested_share_folders or subfolder_cache."""
24 for cache in (getattr(params, 'nested_share_folders', {}),
25 getattr(params, 'subfolder_cache', {})):
26 obj = cache.get(folder_uid)
27 if obj and 'folder_key_unencrypted' in obj:
28 return obj['folder_key_unencrypted']
29 if raise_on_missing:
30 raise ValueError(
31 f"Folder key not found for folder {folder_uid}. "
32 f"Try running 'sync-down' first.")
33 return None
34
35
36def get_record_key(params, record_uid: str, raise_on_missing: bool = True) -> Optional[bytes]:

Callers 14

classify_secretMethod · 0.85
_send_nsf_batchesMethod · 0.85
_create_recordsMethod · 0.85
_build_record_metadataFunction · 0.85
move_record_v3Function · 0.85
_build_update_dataFunction · 0.85
grant_folder_access_v3Function · 0.85

Calls 1

getMethod · 0.80

Tested by

no test coverage detected