Skip to content

Commit

Permalink
Merge "Use unscoped token for scoping to project"
Browse files Browse the repository at this point in the history
  • Loading branch information
Jenkins authored and openstack-gerrit committed Jul 17, 2015
2 parents 3ee2bf7 + e4062e3 commit 49df21d
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
8 changes: 3 additions & 5 deletions openstack_auth/backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,11 +144,9 @@ def authenticate(self, auth_url=None, **kwargs):
request = kwargs.get('request')

if request:
# Check if token is automatically scoped to default_project
# grab the project from this token, to use as a default
# if no recent_project is found in the cookie
recent_project = request.COOKIES.get('recent_project',
unscoped_auth_ref.project_id)
# Grab recent_project found in the cookie, try to scope
# to the last project used.
recent_project = request.COOKIES.get('recent_project')

# if a most recent project was found, try using it first
if recent_project:
Expand Down
3 changes: 2 additions & 1 deletion openstack_auth/plugin/password.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ def get_plugin(self, auth_url=None, username=None, password=None,
return v3_auth.Password(auth_url=auth_url,
username=username,
password=password,
user_domain_name=user_domain_name)
user_domain_name=user_domain_name,
unscoped=True)

else:
return v2_auth.Password(auth_url=auth_url,
Expand Down
3 changes: 2 additions & 1 deletion openstack_auth/tests/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -496,7 +496,8 @@ def _create_password_auth(self, username=None, password=None, url=None):
return auth_v3.Password(auth_url=url,
password=password,
username=username,
user_domain_name=DEFAULT_DOMAIN)
user_domain_name=DEFAULT_DOMAIN,
unscoped=True)

def _create_token_auth(self, project_id, token=None, url=None):
if not token:
Expand Down

0 comments on commit 49df21d

Please sign in to comment.