mirror of
https://github.com/tiennm99/litellm.git
synced 2026-08-13 20:23:56 +00:00
Merge remote-tracking branch 'origin' into litellm_e2e_create_key_test
This commit is contained in:
@@ -0,0 +1,3 @@
|
||||
ignore:
|
||||
- vulnerability: CVE-2019-1010022
|
||||
reason: no fixed glibc package is available yet in the Wolfi repositories, so this is ignored temporarily until an upstream release exists
|
||||
@@ -101,12 +101,12 @@ run_grype_scans() {
|
||||
# Build and scan Dockerfile.database
|
||||
echo "Building and scanning Dockerfile.database..."
|
||||
docker build --no-cache -t litellm-database:latest -f ./docker/Dockerfile.database .
|
||||
grype litellm-database:latest --fail-on critical
|
||||
grype litellm-database:latest --config ci_cd/.grype.yaml --fail-on critical
|
||||
|
||||
# Build and scan main Dockerfile
|
||||
echo "Building and scanning main Dockerfile..."
|
||||
docker build --no-cache -t litellm:latest .
|
||||
grype litellm:latest --fail-on critical
|
||||
grype litellm:latest --config ci_cd/.grype.yaml --fail-on critical
|
||||
|
||||
# Restore original .dockerignore
|
||||
echo "Restoring original .dockerignore..."
|
||||
@@ -129,6 +129,11 @@ run_grype_scans() {
|
||||
"CVE-2025-13836" # Python 3.13 HTTP response reading OOM/DoS - no fix available in base image
|
||||
"CVE-2025-12084" # Python 3.13 xml.dom.minidom quadratic algorithm - no fix available in base image
|
||||
"CVE-2025-60876" # BusyBox wget HTTP request splitting - no fix available in Chainguard Wolfi base image
|
||||
"CVE-2010-4756" # glibc glob DoS - awaiting patched Wolfi glibc build
|
||||
"CVE-2019-1010022" # glibc stack guard bypass - awaiting patched Wolfi glibc build
|
||||
"CVE-2019-1010023" # glibc ldd remap issue - awaiting patched Wolfi glibc build
|
||||
"CVE-2019-1010024" # glibc ASLR mitigation bypass - awaiting patched Wolfi glibc build
|
||||
"CVE-2019-1010025" # glibc pthread heap address leak - awaiting patched Wolfi glibc build
|
||||
)
|
||||
|
||||
# Build JSON array of allowlisted CVE IDs for jq
|
||||
|
||||
@@ -317,34 +317,6 @@ def test_openai_azure_embedding():
|
||||
pytest.fail(f"Error occurred: {e}")
|
||||
|
||||
|
||||
@pytest.mark.skipif(
|
||||
os.environ.get("CIRCLE_OIDC_TOKEN") is None,
|
||||
reason="Cannot run without being in CircleCI Runner",
|
||||
)
|
||||
def test_aaaaaa_openai_azure_embedding_with_oidc_and_cf():
|
||||
# TODO: Switch to our own Azure account, currently using ai.moda's account
|
||||
os.environ["AZURE_TENANT_ID"] = "17c0a27a-1246-4aa1-a3b6-d294e80e783c"
|
||||
os.environ["AZURE_CLIENT_ID"] = "4faf5422-b2bd-45e8-a6d7-46543a38acd0"
|
||||
|
||||
old_key = os.environ["AZURE_API_KEY"]
|
||||
os.environ.pop("AZURE_API_KEY", None)
|
||||
|
||||
try:
|
||||
response = embedding(
|
||||
model="azure/text-embedding-ada-002",
|
||||
input=["Hello"],
|
||||
azure_ad_token="oidc/circleci/",
|
||||
api_base="https://eastus2-litellm.openai.azure.com/",
|
||||
api_version="2024-06-01",
|
||||
)
|
||||
print(response)
|
||||
|
||||
except Exception as e:
|
||||
pytest.fail(f"Error occurred: {e}")
|
||||
finally:
|
||||
os.environ["AZURE_API_KEY"] = old_key
|
||||
|
||||
|
||||
from openai.types.embedding import Embedding
|
||||
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ import { keyListCall } from "@/components/networking";
|
||||
import { KeyResponse } from "@/components/key_team_helpers/key_list";
|
||||
import useAuthorized from "@/app/(dashboard)/hooks/useAuthorized";
|
||||
|
||||
const keyKeys = createQueryKeys("keys");
|
||||
export const keyKeys = createQueryKeys("keys");
|
||||
|
||||
export interface KeysResponse {
|
||||
keys: KeyResponse[];
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { render, screen } from "@testing-library/react";
|
||||
import { beforeEach, describe, expect, it, vi } from "vitest";
|
||||
import { renderWithProviders, screen } from "../../../tests/test-utils";
|
||||
import CreateKey from "./create_key_button";
|
||||
|
||||
const mockKeyCreateCall = vi.fn().mockResolvedValue({
|
||||
@@ -58,7 +58,7 @@ describe("CreateKey", () => {
|
||||
});
|
||||
|
||||
it("should render the CreateKey component", () => {
|
||||
render(<CreateKey {...defaultProps} />);
|
||||
renderWithProviders(<CreateKey {...defaultProps} />);
|
||||
expect(screen.getByRole("button", { name: /create new key/i })).toBeInTheDocument();
|
||||
});
|
||||
});
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
"use client";
|
||||
import { keyKeys } from "@/app/(dashboard)/hooks/keys/useKeys";
|
||||
import useAuthorized from "@/app/(dashboard)/hooks/useAuthorized";
|
||||
import { formatNumberWithCommas } from "@/utils/dataUtils";
|
||||
import { InfoCircleOutlined } from "@ant-design/icons";
|
||||
import { useQueryClient } from "@tanstack/react-query";
|
||||
import { Accordion, AccordionBody, AccordionHeader, Button, Col, Grid, Text, TextInput, Title } from "@tremor/react";
|
||||
import { Button as Button2, Form, Input, Modal, Radio, Select, Switch, Tooltip } from "antd";
|
||||
import debounce from "lodash/debounce";
|
||||
@@ -136,6 +138,7 @@ export const fetchUserModels = async (
|
||||
*/
|
||||
const CreateKey: React.FC<CreateKeyProps> = ({ team, teams, data, addKey }) => {
|
||||
const { accessToken, userId: userID, userRole, premiumUser } = useAuthorized();
|
||||
const queryClient = useQueryClient();
|
||||
const [form] = Form.useForm();
|
||||
const [isModalVisible, setIsModalVisible] = useState(false);
|
||||
const [apiKey, setApiKey] = useState(null);
|
||||
@@ -392,6 +395,10 @@ const CreateKey: React.FC<CreateKeyProps> = ({ team, teams, data, addKey }) => {
|
||||
// Also directly update the keys list in VirtualKeysTable without an API call
|
||||
addKey(response);
|
||||
|
||||
// Invalidate and refetch all keys list queries to update the table
|
||||
// This will trigger a refetch of all key list queries regardless of pagination
|
||||
queryClient.invalidateQueries({ queryKey: keyKeys.lists() });
|
||||
|
||||
setApiKey(response["key"]);
|
||||
setSoftBudget(response["soft_budget"]);
|
||||
NotificationsManager.success("Virtual Key Created");
|
||||
|
||||
Reference in New Issue
Block a user