Allow specifying allowed actions when no password is sent
This commit is contained in:
parent
65fc61a507
commit
1619687d1d
@ -2705,6 +2705,11 @@ To get a list of available actions, run::
|
|||||||
|
|
||||||
kitty @ -h
|
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`
|
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::
|
that is used to check every remote control command. See :ref:`rc_custom_auth` for details. For example::
|
||||||
|
|
||||||
|
|||||||
@ -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]:
|
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', '')
|
pw = pcmd.get('password', '')
|
||||||
if not pw:
|
if not pw:
|
||||||
|
auth_items = get_options().remote_control_password.get('')
|
||||||
|
if auth_items is None:
|
||||||
return False
|
return False
|
||||||
|
pa = password_authorizer(auth_items)
|
||||||
|
return pa.is_cmd_allowed(pcmd, window, from_socket, extra_data)
|
||||||
q = user_password_allowed.get(pw)
|
q = user_password_allowed.get(pw)
|
||||||
if q is not None:
|
if q is not None:
|
||||||
return q
|
return q
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user