taolib.testing.oauth.repository.credential_repo#

OAuth 应用凭证 Repository 模块。

提供 OAuth 应用凭证的数据访问操作。

Classes#

OAuthAppCredentialRepository

OAuth 应用凭证数据访问层。

Module Contents#

class taolib.testing.oauth.repository.credential_repo.OAuthAppCredentialRepository(collection)#

Bases: taolib.testing._base.repository.AsyncRepository[taolib.testing.oauth.models.credential.OAuthAppCredentialDocument]

OAuth 应用凭证数据访问层。

async find_by_provider(provider: taolib.testing.oauth.models.enums.OAuthProvider | str) taolib.testing.oauth.models.credential.OAuthAppCredentialDocument | None#

按提供商查找已启用的凭证。

参数:

provider -- OAuth 提供商

返回:

凭证文档,不存在则返回 None

async find_all() list[taolib.testing.oauth.models.credential.OAuthAppCredentialDocument]#

获取所有凭证(包含已禁用的)。

返回:

凭证文档列表

async create_indexes() None#

创建 MongoDB 索引。