Coverage for /home/antoine/projects/xpra-git/dist/python3/lib64/python/xpra/client/auth/env_handler.py : 80%
Hot-keys on this page
r m x p toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
1# This file is part of Xpra.
2# Copyright (C) 2019 Antoine Martin <antoine@xpra.org>
3# Xpra is released under the terms of the GNU GPL v2, or, at your option, any
4# later version. See the file COPYING for details.
6import os
9class Handler:
11 def __init__(self, client, **kwargs):
12 self.client = client
13 self.var_name = kwargs.pop("name", "XPRA_PASSWORD")
15 def __repr__(self):
16 return "env"
18 def get_digest(self) -> str:
19 return None
21 def handle(self, packet) -> bool:
22 password = os.environ.get(self.var_name)
23 if not password:
24 return False
25 self.client.send_challenge_reply(packet, password)
26 return True