Coverage for /home/antoine/projects/xpra-git/dist/python3/lib64/python/xpra/server/auth/env_auth.py : 100%
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) 2016-2020 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
7from xpra.server.auth.sys_auth_base import SysAuthenticator
10class Authenticator(SysAuthenticator):
12 def __init__(self, username, **kwargs):
13 self.var_name = kwargs.pop("name", "XPRA_PASSWORD")
14 super().__init__(username, **kwargs)
15 self.authenticate_check = self.authenticate_hmac
17 def __repr__(self):
18 return "env"
20 def get_password(self) -> str:
21 return os.environ.get(self.var_name)