keystoneauth1.identity.v3.k2k 模块¶
- class keystoneauth1.identity.v3.k2k.Keystone2Keystone(base_plugin: BaseIdentityPlugin, service_provider: 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)
基础类:
_Rescoped用于执行 Keystone 到 Keystone 身份验证流程的插件。
在此插件中,由 Keystone 身份提供者 (IdP) 提供的 ECP 封装的 SAML 断言用于向 Keystone 服务提供者 (SP) 请求 OpenStack 未限定范围的令牌。
- 参数:
base_plugin (keystoneauth1.identity.v3.base.BaseAuth) – 已经过身份验证的 Keystone IdP 的身份验证插件。
service_provider (str) – 服务提供者 ID,如 ServiceProviderManager.list() 返回。
- HTTP_MOVED_TEMPORARILY = 302
- HTTP_SEE_OTHER = 303
- REQUEST_ECP_URL = '/auth/OS-FEDERATION/saml2/ecp'
应将 ECP 封装的 SAML 断言呈现给 Keystone 服务提供者的路径。
- __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__ = '用于执行 Keystone 到 Keystone 身份验证流程的插件。\n\n 在此插件中,由 Keystone 身份提供者 (IdP) 提供的 ECP 封装的 SAML 断言用于向 Keystone\n 服务提供者 (SP) 请求 OpenStack 未限定范围的令牌。\n\n :param base_plugin: 已经过身份验证的 Keystone IdP 的身份验证插件。\n :type base_plugin: keystoneauth1.identity.v3.base.BaseAuth\n\n :param service_provider: 如 ServiceProviderManager.list() 返回的服务提供者 ID。\n :type service_provider: str\n\n '
- __init__(base_plugin: BaseIdentityPlugin, service_provider: 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.k2k'
- _abc_impl = <_abc._abc_data object>
- _get_ecp_assertion(session: Session) str
- classmethod _remote_auth_url(auth_url: str) str
返回远程 Keystone 服务提供商的 auth_url。
远程云的 auth_url 是一个用于获取联合的未限定令牌的端点,通常情况下,它会是
https://remote.example.com:5000/v3/OS-FEDERATION/identity_providers/ <idp>/protocols/<protocol_id>/auth。但是我们需要生成一个真实的 auth_url,用于令牌限定。此函数假定远程 auth_url 中存在今天的静态值存储在服务提供商属性中,并且可以使用这些值作为分隔符。如果 sp_auth_url 不符合标准的联合身份验证 url,该函数将简单地返回整个字符串。
- _send_service_provider_ecp_authn_response(session: Session, sp_url: str, sp_auth_url: str) Response
将 ECP 封装的 SAML 断言呈现给 keystone SP。
断言由 keystone IdP 发出,其目标是作为服务提供商的 keystone。
- 参数:
session – 用于发送 HTTP 请求的会话对象。
sp_url (str) – 将 ECP 封装的 SAML 断言呈现给 keystone SP 的 URL。通常,类似于:https://sp.com/Shibboleth.sso/SAML2/ECP
sp_auth_url (str) – keystone SP 的联合身份验证 URL。它由 IdP 指定,例如:https://sp.com/v3/OS-FEDERATION/identity_providers/ idp_id/protocols/protocol_id/auth
- auth_ref: access.AccessInfo | None
- auth_url: str
- get_unscoped_auth_ref(session: Session) AccessInfoV3
获取未范围限定的联合令牌。
- reauthenticate: bool