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

Function get_record_key

keepercommander/nested_share_folder/common.py:36–47  ·  view source on GitHub ↗

Retrieve the unencrypted record key from nested_share_records or record_cache.

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

Source from the content-addressed store, hash-verified

34
35
36def get_record_key(params, record_uid: str, raise_on_missing: bool = True) -> Optional[bytes]:
37 """Retrieve the unencrypted record key from nested_share_records or record_cache."""
38 for cache in (getattr(params, 'nested_share_records', {}),
39 getattr(params, 'record_cache', {})):
40 obj = cache.get(record_uid)
41 if obj and 'record_key_unencrypted' in obj:
42 return obj['record_key_unencrypted']
43 if raise_on_missing:
44 raise ValueError(
45 f"Record key not found for record {record_uid}. "
46 f"Record may not exist or is not accessible.")
47 return None
48
49
50def get_record_from_cache(params, record_uid: str) -> Optional[dict]:

Callers 9

classify_secretMethod · 0.85
submit_access_requestFunction · 0.85
_decrypt_paramMethod · 0.85
_build_record_metadataFunction · 0.85
move_record_v3Function · 0.85
update_record_v3Function · 0.85

Calls 1

getMethod · 0.80

Tested by

no test coverage detected