summaryrefslogtreecommitdiffstats
path: root/nova/auth
diff options
context:
space:
mode:
authorVishvananda Ishaya <vishvananda@gmail.com>2010-08-06 14:27:48 -0700
committerVishvananda Ishaya <vishvananda@gmail.com>2010-08-06 14:27:48 -0700
commite6e5c8e0680b2aa8a243c3f82bcac8e484f78e3b (patch)
tree74f9692816affffedab0d03e9fba44fc75112d2f /nova/auth
parent024ad9951dcf33f5a3468e9a790f1636770b2837 (diff)
parent85b73194c2f8432a7e9ab5d24574746f209846ee (diff)
downloadnova-e6e5c8e0680b2aa8a243c3f82bcac8e484f78e3b.tar.gz
nova-e6e5c8e0680b2aa8a243c3f82bcac8e484f78e3b.tar.xz
nova-e6e5c8e0680b2aa8a243c3f82bcac8e484f78e3b.zip
merged trunk
Diffstat (limited to 'nova/auth')
-rw-r--r--nova/auth/manager.py10
-rw-r--r--nova/auth/signer.py5
2 files changed, 10 insertions, 5 deletions
diff --git a/nova/auth/manager.py b/nova/auth/manager.py
index cf920d607..d44ed52b2 100644
--- a/nova/auth/manager.py
+++ b/nova/auth/manager.py
@@ -24,7 +24,6 @@ import logging
import os
import shutil
import string
-import sys
import tempfile
import uuid
import zipfile
@@ -239,8 +238,7 @@ class AuthManager(object):
def __new__(cls, *args, **kwargs):
"""Returns the AuthManager singleton"""
if not cls._instance:
- cls._instance = super(AuthManager, cls).__new__(
- cls, *args, **kwargs)
+ cls._instance = super(AuthManager, cls).__new__(cls)
return cls._instance
def __init__(self, driver=None, *args, **kwargs):
@@ -333,6 +331,12 @@ class AuthManager(object):
raise exception.NotAuthorized('Signature does not match')
return (user, project)
+ def get_access_key(self, user, project):
+ """Get an access key that includes user and project"""
+ if not isinstance(user, User):
+ user = self.get_user(user)
+ return "%s:%s" % (user.access, Project.safe_id(project))
+
def is_superuser(self, user):
"""Checks for superuser status, allowing user to bypass rbac
diff --git a/nova/auth/signer.py b/nova/auth/signer.py
index 7d7471575..634f22f0d 100644
--- a/nova/auth/signer.py
+++ b/nova/auth/signer.py
@@ -34,7 +34,7 @@
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABIL-
# ITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT
-# SHALL THE AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+# SHALL THE AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
# WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
# IN THE SOFTWARE.
@@ -48,7 +48,8 @@ import hashlib
import hmac
import logging
import urllib
-import boto.utils
+import boto # NOTE(vish): for new boto
+import boto.utils # NOTE(vish): for old boto
from nova.exception import Error