keystoneauth1.noauth module¶
-
class
keystoneauth1.noauth.
NoAuth
(endpoint: Optional[str] = None) Bases:
keystoneauth1.plugin.FixedEndpointPlugin
A provider that will always use no auth.
This is useful to unify session/adapter loading for services that might be deployed in standalone/noauth mode.
-
__doc__
= 'A provider that will always use no auth.\n\n This is useful to unify session/adapter loading for services\n that might be deployed in standalone/noauth mode.\n '
-
__module__
= 'keystoneauth1.noauth'
-
get_token
(session: ks_session.Session) → Optional[str] 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.
Returning None will indicate that no token was able to be retrieved.
This function is misplaced as it should only be required for auth plugins that use the ‘X-Auth-Token’ header. However due to the way plugins evolved this method is required and often called to trigger an authentication request on a new plugin.
When implementing a new plugin it is advised that you implement this method, however if you don’t require the ‘X-Auth-Token’ header override the get_headers method instead.
- Parameters
session (keystoneauth1.session.Session) – A session object so the plugin can make HTTP calls.
- Returns
A token to use.
- Return type
string
-