Merge "adjust to {SHA1} convention for token"
This commit is contained in:
commit
d07699de84
novaclient
@ -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
|
||||
|
||||
|
@ -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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user