mirror of
https://github.com/fawney19/Aether.git
synced 2026-09-02 09:20:22 +08:00
feat(oauth): 新增 Codex account_user_id 和 organizations 字段采集、展示与判重
- 从 Codex id_token claims 和 token_response 中提取 account_user_id 和 organizations - OAuth 判重逻辑改为优先按 account_user_id 匹配,支持同用户不同 Team 不误判 - 号池和 Provider 详情页展示组织标签、account ID 和 account_user_id - 前端重复的 OAuth identity 工具函数提取到 utils/oauthIdentity.ts - 后端重复的 normalize_oauth_organizations 提取到 core/provider_oauth_utils.py
This commit is contained in:
@@ -710,6 +710,13 @@ class EndpointAPIKeyUpdate(BaseModel):
|
||||
return v.strip()
|
||||
|
||||
|
||||
class OAuthOrganizationResponse(BaseModel):
|
||||
id: str | None = Field(default=None, description="OAuth 组织/工作区 ID")
|
||||
title: str | None = Field(default=None, description="OAuth 组织/工作区标题")
|
||||
is_default: bool = Field(default=False, description="是否为默认组织/工作区")
|
||||
role: str | None = Field(default=None, description="当前账号在组织中的角色")
|
||||
|
||||
|
||||
class EndpointAPIKeyResponse(BaseModel):
|
||||
"""Endpoint API Key 响应"""
|
||||
|
||||
@@ -753,6 +760,14 @@ class EndpointAPIKeyResponse(BaseModel):
|
||||
default=None, description="OAuth 账号套餐类型(如 free/plus/team/enterprise)"
|
||||
)
|
||||
oauth_account_id: str | None = Field(default=None, description="OAuth 账号 ID")
|
||||
oauth_account_user_id: str | None = Field(
|
||||
default=None,
|
||||
description="OAuth 账号-工作区联合 ID(如 Codex chatgpt_account_user_id)",
|
||||
)
|
||||
oauth_organizations: list[OAuthOrganizationResponse] = Field(
|
||||
default_factory=list,
|
||||
description="OAuth 关联的组织/工作区摘要列表",
|
||||
)
|
||||
oauth_invalid_at: int | None = Field(
|
||||
default=None, description="OAuth Token 失效时间(Unix 时间戳),如账号被封、授权撤销等"
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user