-
-
Notifications
You must be signed in to change notification settings - Fork 178
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* restore authentication using XPRA_PASSWORD env var, directly for client side * add env_auth module * man page updates * ensure file auth modules use hmac and not xor! * var reference fixes (move auth code to sys auth so we can re-use it - but don't reference files there) * more unit test coverage git-svn-id: https://xpra.org/svn/Xpra/trunk@12334 3bb7dfac-3a0b-4e04-842a-767bc560f471
- Loading branch information
Showing
9 changed files
with
190 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# This file is part of Xpra. | ||
# Copyright (C) 2016 Antoine Martin <[email protected]> | ||
# Xpra is released under the terms of the GNU GPL v2, or, at your option, any | ||
# later version. See the file COPYING for details. | ||
|
||
import os | ||
from xpra.server.auth.sys_auth_base import SysAuthenticator, init | ||
|
||
assert init | ||
|
||
|
||
class Authenticator(SysAuthenticator): | ||
|
||
def __init__(self, username, **kwargs): | ||
SysAuthenticator.__init__(self, username) | ||
self.var_name = kwargs.get("name", "XPRA_PASSWORD") | ||
self.authenticate = self.authenticate_hmac | ||
|
||
def __repr__(self): | ||
return "env" | ||
|
||
def get_challenge(self): | ||
return SysAuthenticator.get_challenge(self, mac="hmac") | ||
|
||
def get_password(self): | ||
return os.environ.get(self.var_name) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# This file is part of Xpra. | ||
# Copyright (C) 2016 Antoine Martin <[email protected]> | ||
# Xpra is released under the terms of the GNU GPL v2, or, at your option, any | ||
# later version. See the file COPYING for details. | ||
|
||
from xpra.server.auth.sys_auth_base import SysAuthenticator, init | ||
|
||
assert init | ||
|
||
|
||
class Authenticator(SysAuthenticator): | ||
|
||
def __init__(self, username, **kwargs): | ||
print("kwargs=%s" % (kwargs, )) | ||
SysAuthenticator.__init__(self, username) | ||
self.value = kwargs.get("value") | ||
self.authenticate = self.authenticate_hmac | ||
|
||
def __repr__(self): | ||
return "password" | ||
|
||
def get_challenge(self): | ||
return SysAuthenticator.get_challenge(self, mac="hmac") | ||
|
||
def get_password(self): | ||
return self.value |
Oops, something went wrong.