# keystoneauth1.identity.generic package

## Submodules

- keystoneauth1.identity.generic.base module
  - `BaseGenericPlugin`
    - `BaseGenericPlugin.__abstractmethods__`
    - `BaseGenericPlugin.__annotations_cache__`
    - `BaseGenericPlugin.__doc__`
    - `BaseGenericPlugin.__firstlineno__`
    - `BaseGenericPlugin.__init__()`
    - `BaseGenericPlugin.__module__`
    - `BaseGenericPlugin.__static_attributes__`
    - `BaseGenericPlugin._abc_impl`
    - `BaseGenericPlugin._do_create_plugin()`
    - `BaseGenericPlugin._has_domain_scope`
    - `BaseGenericPlugin._plugin`
    - `BaseGenericPlugin.auth_url`
    - `BaseGenericPlugin.create_plugin()`
    - `BaseGenericPlugin.get_auth_ref()`
    - `BaseGenericPlugin.get_cache_id_elements()`
    - `BaseGenericPlugin.project_domain_id`
    - `BaseGenericPlugin.project_domain_name`
- keystoneauth1.identity.generic.password module
  - `Password`
    - `Password.__abstractmethods__`
    - `Password.__annotate_func__`
    - `Password.__annotations_cache__`
    - `Password.__doc__`
    - `Password.__firstlineno__`
    - `Password.__init__()`
    - `Password.__module__`
    - `Password.__static_attributes__`
    - `Password._abc_impl`
    - `Password.create_plugin()`
    - `Password.get_cache_id_elements()`
    - `Password.user_domain_id`
    - `Password.user_domain_name`
- keystoneauth1.identity.generic.token module
  - `Token`
    - `Token.__abstractmethods__`
    - `Token.__annotate_func__`
    - `Token.__annotations_cache__`
    - `Token.__doc__`
    - `Token.__firstlineno__`
    - `Token.__init__()`
    - `Token.__module__`
    - `Token.__static_attributes__`
    - `Token._abc_impl`
    - `Token.create_plugin()`
    - `Token.get_cache_id_elements()`

## Module contents

class keystoneauth1.identity.generic.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_cache__ = {'_plugin': 'v2.Auth | v3.Auth | None', 'auth_url': <class 'str'>}
  __doc__ = 'An identity plugin that is not version dependent.\n\nInternally we will construct a version dependent plugin with the resolved\nURL and then proxy all calls from the base plugin to the versioned one.\n'
  __firstlineno__ = 29
  __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'
  __static_attributes__ = ('_default_domain_id', '_default_domain_name', '_domain_id', '_domain_name', '_plugin', '_project_domain_id', '_project_domain_name', '_project_id', '_project_name', '_system_scope', '_trust_id')
  _abc_impl = <_abc._abc_data object>
  _do_create_plugin(session: Session) → Auth | Auth
  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 | Auth | None
  auth_url: str
  abstractmethod create_plugin(session: Session, version: tuple[int | float, ...], url: str, raw_status: str | None = None) → None | Auth | Auth

    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:

      - session (keystoneauth1.session.Session) – A session object.

      - version (tuple) – A tuple of the API version at the URL.

      - url (str) – The base URL for this version.

      - raw_status (str) – The status that was in the discovery field.

    Returns:

      A plugin that can match the parameters or None if nothing.

  get_auth_ref(session: Session) → 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`

  abstractmethod 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.

  property project_domain_id: str | None
  property project_domain_name: str | None

class keystoneauth1.identity.generic.Password(auth_url: str, username: str | None = None, user_id: str | None = None, password: str | None = None, user_domain_id: str | None = None, user_domain_name: 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: `BaseGenericPlugin`

  A common user/password authentication plugin.

  Parameters:

    - username (string) – Username for authentication.

    - user_id (string) – User ID for authentication.

    - password (string) – Password for authentication.

    - user_domain_id (string) – User’s domain ID for authentication.

    - user_domain_name (string) – User’s domain name for authentication.

  __abstractmethods__ = frozenset({})
  __annotate_func__ = None
  __annotations_cache__ = {}
  __doc__ = "A common user/password authentication plugin.\n\n:param string username: Username for authentication.\n:param string user_id: User ID for authentication.\n:param string password: Password for authentication.\n:param string user_domain_id: User's domain ID for authentication.\n:param string user_domain_name: User's domain name for authentication.\n"
  __firstlineno__ = 21
  __init__(auth_url: str, username: str | None = None, user_id: str | None = None, password: str | None = None, user_domain_id: str | None = None, user_domain_name: 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.password'
  __static_attributes__ = ('_password', '_user_domain_id', '_user_domain_name', '_user_id', '_username')
  _abc_impl = <_abc._abc_data object>
  create_plugin(session: Session, version: tuple[int | float, ...], url: str, raw_status: str | None = None) → None | Password | Password

    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:

      - session (keystoneauth1.session.Session) – A session object.

      - version (tuple) – A tuple of the API version at the URL.

      - url (str) – The base URL for this version.

      - raw_status (str) – The status that was in the discovery field.

    Returns:

      A plugin that can match the parameters or None if nothing.

  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.

  property user_domain_id: str | None
  property user_domain_name: str | None

class keystoneauth1.identity.generic.Token(auth_url: str, token: str, *, 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: `BaseGenericPlugin`

  Generic token auth plugin.

  Parameters:

    token (string) – Token for authentication.

  __abstractmethods__ = frozenset({})
  __annotate_func__ = None
  __annotations_cache__ = {}
  __doc__ = 'Generic token auth plugin.\n\n:param string token: Token for authentication.\n'
  __firstlineno__ = 21
  __init__(auth_url: str, token: str, *, 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.token'
  __static_attributes__ = ('_token',)
  _abc_impl = <_abc._abc_data object>
  create_plugin(session: Session, version: tuple[int | float, ...], url: str, raw_status: str | None = None) → None | Token | Token

    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:

      - session (keystoneauth1.session.Session) – A session object.

      - version (tuple) – A tuple of the API version at the URL.

      - url (str) – The base URL for this version.

      - raw_status (str) – The status that was in the discovery field.

    Returns:

      A plugin that can match the parameters or None if nothing.

  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.

this page last updated: 2026-07-14 15:48:40

Except where otherwise noted, this document is licensed under Creative Commons Attribution 3.0 License. See all OpenStack Legal Documents.

found an error? report a bug