From 796e51713bd8f3f8c6b679c60c12d79d43db8548 Mon Sep 17 00:00:00 2001 From: Jason Cook Date: Thu, 16 Apr 2026 20:53:22 -0400 Subject: [PATCH] fix(oauth): address Greptile P2 findings on #25923 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Drop the redundant decorator-level ``dependencies=[Depends(user_api_key_auth)]`` on all 8 OAuth endpoints (4 each in chatgpt/copilot). The same dependency is already injected as a parameter, which runs it and binds the result — FastAPI's dependency cache makes the decorator-level duplicate a no-op at runtime, just visual noise. - Finish the @tremor/react → antd migration in ``credentials.tsx``: rename the ``AntdButton`` alias to ``Button`` and remove the ``Button`` entry from the @tremor/react import, so the top-level "Add Credential" button also goes through antd. No rendered changes (antd Button's children + onClick API matches what that call site already used). Co-Authored-By: Claude Opus 4.7 (1M context) --- litellm/proxy/chatgpt_oauth_endpoints/endpoints.py | 4 ---- litellm/proxy/copilot_oauth_endpoints/endpoints.py | 4 ---- .../src/components/model_add/credentials.tsx | 9 ++++----- 3 files changed, 4 insertions(+), 13 deletions(-) diff --git a/litellm/proxy/chatgpt_oauth_endpoints/endpoints.py b/litellm/proxy/chatgpt_oauth_endpoints/endpoints.py index a2e5faa2f96..144a1ef853c 100644 --- a/litellm/proxy/chatgpt_oauth_endpoints/endpoints.py +++ b/litellm/proxy/chatgpt_oauth_endpoints/endpoints.py @@ -114,7 +114,6 @@ def _get_session(session_id: str) -> Optional[Dict[str, Any]]: @router.post( "/start", response_model=StartResponse, - dependencies=[Depends(user_api_key_auth)], ) async def start_oauth( body: StartRequest, @@ -177,7 +176,6 @@ async def start_oauth( @router.get( "/status", response_model=StatusResponse, - dependencies=[Depends(user_api_key_auth)], ) async def oauth_status( session_id: str = Query( @@ -198,7 +196,6 @@ async def oauth_status( @router.post( "/cancel", - dependencies=[Depends(user_api_key_auth)], ) async def oauth_cancel( session_id: str = Query( @@ -221,7 +218,6 @@ async def oauth_cancel( @router.post( "/refresh", response_model=RefreshResponse, - dependencies=[Depends(user_api_key_auth)], ) async def oauth_refresh( body: RefreshRequest, diff --git a/litellm/proxy/copilot_oauth_endpoints/endpoints.py b/litellm/proxy/copilot_oauth_endpoints/endpoints.py index 74d5d4dd44d..061e2bea0f3 100644 --- a/litellm/proxy/copilot_oauth_endpoints/endpoints.py +++ b/litellm/proxy/copilot_oauth_endpoints/endpoints.py @@ -101,7 +101,6 @@ def _get_session(session_id: str) -> Optional[Dict[str, Any]]: @router.post( "/start", response_model=StartResponse, - dependencies=[Depends(user_api_key_auth)], ) async def start_oauth( body: StartRequest, @@ -163,7 +162,6 @@ async def start_oauth( @router.get( "/status", response_model=StatusResponse, - dependencies=[Depends(user_api_key_auth)], ) async def oauth_status( session_id: str = Query( @@ -184,7 +182,6 @@ async def oauth_status( @router.post( "/cancel", - dependencies=[Depends(user_api_key_auth)], ) async def oauth_cancel( session_id: str = Query( @@ -207,7 +204,6 @@ async def oauth_cancel( @router.post( "/refresh", response_model=RefreshResponse, - dependencies=[Depends(user_api_key_auth)], ) async def oauth_refresh( body: RefreshRequest, diff --git a/ui/litellm-dashboard/src/components/model_add/credentials.tsx b/ui/litellm-dashboard/src/components/model_add/credentials.tsx index 61a0b08c5d3..2678a3bbcd6 100644 --- a/ui/litellm-dashboard/src/components/model_add/credentials.tsx +++ b/ui/litellm-dashboard/src/components/model_add/credentials.tsx @@ -9,7 +9,6 @@ import { import { PencilAltIcon, RefreshIcon, TrashIcon } from "@heroicons/react/outline"; import { Badge, - Button, Card, Table, TableBody, @@ -19,7 +18,7 @@ import { TableRow, Text, } from "@tremor/react"; -import { Button as AntdButton, Form, Tooltip } from "antd"; +import { Button, Form, Tooltip } from "antd"; import { UploadProps } from "antd/es/upload"; import { useState } from "react"; import DeleteResourceModal from "../common_components/DeleteResourceModal"; @@ -192,7 +191,7 @@ const CredentialsPanel: React.FC = ({ uploadProps }) => { - } @@ -204,7 +203,7 @@ const CredentialsPanel: React.FC = ({ uploadProps }) => { {getOAuthRefreshCall(credential) && ( - } @@ -214,7 +213,7 @@ const CredentialsPanel: React.FC = ({ uploadProps }) => { )} - }