keystoneauth1.identity.v3.oauth2_mtls_client_credential 模块

class keystoneauth1.identity.v3.oauth2_mtls_client_credential.OAuth2mTlsClientCredential(auth_url: str, oauth2_endpoint: str, oauth2_client_id: str, *, trust_id: str | None = None, system_scope: str | None = None, domain_id: str | None = None, domain_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, reauthenticate: bool = True, include_catalog: bool = True)

基础: BaseAuth

通过 OAuth2.0 mTLS 客户端凭据进行身份验证的插件。

参数:
  • auth_url (字符串) – keystone 授权端点。

  • oauth2_endpoint (string) – OAuth2.0 端点。

  • oauth2_client_id (string) – OAuth2.0 客户端凭据 ID。

__abstractmethods__ = frozenset({})
__annotations__ = {'MIN_TOKEN_LIFE_SECONDS': 'int', '_discovery_cache': 'dict[str, discover.Discover]', 'auth_ref': 'access.AccessInfo | None', 'auth_url': 'str', 'reauthenticate': 'bool'}
__doc__ = '一个 通过 OAuth2.0 mTLS 客户端凭据进行身份验证的插件。\n\n    :param 字符串 auth_url: keystone 授权端点。\n    :param 字符串 oauth2_endpoint: OAuth2.0 端点。\n    :param 字符串 oauth2_client_id: OAuth2.0 客户端凭据 ID。\n    '
__init__(auth_url: str, oauth2_endpoint: str, oauth2_client_id: str, *, trust_id: str | None = None, system_scope: str | None = None, domain_id: str | None = None, domain_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, reauthenticate: bool = True, include_catalog: bool = True)
__module__ = 'keystoneauth1.identity.v3.oauth2_mtls_client_credential'
_abc_impl = <_abc._abc_data object>
_discovery_cache: dict[str, discover.Discover]
auth_ref: access.AccessInfo | None
auth_url: str
get_auth_ref(session: Session) AccessInfoV3

从 OpenStack Identity 服务获取令牌。

此方法由各种令牌版本插件覆盖。

不应独立调用此函数,并预计通过 do_authenticate 函数调用。

如果插件缓存的 AccessInfo 对象无效,将调用此函数。因此,插件应始终在调用时获取新的 AccessInfo。如果您只想检索当前的身份验证数据,则应使用 get_access。

参数:

session (keystoneauth1.session.Session) – 可以用于通信的会话对象。

引发:
  • keystoneauth1.exceptions.response.InvalidResponse – 返回的响应不合适。

  • keystoneauth1.exceptions.http.HttpError – 来自无效 HTTP 响应的错误。

  • keystoneauth1.exceptions.ClientException – 获取 OAuth2.0 访问令牌时出错。

返回值:

令牌访问信息。

返回类型:

keystoneauth1.access.AccessInfo

get_headers(session: Session) dict[str, str] | None

获取消息的身份验证头。

参数:

session (keystoneauth1.session.Session) – 该认证插件所属的会话对象。

返回值:

用于验证消息的头,或者失败的 None。请注意,空字典是一个有效的、非失败的响应。

返回类型:

dict

reauthenticate: bool