keystoneauth1.identity.generic.base module¶
- class keystoneauth1.identity.generic.base.BaseGenericPlugin(auth_url: str | None = None, tenant_id: str | None = None, tenant_name: str | None = None, project_id: str | None = None, project_name: str | None = None, project_domain_id: str | None = None, project_domain_name: str | None = None, domain_id: str | None = None, domain_name: str | None = None, system_scope: str | None = None, trust_id: str | None = None, default_domain_id: str | None = None, default_domain_name: str | None = None, reauthenticate: bool = True)
Bases:
BaseIdentityPlugin
An identity plugin that is not version dependent.
Internally we will construct a version dependent plugin with the resolved URL and then proxy all calls from the base plugin to the versioned one.
- __abstractmethods__ = frozenset({'create_plugin', 'get_cache_id_elements'})
- __annotations__ = {'MIN_TOKEN_LIFE_SECONDS': 'int', '_discovery_cache': 'ty.Dict[str, discover.Discover]', '_plugin': 'ty.Union[v2.Auth, v3.AuthConstructor, None]', 'auth_ref': 'ty.Optional[access.AccessInfo]', 'auth_url': <class 'str'>, 'reauthenticate': 'bool'}
- __doc__ = 'An identity plugin that is not version dependent.\n\n Internally we will construct a version dependent plugin with the resolved\n URL and then proxy all calls from the base plugin to the versioned one.\n '
- __init__(auth_url: str | None = None, tenant_id: str | None = None, tenant_name: str | None = None, project_id: str | None = None, project_name: str | None = None, project_domain_id: str | None = None, project_domain_name: str | None = None, domain_id: str | None = None, domain_name: str | None = None, system_scope: str | None = None, trust_id: str | None = None, default_domain_id: str | None = None, default_domain_name: str | None = None, reauthenticate: bool = True)
- __module__ = 'keystoneauth1.identity.generic.base'
- _abc_impl = <_abc._abc_data object>
- _do_create_plugin(session: Session) Auth | AuthConstructor
- property _has_domain_scope: bool
Are there domain parameters.
Domain parameters are v3 only so returns if any are set.
- Returns:
True if a domain parameter is set, false otherwise.
- _plugin: Auth | AuthConstructor | None
- auth_ref: AccessInfo | None
- auth_url: str
- abstract create_plugin(session: Session, version: Tuple[int | float, ...], url: str, raw_status: str | None = None) None | Auth | AuthConstructor
Create a plugin from the given parameters.
This function will be called multiple times with the version and url of a potential endpoint. If a plugin can be constructed that fits the params then it should return it. If not return None and then another call will be made with other available URLs.
- Parameters:
- Returns:
A plugin that can match the parameters or None if nothing.
- get_auth_ref(session: Session, **kwargs: Any) 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:
keystoneauth1.exceptions.response.InvalidResponse – The response returned wasn’t appropriate.
keystoneauth1.exceptions.http.HttpError – An error from an invalid HTTP response.
- Returns:
Token access information.
- Return type:
keystoneauth1.access.AccessInfo
- abstract get_cache_id_elements() Dict[str, str | None]
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 overridden 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.
- reauthenticate: bool