← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1673301] [NEW] [api] In the API "GET /v3/auth/catalog", the parameter "X-Subject-Token" is unused, it is redundant.

 

Public bug reported:

Like the summary said, "X-Subject-Token" is unused, we need remove it
from API reference document. The source code about API follows is below:

@controller.protected()
def get_auth_projects(self, request):
    user_id = request.auth_context.get('user_id')
    group_ids = request.auth_context.get('group_ids')

    user_refs = []
    if user_id:
        try:
            user_refs = self.assignment_api.list_projects_for_user(user_id)
        except exception.UserNotFound:  # nosec
            # federated users have an id but they don't link to anything
            pass

    grp_refs = []
    if group_ids:
        grp_refs = self.assignment_api.list_projects_for_groups(group_ids)

    refs = self._combine_lists_uniquely(user_refs, grp_refs)
    return resource_controllers.ProjectV3.wrap_collection(
        request.context_dict, refs)

"request.auth_context" is based on "X-Auth-Token", not "X-Subject-
Token".

** Affects: keystone
     Importance: Undecided
     Assignee: ZhangHongtao (zhanghongtao)
         Status: New

** Description changed:

  Like the summary said, "X-Subject-Token" is unused, we need remove it
  from API reference document. The source code about API follows is below:
  
-     @controller.protected()
-     def get_auth_projects(self, request):
-         user_id = request.auth_context.get('user_id')
-         group_ids = request.auth_context.get('group_ids')
+ @controller.protected()
+ def get_auth_projects(self, request):
+     user_id = request.auth_context.get('user_id')
+     group_ids = request.auth_context.get('group_ids')
  
-         user_refs = []
-         if user_id:
-             try:
-                 user_refs = self.assignment_api.list_projects_for_user(user_id)
-             except exception.UserNotFound:  # nosec
-                 # federated users have an id but they don't link to anything
-                 pass
+     user_refs = []
+     if user_id:
+         try:
+             user_refs = self.assignment_api.list_projects_for_user(user_id)
+         except exception.UserNotFound:  # nosec
+             # federated users have an id but they don't link to anything
+             pass
  
-         grp_refs = []
-         if group_ids:
-             grp_refs = self.assignment_api.list_projects_for_groups(group_ids)
+     grp_refs = []
+     if group_ids:
+         grp_refs = self.assignment_api.list_projects_for_groups(group_ids)
  
-         refs = self._combine_lists_uniquely(user_refs, grp_refs)
-         return resource_controllers.ProjectV3.wrap_collection(
-             request.context_dict, refs)
-             
- "request.auth_context" is based on "X-Auth-Token", not "X-Subject-Token".
+     refs = self._combine_lists_uniquely(user_refs, grp_refs)
+     return resource_controllers.ProjectV3.wrap_collection(
+         request.context_dict, refs)
+ 
+ "request.auth_context" is based on "X-Auth-Token", not "X-Subject-
+ Token".

** Changed in: keystone
     Assignee: (unassigned) => ZhangHongtao (zhanghongtao)

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to OpenStack Identity (keystone).
https://bugs.launchpad.net/bugs/1673301

Title:
  [api] In the API "GET /v3/auth/catalog", the parameter "X-Subject-
  Token" is unused, it is redundant.

Status in OpenStack Identity (keystone):
  New

Bug description:
  Like the summary said, "X-Subject-Token" is unused, we need remove it
  from API reference document. The source code about API follows is
  below:

  @controller.protected()
  def get_auth_projects(self, request):
      user_id = request.auth_context.get('user_id')
      group_ids = request.auth_context.get('group_ids')

      user_refs = []
      if user_id:
          try:
              user_refs = self.assignment_api.list_projects_for_user(user_id)
          except exception.UserNotFound:  # nosec
              # federated users have an id but they don't link to anything
              pass

      grp_refs = []
      if group_ids:
          grp_refs = self.assignment_api.list_projects_for_groups(group_ids)

      refs = self._combine_lists_uniquely(user_refs, grp_refs)
      return resource_controllers.ProjectV3.wrap_collection(
          request.context_dict, refs)

  "request.auth_context" is based on "X-Auth-Token", not "X-Subject-
  Token".

To manage notifications about this bug go to:
https://bugs.launchpad.net/keystone/+bug/1673301/+subscriptions


Follow ups