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

Function get_keeper_server_hostname

keepercommander/constants.py:435–447  ·  view source on GitHub ↗

Return a bare hostname from ``params.server`` / config ``server`` when the value is a full URL (https://qa.keepersecurity.com). Otherwise return the string unchanged. Used for krelay / ICE hostnames where a scheme must not be present.

(server)

Source from the content-addressed store, hash-verified

433
434
435def get_keeper_server_hostname(server):
436 """
437 Return a bare hostname from ``params.server`` / config ``server`` when the value
438 is a full URL (https://qa.keepersecurity.com). Otherwise return the string unchanged.
439 Used for krelay / ICE hostnames where a scheme must not be present.
440 """
441 if not server:
442 return server
443 if server.startswith("http://") or server.startswith("https://"):
444 parsed_host = urlparse(server).hostname
445 if parsed_host:
446 return parsed_host
447 return server
448
449def get_keeper_host_for_services(server_hostname):
450 """

Callers 2

executeMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected