keystone.credential.backends.sql 模块

class keystone.credential.backends.sql.Credential[source]

基类: CredentialDriverBase

create_credential(credential_id, credential)[source]

创建新的凭证。

引发:

keystone.exception.Conflict – 如果存在重复的凭证。

delete_credential(credential_id)[source]

删除现有的凭证。

引发:

keystone.exception.CredentialNotFound – 如果凭证不存在。

delete_credentials_for_project(project_id)[source]

删除项目的全部凭证。

delete_credentials_for_user(user_id)[source]

删除用户的全部凭证。

get_credential(credential_id)[source]

通过 ID 获取凭证。

返回值:

credential_ref

引发:

keystone.exception.CredentialNotFound – 如果凭证不存在。

list_credentials(hints)[source]

列出所有凭证。

参数:

hints – 包含尚未满足的过滤器列表。此处满足的任何过滤器都将被删除,以便调用者知道是否仍有任何过滤器剩余。

返回值:

一个 credential_refs 列表或一个空列表。

list_credentials_for_user(user_id, type=None)[source]

列出用户的凭证。

参数:
  • user_id – 用于筛选凭证的用户 ID。

  • type – 用于筛选的凭证类型。

返回值:

一个 credential_refs 列表或一个空列表。

update_credential(credential_id, credential)[source]

更新现有的凭证。

引发:
class keystone.credential.backends.sql.CredentialModel(*args, **kwargs)[source]

基类: Base, ModelDictMixinWithExtras

attributes: list[str] = ['id', 'user_id', 'project_id', 'encrypted_blob', 'type', 'key_hash']
encrypted_blob
extra
id
key_hash
project_id
type
user_id