# keystoneauth1.loading.base module

class keystoneauth1.loading.base.BaseLoader

  Bases: `_BaseLoader`[`BaseAuthPluginT`]

  __abstractmethods__ = frozenset({'get_options'})
  __annotations_cache__ = {}
  __doc__ = None
  __firstlineno__ = 208
  __module__ = 'keystoneauth1.loading.base'
  __orig_bases__ = (keystoneauth1.loading.base._BaseLoader[+BaseAuthPluginT],)
  __parameters__ = (+BaseAuthPluginT,)
  __static_attributes__ = ()
  _abc_impl = <_abc._abc_data object>

class keystoneauth1.loading.base._BaseLoader

  Bases: `Generic`[`T`]

  __abstractmethods__ = frozenset({'get_options'})
  __annotate_func__ = None
  __annotations_cache__ = {}
  __dict__ = mappingproxy({'__module__': 'keystoneauth1.loading.base', '__firstlineno__': 117, 'plugin_class': <property object>, 'create_plugin': <function _BaseLoader.create_plugin>, 'get_options': <function _BaseLoader.get_options>, 'available': <property object>, 'load_from_options': <function _BaseLoader.load_from_options>, 'load_from_options_getter': <function _BaseLoader.load_from_options_getter>, '__static_attributes__': (), '__orig_bases__': (typing.Generic[+T],), '__dict__': <attribute '__dict__' of '_BaseLoader' objects>, '__weakref__': <attribute '__weakref__' of '_BaseLoader' objects>, '__doc__': None, '__parameters__': (+T,), '__abstractmethods__': frozenset({'get_options'}), '_abc_impl': <_abc._abc_data object>, '__annotations_cache__': {}})
  __doc__ = None
  __firstlineno__ = 117
  __module__ = 'keystoneauth1.loading.base'
  __orig_bases__ = (typing.Generic[+T],)
  __parameters__ = (+T,)
  __static_attributes__ = ()
  __weakref__

    list of weak references to the object

  _abc_impl = <_abc._abc_data object>
  property available: bool

    Return if the plugin is available for loading.

    If a plugin is missing dependencies or for some other reason should not be available to the current system it should override this property and return False to exclude itself from the plugin list.

    Return type:

      bool

  create_plugin(**kwargs: Any) → T

    Create a plugin from the options available for the loader.

    Given the options that were specified by the loader create an appropriate plugin. You can override this function in your loader.

    This used to be specified by providing the plugin_class property and this is still supported, however specifying a property didn’t let you choose a plugin type based upon the options that were presented.

    Override this function if you wish to return different plugins based on the options presented, otherwise you can simply provide the plugin_class property.

    Added 2.9

  abstractmethod get_options() → list[opts.Opt]

    Return the list of parameters associated with the auth plugin.

    This list may be used to generate CLI or config arguments.

    Returns:

      A list of Param objects describing available plugin parameters.

    Return type:

      list

  load_from_options(**kwargs: Any) → T

    Create a plugin from the arguments retrieved from get_options.

    A client can override this function to do argument validation or to handle differences between the registered options and what is required to create the plugin.

  load_from_options_getter(getter: Callable[[opts.Opt], Any], **kwargs: Any) → T

    Load a plugin from getter function that returns appropriate values.

    To handle cases other than the provided CONF and CLI loading you can specify a custom loader function that will be queried for the option value. The getter is a function that takes a `keystoneauth1.loading.Opt` and returns a value to load with.

    Parameters:

      getter (callable) – A function that returns a value for the given opt.

    Returns:

      An authentication Plugin.

    Return type:

      `keystoneauth1.plugin.BaseAuthPlugin`

  property plugin_class: type[T]

keystoneauth1.loading.base._auth_plugin_available(ext: Extension) → bool

  Read the value of available for whether to load this plugin.

keystoneauth1.loading.base.get_available_plugin_loaders() → dict[str, BaseLoader[BaseAuthPluginT]]

  Retrieve all the plugin classes available on the system.

  Returns:

    A dict with plugin entrypoint name as the key and the plugin loader as the value.

  Return type:

    dict

keystoneauth1.loading.base.get_available_plugin_names() → frozenset[str]

  Get the names of all the plugins that are available on the system.

  This is particularly useful for help and error text to prompt a user for example what plugins they may specify.

  Returns:

    A list of names.

  Return type:

    frozenset

keystoneauth1.loading.base.get_plugin_loader(name: str) → BaseLoader[BaseAuthPluginT]

  Retrieve a plugin class by its entrypoint name.

  Parameters:

    name (str) – The name of the object to get.

  Returns:

    An auth plugin class.

  Return type:

    `keystoneauth1.loading.BaseLoader`

  Raises:

    keystoneauth1.exceptions.auth_plugins.NoMatchingPlugin – if a plugin cannot be created.

keystoneauth1.loading.base.get_plugin_options(name: str) → list[opts.Opt]

  Get the options for a specific plugin.

  This will be the list of options that is registered and loaded by the specified plugin.

  Returns:

    A list of `keystoneauth1.loading.Opt` options.

  Raises:

    keystoneauth1.exceptions.auth_plugins.NoMatchingPlugin – if a plugin cannot be created.

this page last updated: 2026-03-25 21:01:07

Except where otherwise noted, this document is licensed under Creative Commons Attribution 3.0 License. See all OpenStack Legal Documents.

found an error? report a bug