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

Method execute

keepercommander/commands/utils.py:1730–1756  ·  view source on GitHub ↗
(self, params, **kwargs)

Source from the content-addressed store, hash-verified

1728 return False
1729
1730 def execute(self, params, **kwargs): # type: (KeeperParams, any) -> any
1731 action = kwargs.get('action')
1732 if action == 'add':
1733 proxy_server = kwargs.get('address') # type: str
1734 if proxy_server:
1735 is_valid = False
1736 for prefix in {'socks5', 'http', 'https'}:
1737 if proxy_server.startswith(prefix):
1738 is_valid = True
1739 break
1740 if not is_valid:
1741 logging.warning('Proxy server "%s" does not appear to be a valid proxy URL', proxy_server)
1742 proxy_server = ''
1743 else:
1744 logging.warning('"add" action requires "proxy" parameter.')
1745
1746 if proxy_server:
1747 params.proxy = proxy_server
1748 else:
1749 return
1750 elif action == 'remove':
1751 params.proxy = None
1752
1753 if params.proxy:
1754 logging.info('Proxy server: %s', params.proxy)
1755 else:
1756 logging.info('Proxy is not configured.')
1757
1758
1759class LoginCommand(Command):

Callers

nothing calls this directly

Calls 3

warningMethod · 0.80
getMethod · 0.45
infoMethod · 0.45

Tested by

no test coverage detected