Hide keyboard shortcuts

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. 

5 

6 

7from xpra.net.digest import get_salt, choose_digest 

8from xpra.util import typedict 

9 

10 

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 

17 

18 def requires_challenge(self) -> bool: 

19 return True 

20 

21 def get_challenge(self, digests): 

22 self.challenge_sent = True 

23 return get_salt(), choose_digest(digests) 

24 

25 def choose_salt_digest(self, digest_modes): 

26 return choose_digest(digest_modes) 

27 

28 def get_uid(self): 

29 return -1 

30 

31 def get_gid(self): 

32 return -1 

33 

34 def get_passwords(self): 

35 return () 

36 

37 def get_password(self): 

38 return None 

39 

40 def authenticate(self, caps : typedict) -> bool: 

41 return False 

42 

43 def get_sessions(self): 

44 return None 

45 

46 def __repr__(self): 

47 return "reject"