The ironicclient.openstack.common.apiclient.auth Module

class ironicclient.openstack.common.apiclient.auth.BaseAuthPlugin(auth_system=None, **kwargs)[source]

Bases: object

Base class for authentication plugins.

An authentication plugin needs to override at least the authenticate method to be a valid plugin.

classmethod add_common_opts(parser)[source]

Add options that are common for several plugins.

classmethod add_opts(parser)[source]

Populate the parser with the options for this plugin.

auth_system = None
authenticate(http_client)[source]

Authenticate using plugin defined method.

The method usually analyses self.opts and performs a request to authentication server.

Parameters:http_client (HTTPClient) – client object that needs authentication
Raises:AuthorizationFailure
common_opt_names = ['auth_system', 'username', 'password', 'tenant_name', 'token', 'auth_url']
static get_opt(opt_name, args)[source]

Return option name and value.

Parameters:
  • opt_name – name of the option, e.g., “username”
  • args – parsed arguments
opt_names = []
parse_opts(args)[source]

Parse the actual auth-system options if any.

This method is expected to populate the attribute self.opts with a dict containing the options and values needed to make authentication.

sufficient_options()[source]

Check if all required options are present.

Raises:AuthPluginOptionsMissing
token_and_endpoint(endpoint_type, service_type)[source]

Return token and endpoint.

Parameters:
  • service_type (string) – Service type of the endpoint
  • endpoint_type (string) – Type of endpoint. Possible values: public or publicURL, internal or internalURL, admin or adminURL
Returns:

tuple of token and endpoint strings

Raises:

EndpointException

ironicclient.openstack.common.apiclient.auth.discover_auth_systems()[source]

Discover the available auth-systems.

This won’t take into account the old style auth-systems.

ironicclient.openstack.common.apiclient.auth.load_auth_system_opts(parser)[source]

Load options needed by the available auth-systems into a parser.

This function will try to populate the parser with options from the available plugins.

ironicclient.openstack.common.apiclient.auth.load_plugin(auth_system)[source]
ironicclient.openstack.common.apiclient.auth.load_plugin_from_args(args)[source]

Load required plugin and populate it with options.

Try to guess auth system if it is not specified. Systems are tried in alphabetical order.

Raises:AuthPluginOptionsMissing

Previous topic

The ironicclient.openstack.common._i18n Module

Next topic

The ironicclient.openstack.common.apiclient.base Module

This Page