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

Function get_record_key

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

43
44
45def get_record_key(params, record_uid: str, raise_on_missing: bool = True) -> Optional[bytes]:
46 """Retrieve the unencrypted record key from nested_share_records or record_cache."""
47 for cache in (getattr(params, 'nested_share_records', {}),
48 getattr(params, 'record_cache', {})):
49 obj = cache.get(record_uid)
50 if obj and 'record_key_unencrypted' in obj:
51 return obj['record_key_unencrypted']
52 if raise_on_missing:
53 raise ValueError(
54 f"Record key not found for record {record_uid}. "
55 f"Record may not exist or is not accessible.")
56 return None
57
58
59def get_record_from_cache(params, record_uid: str) -> Optional[dict]:

Callers 10

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.45

Tested by

no test coverage detected