summaryrefslogtreecommitdiff
path: root/users/test/integration/api
diff options
context:
space:
mode:
authorjessib <jessib@riseup.net>2012-10-08 11:05:17 -0700
committerjessib <jessib@riseup.net>2012-10-08 11:05:17 -0700
commit8f100d3c03a6f554e703c5d0b2fe221958424c26 (patch)
tree77e90f53d05fecefa91adf89a3c35f19e277996b /users/test/integration/api
parentf77301824c42bdd4559a0b0e58b8f3c26f239643 (diff)
parentf5aea5347601c3500bb3670971d44995c35c3c7b (diff)
Merge branch 'release-0.1.0' into help_develop
Conflicts: .gitignore
Diffstat (limited to 'users/test/integration/api')
-rwxr-xr-xusers/test/integration/api/python/flow_with_srp.py18
1 files changed, 9 insertions, 9 deletions
diff --git a/users/test/integration/api/python/flow_with_srp.py b/users/test/integration/api/python/flow_with_srp.py
index 3bbbc71..0a11aec 100755
--- a/users/test/integration/api/python/flow_with_srp.py
+++ b/users/test/integration/api/python/flow_with_srp.py
@@ -16,24 +16,24 @@ def id_generator(size=6, chars=string.ascii_uppercase + string.digits):
return ''.join(random.choice(chars) for x in range(size))
# using globals for a start
-server = 'http://localhost:3000'
+server = 'http://springbok/1/'
login = id_generator()
password = id_generator() + id_generator()
-print ' username = "' + login + '"'
-print ' password = "' + password + '"'
+# print ' username = "' + login + '"'
+# print ' password = "' + password + '"'
# log the server communication
def print_and_parse(response):
# print response.request.method + ': ' + response.url
# print " " + json.dumps(response.request.data)
- print " -> " + response.text
+ # print " -> " + response.text
return json.loads(response.text)
def signup(session):
salt, vkey = srp.create_salted_verification_key( login, password, srp.SHA256, srp.NG_1024 )
- print ' salt = "' + binascii.hexlify(salt) + '"'
- print ' v = "' + binascii.hexlify(vkey) + '"'
+ # print ' salt = "' + binascii.hexlify(salt) + '"'
+ # print ' v = "' + binascii.hexlify(vkey) + '"'
user_params = {
'user[login]': login,
'user[password_verifier]': binascii.hexlify(vkey),
@@ -45,16 +45,16 @@ usr = srp.User( login, password, srp.SHA256, srp.NG_1024 )
def authenticate(session, login):
uname, A = usr.start_authentication()
- print ' aa = "' + binascii.hexlify(A) + '"'
+ # print ' aa = "' + binascii.hexlify(A) + '"'
params = {
'login': uname,
'A': binascii.hexlify(A)
}
init = print_and_parse(session.post(server + '/sessions', data = params))
# print ' b = "' + init['b'] + '"'
- print ' bb = "' + init['B'] + '"'
+ # print ' bb = "' + init['B'] + '"'
M = usr.process_challenge( safe_unhexlify(init['salt']), safe_unhexlify(init['B']) )
- print ' m = "' + binascii.hexlify(M) + '"'
+ # print ' m = "' + binascii.hexlify(M) + '"'
return session.put(server + '/sessions/' + login,
data = {'client_auth': binascii.hexlify(M)})