keystoneauth1.loading package¶
Submodules¶
- keystoneauth1.loading.adapter module
Adapter
Adapter.__abstractmethods__
Adapter.__annotations__
Adapter.__doc__
Adapter.__firstlineno__
Adapter.__module__
Adapter.__orig_bases__
Adapter.__parameters__
Adapter.__static_attributes__
Adapter._abc_impl
Adapter.get_conf_options()
Adapter.get_options()
Adapter.load_from_conf_options()
Adapter.plugin_class
Adapter.register_conf_options()
get_conf_options()
load_from_conf_options()
process_conf_options()
register_argparse_arguments()
register_conf_options()
register_service_argparse_arguments()
- keystoneauth1.loading.base module
BaseLoader
_BaseLoader
_BaseLoader.__abstractmethods__
_BaseLoader.__annotations__
_BaseLoader.__dict__
_BaseLoader.__doc__
_BaseLoader.__firstlineno__
_BaseLoader.__module__
_BaseLoader.__orig_bases__
_BaseLoader.__parameters__
_BaseLoader.__static_attributes__
_BaseLoader.__weakref__
_BaseLoader._abc_impl
_BaseLoader.available
_BaseLoader.create_plugin()
_BaseLoader.get_options()
_BaseLoader.load_from_options()
_BaseLoader.load_from_options_getter()
_BaseLoader.plugin_class
_auth_plugin_available()
get_available_plugin_loaders()
get_available_plugin_names()
get_plugin_loader()
get_plugin_options()
- keystoneauth1.loading.cli module
- keystoneauth1.loading.conf module
- keystoneauth1.loading.identity module
BaseFederationLoader
BaseFederationLoader.__abstractmethods__
BaseFederationLoader.__annotations__
BaseFederationLoader.__doc__
BaseFederationLoader.__firstlineno__
BaseFederationLoader.__module__
BaseFederationLoader.__orig_bases__
BaseFederationLoader.__parameters__
BaseFederationLoader.__static_attributes__
BaseFederationLoader._abc_impl
BaseFederationLoader.get_options()
BaseGenericLoader
BaseGenericLoader.__abstractmethods__
BaseGenericLoader.__annotations__
BaseGenericLoader.__doc__
BaseGenericLoader.__firstlineno__
BaseGenericLoader.__module__
BaseGenericLoader.__orig_bases__
BaseGenericLoader.__parameters__
BaseGenericLoader.__static_attributes__
BaseGenericLoader._abc_impl
BaseGenericLoader.get_options()
BaseIdentityLoader
BaseIdentityLoader.__abstractmethods__
BaseIdentityLoader.__annotations__
BaseIdentityLoader.__doc__
BaseIdentityLoader.__firstlineno__
BaseIdentityLoader.__module__
BaseIdentityLoader.__orig_bases__
BaseIdentityLoader.__parameters__
BaseIdentityLoader.__static_attributes__
BaseIdentityLoader._abc_impl
BaseIdentityLoader.get_options()
BaseV2Loader
BaseV3Loader
BaseV3Loader.__abstractmethods__
BaseV3Loader.__annotations__
BaseV3Loader.__doc__
BaseV3Loader.__firstlineno__
BaseV3Loader.__module__
BaseV3Loader.__orig_bases__
BaseV3Loader.__parameters__
BaseV3Loader.__static_attributes__
BaseV3Loader._abc_impl
BaseV3Loader.get_options()
BaseV3Loader.load_from_options()
- keystoneauth1.loading.opts module
- keystoneauth1.loading.session module
Session
Session.__abstractmethods__
Session.__annotations__
Session.__doc__
Session.__firstlineno__
Session.__module__
Session.__orig_bases__
Session.__parameters__
Session.__static_attributes__
Session._abc_impl
Session.get_conf_options()
Session.get_options()
Session.load_from_argparse_arguments()
Session.load_from_conf_options()
Session.load_from_options()
Session.plugin_class
Session.register_argparse_arguments()
Session.register_conf_options()
_positive_non_zero_float()
get_conf_options()
load_from_argparse_arguments()
load_from_conf_options()
register_argparse_arguments()
register_conf_options()
Module contents¶
- class keystoneauth1.loading.BaseFederationLoader¶
Bases:
BaseV3Loader
[V3FederationPluginT
]Base Option handling for federation plugins.
This class defines options and handling that should be common to the V3 identity federation API. It provides the options expected by the
keystoneauth1.identity.v3.FederationBaseAuth
class.- __abstractmethods__ = frozenset({})¶
- __annotations__ = {}¶
- __doc__ = 'Base Option handling for federation plugins.\n\nThis class defines options and handling that should be common to the V3\nidentity federation API. It provides the options expected by the\n:py:class:`keystoneauth1.identity.v3.FederationBaseAuth` class.\n'¶
- __firstlineno__ = 137¶
- __module__ = 'keystoneauth1.loading.identity'¶
- __orig_bases__ = (keystoneauth1.loading.identity.BaseV3Loader[~V3FederationPluginT],)¶
- __parameters__ = (~V3FederationPluginT,)¶
- __static_attributes__ = ()¶
- _abc_impl = <_abc._abc_data object>¶
- class keystoneauth1.loading.BaseGenericLoader¶
Bases:
BaseIdentityLoader
[GenericPluginT
]Base Option handling for generic plugins.
This class defines options and handling that should be common to generic plugins. These plugins target the OpenStack identity service however are designed to be independent of API version. It provides the options expected by the
keystoneauth1.identity.generic.base.BaseGenericPlugin
class.- __abstractmethods__ = frozenset({})¶
- __annotations__ = {}¶
- __doc__ = 'Base Option handling for generic plugins.\n\nThis class defines options and handling that should be common to generic\nplugins. These plugins target the OpenStack identity service however are\ndesigned to be independent of API version. It provides the options expected\nby the :py:class:`keystoneauth1.identity.generic.base.BaseGenericPlugin`\nclass.\n'¶
- __firstlineno__ = 166¶
- __module__ = 'keystoneauth1.loading.identity'¶
- __orig_bases__ = (keystoneauth1.loading.identity.BaseIdentityLoader[~GenericPluginT],)¶
- __parameters__ = (~GenericPluginT,)¶
- __static_attributes__ = ()¶
- _abc_impl = <_abc._abc_data object>¶
- class keystoneauth1.loading.BaseIdentityLoader¶
Bases:
BaseLoader
[PluginT
]Base Option handling for identity plugins.
This class defines options and handling that should be common across all plugins that are developed against the OpenStack identity service. It provides the options expected by the
keystoneauth1.identity.BaseIdentityPlugin
class.- __abstractmethods__ = frozenset({})¶
- __annotations__ = {}¶
- __doc__ = 'Base Option handling for identity plugins.\n\nThis class defines options and handling that should be common across all\nplugins that are developed against the OpenStack identity service. It\nprovides the options expected by the\n:py:class:`keystoneauth1.identity.BaseIdentityPlugin` class.\n'¶
- __firstlineno__ = 45¶
- __module__ = 'keystoneauth1.loading.identity'¶
- __orig_bases__ = (keystoneauth1.loading.base.BaseLoader[~PluginT],)¶
- __parameters__ = (~PluginT,)¶
- __static_attributes__ = ()¶
- _abc_impl = <_abc._abc_data object>¶
- class keystoneauth1.loading.BaseLoader¶
Bases:
_BaseLoader
[BaseAuthPluginT
]- __abstractmethods__ = frozenset({'get_options'})¶
- __annotations__ = {}¶
- __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.BaseV2Loader¶
Bases:
BaseIdentityLoader
[V2PluginT
]Base Option handling for identity plugins.
This class defines options and handling that should be common to the V2 identity API. It provides the options expected by the
keystoneauth1.identity.v2.Auth
class.- __abstractmethods__ = frozenset({})¶
- __annotations__ = {}¶
- __doc__ = 'Base Option handling for identity plugins.\n\nThis class defines options and handling that should be common to the V2\nidentity API. It provides the options expected by the\n:py:class:`keystoneauth1.identity.v2.Auth` class.\n'¶
- __firstlineno__ = 64¶
- __module__ = 'keystoneauth1.loading.identity'¶
- __orig_bases__ = (keystoneauth1.loading.identity.BaseIdentityLoader[~V2PluginT],)¶
- __parameters__ = (~V2PluginT,)¶
- __static_attributes__ = ()¶
- _abc_impl = <_abc._abc_data object>¶
- class keystoneauth1.loading.BaseV3Loader¶
Bases:
BaseIdentityLoader
[V3PluginT
]Base Option handling for identity plugins.
This class defines options and handling that should be common to the V3 identity API. It provides the options expected by the
keystoneauth1.identity.v3.Auth
class.- __abstractmethods__ = frozenset({})¶
- __annotations__ = {}¶
- __doc__ = 'Base Option handling for identity plugins.\n\nThis class defines options and handling that should be common to the V3\nidentity API. It provides the options expected by the\n:py:class:`keystoneauth1.identity.v3.Auth` class.\n'¶
- __firstlineno__ = 88¶
- __module__ = 'keystoneauth1.loading.identity'¶
- __orig_bases__ = (keystoneauth1.loading.identity.BaseIdentityLoader[~V3PluginT],)¶
- __parameters__ = (~V3PluginT,)¶
- __static_attributes__ = ()¶
- _abc_impl = <_abc._abc_data object>¶
- get_options() list[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) V3PluginT ¶
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.
- class keystoneauth1.loading.Opt(name: str, type: ~typing.Type[~typing.Any] = <class 'str'>, help: str | None = None, secret: bool = False, dest: str | None = None, deprecated: list[~keystoneauth1.loading.opts.Opt] | None = None, default: ~typing.Any = None, metavar: str | None = None, required: bool = False, prompt: str | None = None)¶
Bases:
object
An option required by an authentication plugin.
Opts provide a means for authentication plugins that are going to be dynamically loaded to specify the parameters that are to be passed to the plugin on initialization.
The Opt specifies information about the way the plugin parameter is to be represented in different loading mechanisms.
When defining an Opt with a - the - should be present in the name parameter. This will automatically be converted to an _ when passing to the plugin initialization. For example, you should specify:
Opt('user-domain-id')
which will pass the value as user_domain_id to the plugin’s initialization.
- Parameters:
name (str) – The name of the option.
type (callable) – The type of the option. This is a callable which is passed the raw option that was loaded (often a string) and is required to return the parameter in the type expected by __init__.
help (str) – The help text that is shown along with the option.
secret (bool) – If the parameter is secret it should not be printed or logged in debug output.
dest (str) – the name of the argument that will be passed to __init__. This allows you to have a different name in loading than is used by the __init__ function. Defaults to the value of name.
deprecated (keystoneauth1.loading.Opt) – A list of other options that are deprecated in favour of this one. This ensures the old options are still registered.
default – A default value that can be used if one is not provided.
metavar (str) – The <metavar> that should be printed in CLI help text.
required (bool) – If the option is required to load the plugin. If a required option is not present loading should fail.
prompt (str) – If the option can be requested via a prompt (where appropriate) set the string that should be used to prompt with.
- __dict__ = mappingproxy({'__module__': 'keystoneauth1.loading.opts', '__firstlineno__': 25, '__doc__': "An option required by an authentication plugin.\n\nOpts provide a means for authentication plugins that are going to be\ndynamically loaded to specify the parameters that are to be passed to the\nplugin on initialization.\n\nThe Opt specifies information about the way the plugin parameter is to be\nrepresented in different loading mechanisms.\n\nWhen defining an Opt with a - the - should be present in the name\nparameter. This will automatically be converted to an _ when passing to the\nplugin initialization. For example, you should specify::\n\n Opt('user-domain-id')\n\nwhich will pass the value as `user_domain_id` to the plugin's\ninitialization.\n\n:param str name: The name of the option.\n:param callable type: The type of the option. This is a callable which is\n passed the raw option that was loaded (often a string) and is required\n to return the parameter in the type expected by __init__.\n:param str help: The help text that is shown along with the option.\n:param bool secret: If the parameter is secret it should not be printed or\n logged in debug output.\n:param str dest: the name of the argument that will be passed to __init__.\n This allows you to have a different name in loading than is used by the\n __init__ function. Defaults to the value of name.\n:param keystoneauth1.loading.Opt deprecated: A list of other options that\n are deprecated in favour of this one. This ensures the old options are\n still registered.\n:type opt: list(Opt)\n:param default: A default value that can be used if one is not provided.\n:param str metavar: The <metavar> that should be printed in CLI help text.\n:param bool required: If the option is required to load the plugin. If a\n required option is not present loading should fail.\n:param str prompt: If the option can be requested via a prompt (where\n appropriate) set the string that should be used to prompt with.\n", '__init__': <function Opt.__init__>, '__repr__': <function Opt.__repr__>, '_to_oslo_opt': <function Opt._to_oslo_opt>, '__eq__': <function Opt.__eq__>, '_all_opts': <property object>, 'argparse_args': <property object>, 'argparse_envvars': <property object>, 'argparse_default': <property object>, '__static_attributes__': ('default', 'deprecated', 'deprecated_for_removal', 'deprecated_opts', 'dest', 'group', 'help', 'metavar', 'name', 'prompt', 'required', 'sample_default', 'secret', 'type'), '__dict__': <attribute '__dict__' of 'Opt' objects>, '__weakref__': <attribute '__weakref__' of 'Opt' objects>, '__hash__': None, '__annotations__': {}})¶
- __doc__ = "An option required by an authentication plugin.\n\nOpts provide a means for authentication plugins that are going to be\ndynamically loaded to specify the parameters that are to be passed to the\nplugin on initialization.\n\nThe Opt specifies information about the way the plugin parameter is to be\nrepresented in different loading mechanisms.\n\nWhen defining an Opt with a - the - should be present in the name\nparameter. This will automatically be converted to an _ when passing to the\nplugin initialization. For example, you should specify::\n\n Opt('user-domain-id')\n\nwhich will pass the value as `user_domain_id` to the plugin's\ninitialization.\n\n:param str name: The name of the option.\n:param callable type: The type of the option. This is a callable which is\n passed the raw option that was loaded (often a string) and is required\n to return the parameter in the type expected by __init__.\n:param str help: The help text that is shown along with the option.\n:param bool secret: If the parameter is secret it should not be printed or\n logged in debug output.\n:param str dest: the name of the argument that will be passed to __init__.\n This allows you to have a different name in loading than is used by the\n __init__ function. Defaults to the value of name.\n:param keystoneauth1.loading.Opt deprecated: A list of other options that\n are deprecated in favour of this one. This ensures the old options are\n still registered.\n:type opt: list(Opt)\n:param default: A default value that can be used if one is not provided.\n:param str metavar: The <metavar> that should be printed in CLI help text.\n:param bool required: If the option is required to load the plugin. If a\n required option is not present loading should fail.\n:param str prompt: If the option can be requested via a prompt (where\n appropriate) set the string that should be used to prompt with.\n"¶
- __eq__(other: Any) bool ¶
Define equality operator on option parameters.
- __firstlineno__ = 25¶
- __hash__ = None¶
- __init__(name: str, type: ~typing.Type[~typing.Any] = <class 'str'>, help: str | None = None, secret: bool = False, dest: str | None = None, deprecated: list[~keystoneauth1.loading.opts.Opt] | None = None, default: ~typing.Any = None, metavar: str | None = None, required: bool = False, prompt: str | None = None)¶
- __module__ = 'keystoneauth1.loading.opts'¶
- __repr__() str ¶
Return string representation of option name.
- __static_attributes__ = ('default', 'deprecated', 'deprecated_for_removal', 'deprecated_opts', 'dest', 'group', 'help', 'metavar', 'name', 'prompt', 'required', 'sample_default', 'secret', 'type')¶
- __weakref__¶
list of weak references to the object
- _to_oslo_opt() cfg.Opt ¶
- property argparse_args: list[str]¶
- property argparse_default: Any¶
- property argparse_envvars: List[str]¶
- keystoneauth1.loading.get_adapter_conf_options(include_deprecated: bool = True, deprecated_opts: dict[str, list[cfg.DeprecatedOpt]] | None = None) list[cfg.Opt] ¶
- keystoneauth1.loading.get_auth_common_conf_options() list[cfg.Opt] ¶
Get the oslo_config options common for all auth plugins.
These may be useful without being registered for config file generation or to manipulate the options before registering them yourself.
- The options that are set are:
- auth_type:
The name of the plugin to load.
- auth_section:
The config file section to load options from.
- Returns:
A list of oslo_config options.
- keystoneauth1.loading.get_auth_plugin_conf_options(plugin: BaseLoader[BaseAuthPluginT] | str) list[cfg.Opt] ¶
Get the oslo_config options for a specific plugin.
This will be the list of config options that is registered and loaded by the specified plugin.
- Parameters:
plugin (str or keystoneauth1.loading.BaseLoader) – The name of the plugin loader or a plugin loader object
- Returns:
A list of oslo_config options.
- keystoneauth1.loading.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.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.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:
- Raises:
keystoneauth1.exceptions.auth_plugins.NoMatchingPlugin – if a plugin cannot be created.
- keystoneauth1.loading.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.
- keystoneauth1.loading.get_session_conf_options(deprecated_opts: dict[str, list[cfg.DeprecatedOpt]] | None = None) list[cfg.Opt] ¶
- keystoneauth1.loading.load_adapter_from_conf_options(conf: cfg.ConfigOpts, group: str, **kwargs: Any) Adapter ¶
- keystoneauth1.loading.load_auth_from_argparse_arguments(namespace: Namespace, **kwargs: Any) plugin.BaseAuthPluginT | None ¶
Retrieve the created plugin from the completed argparse results.
Loads and creates the auth plugin from the information parsed from the command line by argparse.
- Parameters:
namespace (Namespace) – The result from CLI parsing.
- Returns:
An auth plugin, or None if a name is not provided.
- Return type:
- Raises:
keystoneauth1.exceptions.auth_plugins.NoMatchingPlugin – if a plugin cannot be created.
- keystoneauth1.loading.load_auth_from_conf_options(conf: cfg.ConfigOpts, group: str, **kwargs: Any) keystoneauth1.plugin.BaseAuthPlugin | None ¶
Load a plugin from an oslo_config CONF object.
Each plugin will register their own required options and so there is no standard list and the plugin should be consulted.
The base options should have been registered with register_conf_options before this function is called.
- Parameters:
conf (oslo_config.cfg.ConfigOpts) – A conf object.
group (str) – The group name that options should be read from.
- Returns:
An authentication Plugin or None if a name is not provided
- Return type:
- Raises:
keystoneauth1.exceptions.auth_plugins.NoMatchingPlugin – if a plugin cannot be created.
- keystoneauth1.loading.load_session_from_argparse_arguments(namespace: Namespace, **kwargs: Any) Session ¶
- keystoneauth1.loading.load_session_from_conf_options(conf: cfg.ConfigOpts, group: str, **kwargs: Any) Session ¶
- keystoneauth1.loading.register_adapter_argparse_arguments(parser: ArgumentParser, service_type: str | None = None) None ¶
- keystoneauth1.loading.register_adapter_conf_options(conf: cfg.ConfigOpts, group: str, include_deprecated: bool = True, deprecated_opts: dict[str, list[cfg.DeprecatedOpt]] | None = None) list[cfg.Opt] ¶
- keystoneauth1.loading.register_auth_argparse_arguments(parser: ArgumentParser, argv: list[str], default: Any = None) BaseLoader[plugin.BaseAuthPluginT] | None ¶
Register CLI options needed to create a plugin.
The function inspects the provided arguments so that it can also register the options required for that specific plugin if available.
- Parameters:
parser (argparse.ArgumentParser) – the parser to attach argparse options to.
argv (list) – the arguments provided to the appliation.
default (str/class) – a default plugin name or a plugin object to use if one isn’t specified by the CLI. default: None.
- Returns:
The plugin class that will be loaded or None if not provided.
- Return type:
keystoneauth1.loader.BaseLoader
- Raises:
keystoneauth1.exceptions.auth_plugins.NoMatchingPlugin – if a plugin cannot be created.
- keystoneauth1.loading.register_auth_conf_options(conf: cfg.ConfigOpts, group: str) None ¶
Register the oslo_config options that are needed for a plugin.
This only registers the basic options shared by all plugins. Options that are specific to a plugin are loaded just before they are read.
The defined options are:
- auth_type: the name of the auth plugin that will be used for
authentication.
- auth_section: the group from which further auth plugin options should be
taken. If section is not provided then the auth plugin options will be taken from the same group as provided in the parameters.
- Parameters:
conf (oslo_config.cfg.ConfigOpts) – config object to register with.
group (string) – The ini group to register options in.
- keystoneauth1.loading.register_service_adapter_argparse_arguments(parser: ArgumentParser, service_type: str) None ¶
- keystoneauth1.loading.register_session_argparse_arguments(parser: ArgumentParser) None ¶
- keystoneauth1.loading.register_session_conf_options(conf: cfg.ConfigOpts, group: str, deprecated_opts: dict[str, list[cfg.DeprecatedOpt]] | None = None) list[cfg.Opt] ¶