Bases: object
The basic structure of an authentication plugin.
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:
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. |
Return the list of parameters associated with the auth plugin.
This list may be used to generate CLI or config arguments.
Returns list: | A list of Param objects describing available plugin parameters. |
---|
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. |
Invalidate the current authentication data.
This should result in fetching a new token on next call.
A plugin may be invalidated if an Unauthorized HTTP response is returned to indicate that the token may have been revoked or is otherwise now invalid.
Returns bool: | True if there was something that the plugin did to invalidate. This means that it makes sense to try again. If nothing happens returns False to indicate give up. |
---|
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.
Retrieve a plugin class by its entrypoint name.
Parameters: | name (str) – The name of the object to get. |
---|---|
Returns: | An auth plugin class. |
Raises exceptions.NoMatchingPlugin: | |
if a plugin cannot be created. |
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. |
Raises exceptions.NoMatchingPlugin: | |
if a plugin cannot be created. |
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: |
|
---|---|
Returns: | The plugin class that will be loaded or None if not provided. |
Raises exceptions.NoMatchingPlugin: | |
if a plugin cannot be created. |
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.
auth_plugin: | The name of the pluign to load. |
---|---|
auth_section: | The config file section to load options from. |
Returns: | A list of oslo.config options. |
---|
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.
Returns: | A list of oslo.config options. |
---|
Load a plugin from an oslo.config CONF object.
Each plugin will register there 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: |
|
---|---|
Returns plugin: | An authentication Plugin. |
Raises exceptions.NoMatchingPlugin: | |
if a plugin cannot be created. |
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_plugin: 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: |
|
---|
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.
Return the supplied endpoint.
Using this plugin the same endpoint is returned regardless of the parameters passed to the plugin.
Bases: object
The basic structure of an authentication plugin.
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:
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. |
Return the list of parameters associated with the auth plugin.
This list may be used to generate CLI or config arguments.
Returns list: | A list of Param objects describing available plugin parameters. |
---|
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. |
Invalidate the current authentication data.
This should result in fetching a new token on next call.
A plugin may be invalidated if an Unauthorized HTTP response is returned to indicate that the token may have been revoked or is otherwise now invalid.
Returns bool: | True if there was something that the plugin did to invalidate. This means that it makes sense to try again. If nothing happens returns False to indicate give up. |
---|
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.
Retrieve a plugin class by its entrypoint name.
Parameters: | name (str) – The name of the object to get. |
---|---|
Returns: | An auth plugin class. |
Raises exceptions.NoMatchingPlugin: | |
if a plugin cannot be created. |
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. |
Raises exceptions.NoMatchingPlugin: | |
if a plugin cannot be created. |
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: |
|
---|---|
Returns: | The plugin class that will be loaded or None if not provided. |
Raises exceptions.NoMatchingPlugin: | |
if a plugin cannot be created. |
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.
auth_plugin: | The name of the pluign to load. |
---|---|
auth_section: | The config file section to load options from. |
Returns: | A list of oslo.config options. |
---|
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.
Returns: | A list of oslo.config options. |
---|
Load a plugin from an oslo.config CONF object.
Each plugin will register there 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: |
|
---|---|
Returns plugin: | An authentication Plugin. |
Raises exceptions.NoMatchingPlugin: | |
if a plugin cannot be created. |
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_plugin: 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: |
|
---|