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

Function _fetch_server_key

keepercommander/rest_api.py:317–330  ·  view source on GitHub ↗
(context, host)

Source from the content-addressed store, hash-verified

315
316
317def _fetch_server_key(context, host): # type: (RestApiContext, str) -> SelfManagedServerKey
318 scheme = urlparse(context.server_base).scheme or 'https'
319 urls = (context.server_base + SERVER_KEY_ENDPOINT, f'{scheme}://{host}{LEGACY_SERVER_KEY_PATH}')
320 errors = []
321 for url in urls:
322 try:
323 key = _fetch_server_key_from(context, url)
324 except Exception as e:
325 errors.append(f'{url}: {e}')
326 continue
327 logging.info('Server key of %s: key ID %d, %s (fetched from %s)',
328 host, key.key_id, server_key_fingerprint(key.public_key), url)
329 return key
330 raise ValueError('; '.join(errors))
331
332
333def _environment_server_key(): # type: () -> Optional[SelfManagedServerKey]

Callers 1

Calls 3

_fetch_server_key_fromFunction · 0.85
server_key_fingerprintFunction · 0.85
infoMethod · 0.45

Tested by

no test coverage detected