taolib.testing.oauth.models.session#

OAuth 会话数据模型模块。

定义跨服务 OAuth 会话相关的 Pydantic 模型。

Classes#

OAuthSessionResponse

OAuth 会话响应模型。

OAuthSessionDocument

MongoDB OAuth 会话文档模型。

Module Contents#

class taolib.testing.oauth.models.session.OAuthSessionResponse#

Bases: pydantic.BaseModel

OAuth 会话响应模型。

id: str#
user_id: str#
provider: taolib.testing.oauth.models.enums.OAuthProvider#
ip_address: str#
user_agent: str#
is_active: bool#
created_at: datetime.datetime#
expires_at: datetime.datetime#
last_activity_at: datetime.datetime#
model_config: dict[str, Any]#
class taolib.testing.oauth.models.session.OAuthSessionDocument#

Bases: pydantic.BaseModel

MongoDB OAuth 会话文档模型。

id: str#
user_id: str#
provider: taolib.testing.oauth.models.enums.OAuthProvider#
connection_id: str#
jwt_access_token: str#
jwt_refresh_token: str#
ip_address: str#
user_agent: str#
is_active: bool#
created_at: datetime.datetime#
expires_at: datetime.datetime#
last_activity_at: datetime.datetime#
model_config: dict[str, Any]#
to_response() OAuthSessionResponse#

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