Repository URL to install this package:
|
Version:
4.0.99 ▾
|
ó
µEYc @ s) e Z d Z d e f d YZ d S( s X-Auth-Tokent BaseAuthPluginc B sz e Z d Z d Z d Z d Z d Z d Z d Z d Z d Z
d Z d
Z d Z
d Z RS(
s¯ The basic structure of an authentication plugin.
.. note::
See :doc:`/authentication-plugins` for a description of plugins
provided by this library.
c K s d S( s: Obtain a token.
How the token is obtained is up to the plugin. If it is still valid
it may be re-used, retrieved from cache or invoke an authentication
request against a server.
There are no required kwargs. They are passed directly to the auth
plugin and they are implementation specific.
Returning None will indicate that no token was able to be retrieved.
This function is misplaced as it should only be required for auth
plugins that use the 'X-Auth-Token' header. However due to the way
plugins evolved this method is required and often called to trigger an
authentication request on a new plugin.
When implementing a new plugin it is advised that you implement this
method, however if you don't require the 'X-Auth-Token' header override
the `get_headers` method instead.
:param session: A session object so the plugin can make HTTP calls.
:type session: keystoneauth1.session.Session
:return: A token to use.
:rtype: string
N( t None( t selft sessiont kwargs( ( sI /home/tvault/.virtenv/lib/python2.7/site-packages/keystoneauth1/plugin.pyt get_token s c K s$ | j | } | s d Si | t 6S( s½ Fetch authentication headers for message.
This is a more generalized replacement of the older get_token to allow
plugins to specify different or additional authentication headers to
the OpenStack standard 'X-Auth-Token' header.
How the authentication headers are obtained is up to the plugin. If the
headers are still valid they may be re-used, retrieved from cache or
the plugin may invoke an authentication request against a server.
The default implementation of get_headers calls the `get_token` method
to enable older style plugins to continue functioning unchanged.
Subclasses should feel free to completely override this function to
provide the headers that they want.
There are no required kwargs. They are passed directly to the auth
plugin and they are implementation specific.
Returning None will indicate that no token was able to be retrieved and
that authorization was a failure. Adding no authentication data can be
achieved by returning an empty dictionary.
:param session: The session object that the auth_plugin belongs to.
:type session: keystoneauth1.session.Session
:returns: Headers that are set to authenticate a message or None for
failure. Note that when checking this value that the empty
dict is a valid, non-failure response.
:rtype: dict
N( R R t IDENTITY_AUTH_HEADER_NAME( R R R t token( ( sI /home/tvault/.virtenv/lib/python2.7/site-packages/keystoneauth1/plugin.pyt get_headers; s c K s d S( s Return an endpoint for the client.
There are no required keyword arguments to ``get_endpoint`` as a plugin
implementation should use best effort with the information available to
determine the endpoint. However there are certain standard options that
will be generated by the clients and should be used by plugins:
- ``service_type``: what sort of service is required.
- ``service_name``: the name of the service in the catalog.
- ``interface``: what visibility the endpoint should have.
- ``region_name``: the region the endpoint exists in.
:param session: The session object that the auth_plugin belongs to.
:type session: keystoneauth1.session.Session
:returns: The base URL that will be used to talk to the required
service or None if not available.
:rtype: string
N( R ( R R R ( ( sI /home/tvault/.virtenv/lib/python2.7/site-packages/keystoneauth1/plugin.pyt get_endpointa s c K s i S( s¹ Return any additional connection parameters required for the plugin.
:param session: The session object that the auth_plugin belongs to.
:type session: keystoneclient.session.Session
:returns: Headers that are set to authenticate a message or None for
failure. Note that when checking this value that the empty
dict is a valid, non-failure response.
:rtype: dict
( ( R R R ( ( sI /home/tvault/.virtenv/lib/python2.7/site-packages/keystoneauth1/plugin.pyt get_connection_paramsw s c C s t S( s Invalidate the current authentication data.
This should result in fetching a new token on next call.
A plugin may be invalidated if an Unauthorized HTTP response is
returned to indicate that the token may have been revoked or is
otherwise now invalid.
:returns: True if there was something that the plugin did to
invalidate. This means that it makes sense to try again. If
nothing happens returns False to indicate give up.
:rtype: bool
( t False( R ( ( sI /home/tvault/.virtenv/lib/python2.7/site-packages/keystoneauth1/plugin.pyt
invalidate s c K s d S( sØ Return a unique user identifier of the plugin.
Wherever possible the user id should be inferred from the token however
there are certain URLs and other places that require access to the
currently authenticated user id.
:param session: A session object so the plugin can make HTTP calls.
:type session: keystoneauth1.session.Session
:returns: A user identifier or None if one is not available.
:rtype: str
N( R ( R R R ( ( sI /home/tvault/.virtenv/lib/python2.7/site-packages/keystoneauth1/plugin.pyt get_user_id s
c K s d S( sæ Return the project id that we are authenticated to.
Wherever possible the project id should be inferred from the token
however there are certain URLs and other places that require access to
the currently authenticated project id.
:param session: A session object so the plugin can make HTTP calls.
:type session: keystoneauth1.session.Session
:returns: A project identifier or None if one is not available.
:rtype: str
N( R ( R R R ( ( sI /home/tvault/.virtenv/lib/python2.7/site-packages/keystoneauth1/plugin.pyt get_project_id£ s
c K s d S( sX Return auth_url from the Service Provider object.
This url is used for obtaining unscoped federated token from remote
cloud.
:param sp_id: ID of the Service Provider to be queried.
:type sp_id: string
:returns: A Service Provider auth_url or None if one is not available.
:rtype: str
N( R ( R R t sp_idR ( ( sI /home/tvault/.virtenv/lib/python2.7/site-packages/keystoneauth1/plugin.pyt get_sp_auth_url² s
c K s d S( s@ Return sp_url from the Service Provider object.
This url is used for passing SAML2 assertion to the remote cloud.
:param sp_id: ID of the Service Provider to be queried.
:type sp_id: str
:returns: A Service Provider sp_url or None if one is not available.
:rtype: str
N( R ( R R R R ( ( sI /home/tvault/.virtenv/lib/python2.7/site-packages/keystoneauth1/plugin.pyt
get_sp_urlÁ s c C s d S( s Fetch an identifier that uniquely identifies the auth options.
The returned identifier need not be decomposable or otherwise provide
anyway to recreate the plugin. It should not contain sensitive data in
plaintext.
This string MUST change if any of the parameters that are used to
uniquely identity this plugin change.
If get_cache_id returns a str value suggesting that caching is
supported then get_auth_cache and set_auth_cache must also be
implemented.
:returns: A unique string for the set of options
:rtype: str or None if this is unsupported or unavailable.
N( R ( R ( ( sI /home/tvault/.virtenv/lib/python2.7/site-packages/keystoneauth1/plugin.pyt get_cache_idÏ s c C s
t d S( s* Retrieve the current authentication state for the plugin.
Retrieve any internal state that represents the authenticated plugin.
This should not fetch any new data if it is not present.
:raises NotImplementedError: if the plugin does not support this
feature.
:returns: raw python data (which can be JSON serialized) that can be
moved into another plugin (of the same type) to have the
same authenticated state.
:rtype: object or None if unauthenticated.
N( t NotImplementedError( R ( ( sI /home/tvault/.virtenv/lib/python2.7/site-packages/keystoneauth1/plugin.pyt get_auth_stateâ s c C s
t d S( s Install existing authentication state for a plugin.
Take the output of get_auth_state and install that authentication state
into the current authentication plugin.
:raises NotImplementedError: if the plugin does not support this
feature.
N( R ( R t data( ( sI /home/tvault/.virtenv/lib/python2.7/site-packages/keystoneauth1/plugin.pyt set_auth_stateó s ( t __name__t
__module__t __doc__R R R R
R R
R R R R R R ( ( ( sI /home/tvault/.virtenv/lib/python2.7/site-packages/keystoneauth1/plugin.pyR s &
N( t objectt AUTH_INTERFACER R ( ( ( sI /home/tvault/.virtenv/lib/python2.7/site-packages/keystoneauth1/plugin.pyt <module> s