keystoneclient.v3.contrib.oauth1 package¶
Submodules¶
keystoneclient.v3.contrib.oauth1.access_tokens module¶
- class keystoneclient.v3.contrib.oauth1.access_tokens.AccessToken(manager, info, loaded=False)¶
Bases:
Resource
- class keystoneclient.v3.contrib.oauth1.access_tokens.AccessTokenManager(client)¶
Bases:
CrudManager
Manager class for manipulating identity OAuth access tokens.
- create(consumer_key, consumer_secret, request_key, request_secret, verifier)¶
- resource_class¶
alias of
AccessToken
keystoneclient.v3.contrib.oauth1.auth module¶
- class keystoneclient.v3.contrib.oauth1.auth.OAuth(auth_url, *args, **kwargs)¶
Bases:
AuthConstructor
- class keystoneclient.v3.contrib.oauth1.auth.OAuthMethod(**kwargs)¶
Bases:
AuthMethod
OAuth based authentication method.
- Parameters:
consumer_key (string) – Consumer key.
consumer_secret (string) – Consumer secret.
access_key (string) – Access token key.
access_secret (string) – Access token secret.
- get_auth_data(session, auth, headers, **kwargs)¶
Return the authentication section of an auth plugin.
- Parameters:
session (keystoneclient.session.Session) – The communication session.
auth (base.Auth) – The auth plugin calling the method.
headers (dict) – The headers that will be sent with the auth request if a plugin needs to add to them.
- Returns:
The identifier of this plugin and a dict of authentication data for the auth type.
- Return type:
keystoneclient.v3.contrib.oauth1.consumers module¶
- class keystoneclient.v3.contrib.oauth1.consumers.Consumer(manager, info, loaded=False)¶
Bases:
Resource
Represents an OAuth consumer.
- Attributes:
id: a uuid that identifies the consumer
description: a short description of the consumer
- class keystoneclient.v3.contrib.oauth1.consumers.ConsumerManager(client)¶
Bases:
CrudManager
Manager class for manipulating identity consumers.
- base_url = '/OS-OAUTH1'¶
- collection_key = 'consumers'¶
- create(description=None, **kwargs)¶
- delete(consumer)¶
- get(consumer)¶
- key = 'consumer'¶
- update(consumer, description=None, **kwargs)¶
keystoneclient.v3.contrib.oauth1.core module¶
- class keystoneclient.v3.contrib.oauth1.core.OAuthManagerOptionalImportProxy¶
Bases:
object
Act as a proxy manager in case oauthlib is no installed.
This class will only be created if oauthlib is not in the system, trying to access any of the attributes in name (access_tokens, consumers, request_tokens), will result in a NotImplementedError, and a message.
>>> manager.access_tokens.blah NotImplementedError: To use 'access_tokens' oauthlib must be installed
Otherwise, if trying to access an attribute other than the ones in name, the manager will state that the attribute does not exist.
>>> manager.dne.blah AttributeError: 'OAuthManagerOptionalImportProxy' object has no attribute 'dne'
- keystoneclient.v3.contrib.oauth1.core.create_oauth_manager(self)¶
keystoneclient.v3.contrib.oauth1.request_tokens module¶
- class keystoneclient.v3.contrib.oauth1.request_tokens.RequestToken(manager, info, loaded=False)¶
Bases:
Resource
- authorize(roles)¶
- class keystoneclient.v3.contrib.oauth1.request_tokens.RequestTokenManager(client)¶
Bases:
CrudManager
Manager class for manipulating identity OAuth request tokens.
- authorize(request_token, roles)¶
Authorize a request token with specific roles.
Utilize Identity API operation: PUT /OS-OAUTH1/authorize/$request_token_id
- Parameters:
request_token – a request token that will be authorized, and can be exchanged for an access token.
roles – a list of roles, that will be delegated to the user.
- create(consumer_key, consumer_secret, project)¶
- resource_class¶
alias of
RequestToken
keystoneclient.v3.contrib.oauth1.utils module¶
- keystoneclient.v3.contrib.oauth1.utils.get_oauth_token_from_body(body)¶
Parse the URL response body to retrieve the oauth token key and secret.
The response body will look like: ‘oauth_token=12345&oauth_token_secret=67890’ with ‘oauth_expires_at=2013-03-30T05:27:19.463201’ possibly there, too.