diff options
author | Ziad Sawalha <github@highbridgellc.com> | 2012-01-24 13:03:32 -0600 |
---|---|---|
committer | Vishvananda Ishaya <vishvananda@gmail.com> | 2012-02-03 11:21:27 -0800 |
commit | 6b532096f6c72627dccb32fa49e8045d6afbdc6d (patch) | |
tree | 70f47d8854d5bce1edfe0473b365e5cd2928c0ca | |
parent | fd7d07536bef5ed0412ecb42ab164b1808628b83 (diff) | |
download | nova-6b532096f6c72627dccb32fa49e8045d6afbdc6d.tar.gz nova-6b532096f6c72627dccb32fa49e8045d6afbdc6d.tar.xz nova-6b532096f6c72627dccb32fa49e8045d6afbdc6d.zip |
Use Keystone Extension Syntax for EC2 Creds
- Syntax is OS-KSEC2:ec2Credentials (not ec2Credentials)
- adds to fix for bug 917408
- Syntax also requires a call to /tokens instead of /ec2tokens
- Changes are compatible (old syntax supported)
- Warning will be issued to log if URL syntax is old
Change-Id: I5ff9d1643122de2f383517e60f15852720c54490
-rw-r--r-- | Authors | 1 | ||||
-rw-r--r-- | nova/api/ec2/__init__.py | 29 |
2 files changed, 22 insertions, 8 deletions
@@ -170,3 +170,4 @@ Yuriy Taraday <yorik.sar@gmail.com> Zed Shaw <zedshaw@zedshaw.com> Zhixue Wu <Zhixue.Wu@citrix.com> Zhongyue Luo <lzyeval@gmail.com> +Ziad Sawalha <github@highbridgellc.com> diff --git a/nova/api/ec2/__init__.py b/nova/api/ec2/__init__.py index dfcddbc4e..3ee89c9c2 100644 --- a/nova/api/ec2/__init__.py +++ b/nova/api/ec2/__init__.py @@ -185,14 +185,27 @@ class EC2Token(wsgi.Middleware): # Not part of authentication args auth_params.pop('Signature') - # Authenticate the request. - creds = {'ec2Credentials': {'access': access, - 'signature': signature, - 'host': req.host, - 'verb': req.method, - 'path': req.path, - 'params': auth_params, - }} + if "ec2" in FLAGS.keystone_ec2_url: + LOG.warning("Configuration setting for keystone_ec2_url needs " + "to be updated to /tokens only. The /ec2 prefix is " + "being deprecated") + # Authenticate the request. + creds = {'ec2Credentials': {'access': access, + 'signature': signature, + 'host': req.host, + 'verb': req.method, + 'path': req.path, + 'params': auth_params, + }} + else: + # Authenticate the request. + creds = {'auth': {'OS-KSEC2:ec2Credentials': {'access': access, + 'signature': signature, + 'host': req.host, + 'verb': req.method, + 'path': req.path, + 'params': auth_params, + }}} creds_json = utils.dumps(creds) headers = {'Content-Type': 'application/json'} |