Skip to content

Commit

Permalink
Stop returning correct password on api calls
Browse files Browse the repository at this point in the history
Captured invalid signature exception in authentication step, so that
the problem is not returning exception to user, revealing the real
password.
Fixes bug 868360.

Change-Id: Idb31f076a7b14309f0fda698261de816924da354
  • Loading branch information
Ahmad Hassan authored and viraptor committed Oct 5, 2011
1 parent 981f527 commit beee11e
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 9 deletions.
1 change: 1 addition & 0 deletions Authors
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
Aaron Lee <aaron.lee@rackspace.com>
Adam Gandelman <adamg@canonical.com>
Adam Johnson <adjohn@gmail.com>
Ahmad Hassan <ahmad.hassan@hp.com>
Alex Meade <alex.meade@rackspace.com>
Alexander Sakhnov <asakhnov@mirantis.com>
Andrey Brindeyev <abrindeyev@griddynamics.com>
Expand Down
3 changes: 2 additions & 1 deletion nova/api/ec2/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,8 @@ def __call__(self, req):
req.host,
req.path)
# Be explicit for what exceptions are 403, the rest bubble as 500
except (exception.NotFound, exception.NotAuthorized) as ex:
except (exception.NotFound, exception.NotAuthorized,
exception.InvalidSignature) as ex:
LOG.audit(_("Authentication Failure: %s"), unicode(ex))
raise webob.exc.HTTPForbidden()

Expand Down
10 changes: 2 additions & 8 deletions nova/auth/manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,11 +149,7 @@ def is_project_manager(self, project):
return AuthManager().is_project_manager(self, project)

def __repr__(self):
return "User('%s', '%s', '%s', '%s', %s)" % (self.id,
self.name,
self.access,
self.secret,
self.admin)
return "User('%s', '%s')" % (self.id, self.name)


class Project(AuthBase):
Expand Down Expand Up @@ -200,9 +196,7 @@ def get_credentials(self, user):
return AuthManager().get_credentials(user, self)

def __repr__(self):
return "Project('%s', '%s', '%s', '%s', %s)" % \
(self.id, self.name, self.project_manager_id, self.description,
self.member_ids)
return "Project('%s', '%s')" % (self.id, self.name)


class AuthManager(object):
Expand Down

0 comments on commit beee11e

Please # to comment.