Merge "adjust to {SHA1} convention for token"

This commit is contained in:
Jenkins 2014-06-17 07:10:45 +00:00 committed by Gerrit Code Review
commit d07699de84
2 changed files with 4 additions and 4 deletions

View File

@ -40,7 +40,7 @@ from novaclient.openstack.common import network_utils
from novaclient import service_catalog
from novaclient import utils
SENSITIVE_HEADERS = ('X-Auth-Token')
SENSITIVE_HEADERS = ('X-Auth-Token',)
class _ClientConnectionPool(object):
@ -169,7 +169,7 @@ class HTTPClient(object):
v = value.encode('utf-8')
h = hashlib.sha1(v)
d = h.hexdigest()
return name, "SHA1(%s)" % d
return name, "{SHA1}%s" % d
else:
return name, value

View File

@ -349,10 +349,10 @@ class ClientTest(utils.TestCase):
self.assertIn("REQ: curl -i '/foo' -X GET", output)
self.assertIn(
"REQ: curl -i '/foo' -X GET -H "
'"X-Auth-Token: SHA1(b42162b6ffdbd7c3c37b7c95b7ba9f51dda0236d)"',
'"X-Auth-Token: {SHA1}b42162b6ffdbd7c3c37b7c95b7ba9f51dda0236d"',
output)
self.assertIn(
"REQ: curl -i '/foo' -X GET -H "
'"X-Auth-Token: SHA1(b42162b6ffdbd7c3c37b7c95b7ba9f51dda0236d)"'
'"X-Auth-Token: {SHA1}b42162b6ffdbd7c3c37b7c95b7ba9f51dda0236d"'
' -H "X-Foo: bar"',
output)