Coverage for /home/antoine/projects/xpra-git/dist/python3/lib64/python/xpra/server/auth/reject_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) 2014-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.
7from xpra.net.digest import get_salt, choose_digest
8from xpra.util import typedict
11class Authenticator:
12 def __init__(self, username, **kwargs):
13 self.username = username
14 self.challenge_sent = False
15 self.prompt = kwargs.pop("prompt", "password")
16 self.passed = False
18 def requires_challenge(self) -> bool:
19 return True
21 def get_challenge(self, digests):
22 self.challenge_sent = True
23 return get_salt(), choose_digest(digests)
25 def choose_salt_digest(self, digest_modes):
26 return choose_digest(digest_modes)
28 def get_uid(self):
29 return -1
31 def get_gid(self):
32 return -1
34 def get_passwords(self):
35 return ()
37 def get_password(self):
38 return None
40 def authenticate(self, caps : typedict) -> bool:
41 return False
43 def get_sessions(self):
44 return None
46 def __repr__(self):
47 return "reject"