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

Function get_record

keepercommander/api.py:179–207  ·  view source on GitHub ↗

Return the referenced record cache

(params, record_uid)

Source from the content-addressed store, hash-verified

177
178
179def get_record(params, record_uid):
180 """Return the referenced record cache"""
181 record_uid = record_uid.strip()
182
183 if not record_uid:
184 logging.warning('No record UID provided')
185 return
186
187 if not params.record_cache:
188 logging.warning('No record cache. Sync down first.')
189 return
190
191 if record_uid not in params.record_cache:
192 logging.warning('Record UID %s not found in cache.' % record_uid)
193 return
194
195 cached_rec = params.record_cache[record_uid]
196 version = cached_rec.get('version', 2)
197
198 try:
199 rec = Record(record_uid)
200 data = json.loads(cached_rec['data_unencrypted'])
201 extra = json.loads(cached_rec['extra_unencrypted']) if cached_rec.get('extra_unencrypted') else None
202 rec.load(data, version=version, revision=cached_rec['revision'], extra=extra)
203 if not resolve_record_view_path(params, record_uid):
204 rec.mask_password()
205 return rec
206 except:
207 logging.error('**** Error decrypting record %s', record_uid)
208
209
210def is_shared_folder(params,shared_folder_uid):

Callers 4

search_recordsFunction · 0.70
prepare_recordFunction · 0.70
prepare_record_v3Function · 0.70
add_record_audit_dataFunction · 0.70

Calls 7

loadMethod · 0.95
mask_passwordMethod · 0.95
resolve_record_view_pathFunction · 0.85
warningMethod · 0.80
RecordClass · 0.70
getMethod · 0.45
errorMethod · 0.45

Tested by

no test coverage detected