keystoneclient.auth package

Submodules

keystoneclient.auth.base module

class keystoneclient.auth.base.BaseAuthPlugin

Bases: object

The basic structure of an authentication plugin.

get_endpoint(session, **kwargs)

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.
  • interface: what visibility the endpoint should have.
  • region_name: the region the endpoint exists in.
Parameters:session (Session) – The session object that the auth_plugin belongs to.
Returns string:The base URL that will be used to talk to the required service or None if not available.
get_token(session, **kwargs)

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.

Parameters:session – A session object so the plugin can make HTTP calls.
Return string:A token to use.
invalidate()

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 bool: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.

keystoneclient.auth.token_endpoint module

class keystoneclient.auth.token_endpoint.Token(endpoint, token)

Bases: keystoneclient.auth.base.BaseAuthPlugin

A provider that will always use the given token and endpoint.

This is really only useful for testing and in certain CLI cases where you have a known endpoint and admin token that you want to use.

get_token(session)

Module contents