taolib.testing.oauth.models.credential

目录

taolib.testing.oauth.models.credential#

OAuth 应用凭证数据模型模块。

定义 OAuth 应用凭证(client_id/client_secret)相关的 Pydantic 模型。

Classes#

OAuthAppCredentialBase

OAuth 应用凭证基础模型。

OAuthAppCredentialCreate

创建 OAuth 应用凭证请求模型。

OAuthAppCredentialUpdate

更新 OAuth 应用凭证请求模型。

OAuthAppCredentialResponse

OAuth 应用凭证响应模型。

OAuthAppCredentialDocument

MongoDB OAuth 应用凭证文档模型。

Module Contents#

class taolib.testing.oauth.models.credential.OAuthAppCredentialBase#

Bases: pydantic.BaseModel

OAuth 应用凭证基础模型。

provider: taolib.testing.oauth.models.enums.OAuthProvider#
client_id: str#
display_name: str#
enabled: bool#
allowed_scopes: list[str]#
redirect_uri: str#
class taolib.testing.oauth.models.credential.OAuthAppCredentialCreate#

Bases: OAuthAppCredentialBase

创建 OAuth 应用凭证请求模型。

client_secret: str#
class taolib.testing.oauth.models.credential.OAuthAppCredentialUpdate#

Bases: pydantic.BaseModel

更新 OAuth 应用凭证请求模型。

client_id: str | None#
client_secret: str | None#
display_name: str | None#
enabled: bool | None#
allowed_scopes: list[str] | None#
redirect_uri: str | None#
class taolib.testing.oauth.models.credential.OAuthAppCredentialResponse#

Bases: pydantic.BaseModel

OAuth 应用凭证响应模型。

不包含 client_secret。

id: str#
provider: taolib.testing.oauth.models.enums.OAuthProvider#
client_id: str#
display_name: str#
enabled: bool#
allowed_scopes: list[str]#
redirect_uri: str#
created_by: str#
created_at: datetime.datetime#
updated_at: datetime.datetime#
model_config: dict[str, Any]#
class taolib.testing.oauth.models.credential.OAuthAppCredentialDocument#

Bases: pydantic.BaseModel

MongoDB OAuth 应用凭证文档模型。

id: str#
provider: taolib.testing.oauth.models.enums.OAuthProvider#
client_id: str#
client_secret_encrypted: str#
display_name: str#
enabled: bool#
allowed_scopes: list[str]#
redirect_uri: str#
created_by: str#
created_at: datetime.datetime#
updated_at: datetime.datetime#
model_config: dict[str, Any]#
to_response() OAuthAppCredentialResponse#

转换为响应模型(不包含 client_secret)。