Merge "Remove the redundant verification in OAuth1 authorization"
This commit is contained in:
commit
1d34614121
|
@ -394,16 +394,6 @@ class OAuthControllerV3(controller.V3Controller):
|
||||||
# create list of just the id's for the backend
|
# create list of just the id's for the backend
|
||||||
role_ids = list(authed_roles)
|
role_ids = list(authed_roles)
|
||||||
|
|
||||||
# verify the user has the project too
|
|
||||||
req_project_id = req_token['requested_project_id']
|
|
||||||
user_projects = self.assignment_api.list_projects_for_user(user_id)
|
|
||||||
for user_project in user_projects:
|
|
||||||
if user_project['id'] == req_project_id:
|
|
||||||
break
|
|
||||||
else:
|
|
||||||
msg = _("User is not a member of the requested project")
|
|
||||||
raise exception.Unauthorized(message=msg)
|
|
||||||
|
|
||||||
# finally authorize the token
|
# finally authorize the token
|
||||||
authed_token = self.oauth_api.authorize_request_token(
|
authed_token = self.oauth_api.authorize_request_token(
|
||||||
request_token_id, user_id, role_ids)
|
request_token_id, user_id, role_ids)
|
||||||
|
|
Loading…
Reference in New Issue