auth Package

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.

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)

Table Of Contents

Previous topic

apiclient Package

Next topic

identity Package

This Page