diff --git a/kitty/options/definition.py b/kitty/options/definition.py index f0d794873..26cbfaf86 100644 --- a/kitty/options/definition.py +++ b/kitty/options/definition.py @@ -2705,6 +2705,11 @@ To get a list of available actions, run:: kitty @ -h +A set of actions to be allowed when no password is sent can be specified by using an empty +password, for example:: + + remote_control_password "" *-colors + Finally, the path to a python module can be specified that provides a function :code:`is_cmd_allowed` that is used to check every remote control command. See :ref:`rc_custom_auth` for details. For example:: diff --git a/kitty/remote_control.py b/kitty/remote_control.py index 2e02c601f..6b6d24c6b 100644 --- a/kitty/remote_control.py +++ b/kitty/remote_control.py @@ -137,7 +137,11 @@ user_password_allowed: Dict[str, bool] = {} def is_cmd_allowed(pcmd: Dict[str, Any], window: Optional['Window'], from_socket: bool, extra_data: Dict[str, Any]) -> Optional[bool]: pw = pcmd.get('password', '') if not pw: - return False + auth_items = get_options().remote_control_password.get('') + if auth_items is None: + return False + pa = password_authorizer(auth_items) + return pa.is_cmd_allowed(pcmd, window, from_socket, extra_data) q = user_password_allowed.get(pw) if q is not None: return q