identity Package

base Module

class keystoneclient.auth.identity.base.BaseIdentityPlugin(auth_url=None, username=None, password=None, token=None, trust_id=None)

Bases: keystoneclient.auth.base.BaseAuthPlugin

MIN_TOKEN_LIFE_SECONDS = 1
get_access(session, **kwargs)

Fetch or return a current AccessInfo object.

If a valid AccessInfo is present then it is returned otherwise a new one will be fetched.

Raises HttpError:
 An error from an invalid HTTP response.
Returns AccessInfo:
 Valid AccessInfo
get_auth_ref(session, **kwargs)

Obtain a token from an OpenStack Identity Service.

This method is overridden by the various token version plugins.

This function should not be called independently and is expected to be invoked via the do_authenticate function.

This function will be invoked if the AcessInfo object cached by the plugin is not valid. Thus plugins should always fetch a new AccessInfo when invoked. If you are looking to just retrieve the current auth data then you should use get_access.

Raises HttpError:
 An error from an invalid HTTP response.
Returns AccessInfo:
 Token access information.
get_endpoint(session, service_type=None, interface=None, region_name=None, **kwargs)

Return a valid endpoint for a service.

If a valid token is not present then a new one will be fetched using the session and kwargs.

Parameters:
  • service_type (string) – The type of service to lookup the endpoint for. This plugin will return None (failure) if service_type is not provided.
  • interface (string) – The exposure of the endpoint. Should be public, internal or admin. Defaults to public.
  • region_name (string) – The region the endpoint should exist in. (optional)
Raises HttpError:
 

An error from an invalid HTTP response.

Return string or None:
 

A valid endpoint URL or None if not available.

get_token(session, **kwargs)

Return a valid auth token.

If a valid token is not present then a new one will be fetched.

Raises HttpError:
 An error from an invalid HTTP response.
Return string:A valid token.

v2 Module

class keystoneclient.auth.identity.v2.Auth(*args, **kwargs)

Bases: keystoneclient.auth.identity.base.BaseIdentityPlugin

get_auth_data(headers=None)

Return the authentication section of an auth plugin.

Parameters:headers (dict) – The headers that will be sent with the auth request if a plugin needs to add to them.
Return dict:A dict of authentication data for the auth type.
get_auth_ref(session, **kwargs)
class keystoneclient.auth.identity.v2.Password(auth_url, username, password, **kwargs)

Bases: keystoneclient.auth.identity.v2.Auth

get_auth_data(headers=None)
class keystoneclient.auth.identity.v2.Token(auth_url, token, **kwargs)

Bases: keystoneclient.auth.identity.v2.Auth

get_auth_data(headers=None)

v3 Module

class keystoneclient.auth.identity.v3.Auth(*args, **kwargs)

Bases: keystoneclient.auth.identity.base.BaseIdentityPlugin

get_auth_ref(session, **kwargs)
token_url

The full URL where we will send authentication data.

class keystoneclient.auth.identity.v3.AuthMethod(**kwargs)

Bases: object

One part of a V3 Authentication strategy.

V3 Tokens allow multiple methods to be presented when authentication against the server. Each one of these methods is implemented by an AuthMethod.

Note: When implementing an AuthMethod use the method_parameters and do not use positional arguments. Otherwise they can’t be picked up by the factory method and don’t work as well with AuthConstructors.

get_auth_data(session, auth, headers, **kwargs)

Return the authentication section of an auth plugin.

Parameters:
  • session (Session) – The communication session.
  • auth (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.
Return tuple(string, dict):
 

The identifier of this plugin and a dict of authentication data for the auth type.

class keystoneclient.auth.identity.v3.Password(auth_url, *args, **kwargs)

Bases: keystoneclient.auth.identity.v3._AuthConstructor

class keystoneclient.auth.identity.v3.PasswordMethod(**kwargs)

Bases: keystoneclient.auth.identity.v3.AuthMethod

get_auth_data(session, auth, headers, **kwargs)
class keystoneclient.auth.identity.v3.Token(auth_url, token, **kwargs)

Bases: keystoneclient.auth.identity.v3._AuthConstructor

class keystoneclient.auth.identity.v3.TokenMethod(**kwargs)

Bases: keystoneclient.auth.identity.v3.AuthMethod

get_auth_data(session, auth, headers, **kwargs)

Table Of Contents

Previous topic

auth Package

Next topic

common Package

This Page