diff options
| author | kali <kali@leap.se> | 2012-10-23 00:34:39 +0900 | 
|---|---|---|
| committer | kali <kali@leap.se> | 2012-10-23 00:34:39 +0900 | 
| commit | 47a9a04145e30476c162a1d76d4d8b4b360de0bd (patch) | |
| tree | b614d225d3a3f8459c7abebc8032b2d61133fb5a /src/leap | |
| parent | 5126ffe2d8f468dfba9376b450cc243ea62219e6 (diff) | |
allow to test auth from cli
Diffstat (limited to 'src/leap')
| -rw-r--r-- | src/leap/base/auth.py | 11 | 
1 files changed, 6 insertions, 5 deletions
diff --git a/src/leap/base/auth.py b/src/leap/base/auth.py index 7d99a7fe..5a9ebe1d 100644 --- a/src/leap/base/auth.py +++ b/src/leap/base/auth.py @@ -246,13 +246,14 @@ def magic_srpauth(fn):  if __name__ == "__main__": +    import sys +    user = sys.argv[1] +    passwd = sys.argv[2] -    TEST_USER = "test1" -    TEST_PASS = "1234" - -    @srpauth_protected(user=TEST_USER, passwd=TEST_PASS) +    @srpauth_protected(user=user, passwd=passwd)      def test_srp_protected_get(*args, **kwargs):          req = requests.get(*args, **kwargs) -        print req.content +        req.raise_for_status +        #print req.content      test_srp_protected_get('http://springbok/1/cert')  | 
