Build Agentic workflows, RAG pipelines, with rich AI model and tool support on one collaborative workspace. Deploy on cloud, VPC, or self-hosted, so teams move from prototype to production without rebuilding the stack.
Python agentagentic-aiagentic-frameworkagentic-workflowaiautomationclaudedeepseekgenaigptllmlow-codemcpnextjsno-codeopenaipythonskillsworkflow
feat(oauth): expose stable account id on provider account endpoint (#39470)
samzong922ed4d67df0
diff --git a/api/controllers/console/auth/oauth_server.py b/api/controllers/console/auth/oauth_server.pyindex 096426972c9..1c2cd07ff5a 100644--- a/api/controllers/console/auth/oauth_server.py+++ b/api/controllers/console/auth/oauth_server.py@@ -56,6 +56,7 @@ class OAuthProviderTokenResponse(BaseModel):class OAuthProviderAccountResponse(BaseModel):+ id: strname: stremail: stravatar: str | None = None@@ -251,6 +252,7 @@ class OAuthServerUserAccountApi(Resource):def post(self, oauth_provider_app: OAuthProviderApp, account: Account):return jsonable_encoder({+ "id": account.id,"name": account.name,"email": account.email,"avatar": account.avatar,diff --git a/api/openapi/markdown/console-openapi.md b/api/openapi/markdown/console-openapi.mdindex 15562e91955..2643812c6bf 100644--- a/api/openapi/markdown/console-openapi.md+++ b/api/openapi/markdown/console-openapi.md@@ -19559,6 +19559,7 @@ Coarse node-level status used by Inspector to pick a banner.| ---- | ---- | ----------- | -------- || avatar | string | | No || email | string | | Yes |+| id | string | | Yes || interface_language | string | | Yes || name | string | | Yes || timezone | string | | Yes |diff --git a/api/tests/test_containers_integration_tests/controllers/console/auth/test_oauth_server.py b/api/tests/test_containers_integration_tests/controllers/console/auth/test_oauth_server.pyindex 2ef27133d8b..b41efa4e7b5 100644--- a/api/tests/test_containers_integration_tests/controllers/console/auth/test_oauth_server.py+++ b/api/tests/test_containers_integration_tests/controllers/console/auth/test_oauth_server.py@@ -318,6 +318,7 @@ def test_oauth_account_successful_retrieval(assert response.status_code == 200assert response.get_json() == {+ "id": account.id,"name": "Test User","email": account.email,"avatar": "avatar_url",diff --git a/api/tests/unit_tests/controllers/console/auth/test_oauth_server.py b/api/tests/unit_tests/controllers/console/auth/test_oauth_server.pyindex 9372ec86926..ab5534c121c 100644--- a/api/tests/unit_tests/controllers/console/auth/test_oauth_server.py+++ b/api/tests/unit_tests/controllers/console/auth/test_oauth_server.py@@ -3,7 +3,7 @@ from __future__ import annotationsfrom inspect import unwrapfrom unittest.mock import patch-from controllers.console.auth.oauth_server import OAuthServerUserAuthorizeApi+from controllers.console.auth.oauth_server import OAuthServerUserAccountApi, OAuthServerUserAuthorizeApifrom models import Accountfrom models.account import AccountStatus, TenantAccountRolefrom models.model import OAuthProviderApp@@ -45,3 +45,13 @@ def test_oauth_authorize_uses_injected_current_user() -> None:sign_oauth_authorization_code.assert_called_once_with("client-1", "account-1")assert response == {"code": "authorization-code"}+++def test_oauth_account_returns_stable_account_id() -> None:+ api = OAuthServerUserAccountApi()+ method = unwrap(api.post)+ account = _make_account()++ response = method(api, _make_oauth_provider_app(), account)++ assert response["id"] == "account-1"diff --git a/packages/contracts/generated/api/console/oauth/types.gen.ts b/packages/contracts/generated/api/console/oauth/types.gen.tsindex 9c24b8b03bf..322e4ca74fb 100644--- a/packages/contracts/generated/api/console/oauth/types.gen.ts+++ b/packages/contracts/generated/api/console/oauth/types.gen.ts@@ -40,6 +40,7 @@ export type OAuthClientPayload = {export type OAuthProviderAccountResponse = {avatar?: string | nullemail: string+ id: stringinterface_language: stringname: stringtimezone: stringdiff --git a/packages/contracts/generated/api/console/oauth/zod.gen.ts b/packages/contracts/generated/api/console/oauth/zod.gen.tsindex 726993ebf91..2e2523a8b8a 100644--- a/packages/contracts/generated/api/console/oauth/zod.gen.ts+++ b/packages/contracts/generated/api/console/oauth/zod.gen.ts@@ -60,6 +60,7 @@ export const zOAuthClientPayload = z.object({export const zOAuthProviderAccountResponse = z.object({avatar: z.string().nullish(),email: z.string(),+ id: z.string(),interface_language: z.string(),name: z.string(),timezone: z.string(),