Improve docs for v3 auth

In preparation to add functional tests for v3 auth, this
change proposes to detail the method docs, because the
tests need to be based on them.

Change-Id: Idc60cb077d7e403a47cf9d6ad72f9d1a215c3f3b
Partial-Bug: #1330769
This commit is contained in:
Nisha Yadav 2016-08-16 20:00:15 +05:30
parent 63d039032c
commit 9a8b3d6dc6
1 changed files with 25 additions and 11 deletions

View File

@ -20,14 +20,15 @@ class Project(base.Resource):
Attributes: Attributes:
* id: a uuid that identifies the project * id: a uuid that identifies the project
* name: project name * name: the name of the project
* description: project description * description: a description of the project
* enabled: boolean to indicate if project is enabled * enabled: determines whether the project is enabled
* parent_id: a uuid representing this project's parent in hierarchy * parent_id: a uuid that identifies the specified project's parent
* parents: a list or a structured dict containing the parents of this in hierarchy
project in the hierarchy * parents: a list or a structured dict containing the parents of the
* subtree: a list or a structured dict containing the subtree of this specified project in the hierarchy
project in the hierarchy * subtree: a list or a structured dict containing the subtree of the
specified project in the hierarchy
""" """
@ -37,6 +38,9 @@ class Domain(base.Resource):
Attributes: Attributes:
* id: a uuid that identifies the domain * id: a uuid that identifies the domain
* name: the name of the domain
* description: a description of the domain
* enabled: determines whether the domain is enabled
""" """
@ -46,7 +50,7 @@ class Domain(base.Resource):
class AuthManager(base.Manager): class AuthManager(base.Manager):
"""Retrieve auth context specific information. """Retrieve auth context specific information.
The information returned by the /auth routes are entirely dependant on the The information returned by the auth routes is entirely dependant on the
authentication information provided by the user. authentication information provided by the user.
""" """
@ -54,7 +58,12 @@ class AuthManager(base.Manager):
_DOMAINS_URL = '/auth/domains' _DOMAINS_URL = '/auth/domains'
def projects(self): def projects(self):
"""List projects that this token can be rescoped to.""" """List projects that the specified token can be rescoped to.
:returns: a list of projects.
:rtype: list of :class:`keystoneclient.v3.projects.Project`
"""
try: try:
return self._list(self._PROJECTS_URL, return self._list(self._PROJECTS_URL,
'projects', 'projects',
@ -67,7 +76,12 @@ class AuthManager(base.Manager):
endpoint_filter=endpoint_filter) endpoint_filter=endpoint_filter)
def domains(self): def domains(self):
"""List Domains that this token can be rescoped to.""" """List Domains that the specified token can be rescoped to.
:returns: a list of domains.
:rtype: list of :class:`keystoneclient.v3.domains.Domain`.
"""
try: try:
return self._list(self._DOMAINS_URL, return self._list(self._DOMAINS_URL,
'domains', 'domains',