Merge "Improve docs for v3 tokens"

This commit is contained in:
Jenkins
2016-08-19 20:26:54 +00:00
committed by Gerrit Code Review

View File

@@ -32,9 +32,9 @@ class TokenManager(object):
def revoke_token(self, token): def revoke_token(self, token):
"""Revoke a token. """Revoke a token.
:param token: Token to be revoked. This can be an instance of :param token: The token to be revoked.
:py:class:`keystoneclient.access.AccessInfo` or a string :type token: str or :class:`keystoneclient.access.AccessInfo`
token_id.
""" """
token_id = _calc_id(token) token_id = _calc_id(token)
headers = {'X-Subject-Token': token_id} headers = {'X-Subject-Token': token_id}
@@ -45,11 +45,12 @@ class TokenManager(object):
"""Get revoked tokens list. """Get revoked tokens list.
:param bool audit_id_only: If true, the server is requested to not send :param bool audit_id_only: If true, the server is requested to not send
token IDs. **New in version 2.2.0.** token IDs, but only audit IDs instead.
**New in version 2.2.0.**
:returns: A dict containing ``signed`` which is a CMS formatted string :returns: A dict containing ``signed`` which is a CMS formatted string
if the server signed the response. If `audit_id_only` then the if the server signed the response. If `audit_id_only` is true
response may be a dict containing ``revoked`` which is the list of then the response may be a dict containing ``revoked`` which
token audit IDs and expiration times. is the list of token audit IDs and expiration times.
:rtype: dict :rtype: dict
""" """
@@ -63,11 +64,12 @@ class TokenManager(object):
def get_token_data(self, token, include_catalog=True): def get_token_data(self, token, include_catalog=True):
"""Fetch the data about a token from the identity server. """Fetch the data about a token from the identity server.
:param str token: The token id. :param str token: The ID of the token to be fetched.
:param bool include_catalog: If False, the response is requested to not :param bool include_catalog: Whether the service catalog should be
include the catalog. included in the response.
:rtype: dict :rtype: dict
""" """
headers = {'X-Subject-Token': token} headers = {'X-Subject-Token': token}
@@ -82,13 +84,12 @@ class TokenManager(object):
def validate(self, token, include_catalog=True): def validate(self, token, include_catalog=True):
"""Validate a token. """Validate a token.
:param token: Token to be validated. This can be an instance of :param token: The token to be validated.
:py:class:`keystoneclient.access.AccessInfo` or a string :type token: str or :class:`keystoneclient.access.AccessInfo`
token_id.
:param include_catalog: If False, the response is requested to not :param include_catalog: If False, the response is requested to not
include the catalog. include the catalog.
:rtype: :py:class:`keystoneclient.access.AccessInfoV3` :rtype: :class:`keystoneclient.access.AccessInfoV3`
""" """
token_id = _calc_id(token) token_id = _calc_id(token)