Bases: keystoneauth1.identity.base.BaseIdentityPlugin
A plugin that turns an existing AccessInfo object into a usable plugin.
There are cases where reuse of an auth_ref or AccessInfo object is warranted such as from a cache, from auth_token middleware, or another source.
Turn the existing access info object into an identity plugin. This plugin cannot be refreshed as the AccessInfo object does not contain any authorizing information.
Parameters: |
|
---|
Bases: keystoneauth1.plugin.BaseAuthPlugin
Fetch or return a current AccessInfo object.
If a valid AccessInfo is present then it is returned otherwise a new one will be fetched.
Parameters: | session (keystoneauth1.session.Session) – A session object that can be used for communication. |
---|---|
Raises keystoneauth1.exceptions.http.HttpError: | |
An error from an invalid HTTP response. | |
Returns: | Valid AccessInfo |
Return type: | keystoneauth1.access.AccessInfo |
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.
Parameters: | session (keystoneauth1.session.Session) – A session object that can be used for communication. |
---|---|
Raises: |
|
Returns: | Token access information. |
Return type: |
Retrieve the current authentication state for the plugin.
Retrieve any internal state that represents the authenticated plugin.
This should not fetch any new data if it is not present.
Returns: | a string that can be stored or None if there is no auth state present in the plugin. This string can be reloaded with set_auth_state to set the same authentication. |
---|---|
Return type: | str or None if no auth present. |
Fetch an identifier that uniquely identifies the auth options.
The returned identifier need not be decomposable or otherwise provide any way to recreate the plugin.
This string MUST change if any of the parameters that are used to uniquely identity this plugin change. It should not change upon a reauthentication of the plugin.
Returns: | A unique string for the set of options |
---|---|
Return type: | str or None if this is unsupported or unavailable. |
Get the elements for this auth plugin that make it unique.
As part of the get_cache_id requirement we need to determine what aspects of this plugin and its values that make up the unique elements.
This should be overriden by plugins that wish to allow caching.
Returns: | The unique attributes and values of this plugin. |
---|---|
Return type: | A flat dict with a str key and str or None value. This is required as we feed these values into a hash. Pairs where the value is None are ignored in the hashed id. |
Return the discovery object for a URL.
Check the session and the plugin cache to see if we have already performed discovery on the URL and if so return it, otherwise create a new discovery object, cache it and return it.
This function is expected to be used by subclasses and should not be needed by users.
Parameters: |
|
---|---|
Raises: |
|
Returns: | A discovery object with the results of looking up that URL. |
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: |
|
---|---|
Raises keystoneauth1.exceptions.http.HttpError: | |
An error from an invalid HTTP response. |
|
Returns: | A valid endpoint URL or None if not available. |
Return type: | string or None |
Return a valid auth token.
If a valid token is not present then a new one will be fetched.
Parameters: | session (keystoneauth1.session.Session) – A session object that can be used for communication. |
---|---|
Raises keystoneauth1.exceptions.http.HttpError: | |
An error from an invalid HTTP response. | |
Returns: | A valid token. |
Return type: | string |
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: | 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. |
---|---|
Return type: | bool |
Install existing authentication state for a plugin.
Take the output of get_auth_state and install that authentication state into the current authentication plugin.
Bases: keystoneauth1.identity.base.BaseIdentityPlugin
Identity V2 Authentication Plugin.
Parameters: |
|
---|
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. |
---|---|
Returns: | A dict of authentication data for the auth type. |
Return type: | dict |
Return true if parameters can be used to create a scoped token.
Bases: keystoneauth1.identity.v2.Auth
A plugin for authenticating with a username and password.
A username or user_id must be provided.
Parameters: |
|
---|---|
Raises TypeError: | |
if a user_id or username is not provided. |
Bases: keystoneauth1.identity.v2.Auth
A plugin for authenticating with an existing token.
Parameters: |
|
---|
Bases: keystoneauth1.plugin.BaseAuthPlugin
Fetch or return a current AccessInfo object.
If a valid AccessInfo is present then it is returned otherwise a new one will be fetched.
Parameters: | session (keystoneauth1.session.Session) – A session object that can be used for communication. |
---|---|
Raises keystoneauth1.exceptions.http.HttpError: | |
An error from an invalid HTTP response. | |
Returns: | Valid AccessInfo |
Return type: | keystoneauth1.access.AccessInfo |
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.
Parameters: | session (keystoneauth1.session.Session) – A session object that can be used for communication. |
---|---|
Raises: |
|
Returns: | Token access information. |
Return type: |
Retrieve the current authentication state for the plugin.
Retrieve any internal state that represents the authenticated plugin.
This should not fetch any new data if it is not present.
Returns: | a string that can be stored or None if there is no auth state present in the plugin. This string can be reloaded with set_auth_state to set the same authentication. |
---|---|
Return type: | str or None if no auth present. |
Fetch an identifier that uniquely identifies the auth options.
The returned identifier need not be decomposable or otherwise provide any way to recreate the plugin.
This string MUST change if any of the parameters that are used to uniquely identity this plugin change. It should not change upon a reauthentication of the plugin.
Returns: | A unique string for the set of options |
---|---|
Return type: | str or None if this is unsupported or unavailable. |
Get the elements for this auth plugin that make it unique.
As part of the get_cache_id requirement we need to determine what aspects of this plugin and its values that make up the unique elements.
This should be overriden by plugins that wish to allow caching.
Returns: | The unique attributes and values of this plugin. |
---|---|
Return type: | A flat dict with a str key and str or None value. This is required as we feed these values into a hash. Pairs where the value is None are ignored in the hashed id. |
Return the discovery object for a URL.
Check the session and the plugin cache to see if we have already performed discovery on the URL and if so return it, otherwise create a new discovery object, cache it and return it.
This function is expected to be used by subclasses and should not be needed by users.
Parameters: |
|
---|---|
Raises: |
|
Returns: | A discovery object with the results of looking up that URL. |
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: |
|
---|---|
Raises keystoneauth1.exceptions.http.HttpError: | |
An error from an invalid HTTP response. |
|
Returns: | A valid endpoint URL or None if not available. |
Return type: | string or None |
Return a valid auth token.
If a valid token is not present then a new one will be fetched.
Parameters: | session (keystoneauth1.session.Session) – A session object that can be used for communication. |
---|---|
Raises keystoneauth1.exceptions.http.HttpError: | |
An error from an invalid HTTP response. | |
Returns: | A valid token. |
Return type: | string |
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: | 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. |
---|---|
Return type: | bool |
Install existing authentication state for a plugin.
Take the output of get_auth_state and install that authentication state into the current authentication plugin.
Bases: keystoneauth1.identity.generic.base.BaseGenericPlugin
See keystoneauth1.identity.generic.Password
Bases: keystoneauth1.identity.generic.base.BaseGenericPlugin
See keystoneauth1.identity.generic.Token
See keystoneauth1.identity.v2.Password
alias of Password
See keystoneauth1.identity.v2.Token
alias of Token
See keystoneauth1.identity.v3.Password
alias of Password
See keystoneauth1.identity.v3.Token
alias of Token
See keystoneauth1.identity.v3.oidc.OidcPassword
alias of OidcPassword
See keystoneauth1.identity.v3.oidc.OidcAuthorizationCode
alias of OidcAuthorizationCode
See keystoneauth1.identity.v3.oidc.OidcAccessToken
alias of OidcAccessToken
See keystoneauth1.identity.v3.TOTP
alias of TOTP
See keystoneauth1.identity.v3.TokenlessAuth
alias of TokenlessAuth