Skip to content

The fastest, litest AI Gateway. Rust core with Python SDK. Call 100+ LLM APIs in OpenAI (or native) format with cost tracking, guardrails, load balancing, and logging [Bedrock, Azure, OpenAI, Anthropic, OpenAI, VertexAI, vLLM, Nvidia NIM]

fix: add enterprise feature gating to RegenerateKeyModal in KeyInfoView (#11400)

Lik Weia24077fb4e6e
diff --git a/ui/litellm-dashboard/src/components/key_info_view.tsx b/ui/litellm-dashboard/src/components/key_info_view.tsx
index 4154c616115..087d60d20ec 100644
--- a/ui/litellm-dashboard/src/components/key_info_view.tsx
+++ b/ui/litellm-dashboard/src/components/key_info_view.tsx
@@ -18,7 +18,7 @@ import {
import { ArrowLeftIcon, TrashIcon, RefreshIcon } from "@heroicons/react/outline";
import { keyDeleteCall, keyUpdateCall } from "./networking";
import { KeyResponse } from "./key_team_helpers/key_list";
-import { Form, Input, InputNumber, message, Select } from "antd";
+import { Form, Input, InputNumber, message, Select, Tooltip } from "antd";
import { KeyEditView } from "./key_edit_view";
import { RegenerateKeyModal } from "./regenerate_key_modal";
import { rolesWithWriteAccess } from '../utils/roles';
@@ -34,9 +34,10 @@ interface KeyInfoViewProps {
userID: string | null;
userRole: string | null;
teams: any[] | null;
+ premiumUser: boolean;
}
-export default function KeyInfoView({ keyId, onClose, keyData, accessToken, userID, userRole, teams, onKeyDataUpdate, onDelete }: KeyInfoViewProps) {
+export default function KeyInfoView({ keyId, onClose, keyData, accessToken, userID, userRole, teams, onKeyDataUpdate, onDelete, premiumUser }: KeyInfoViewProps) {
const [isEditing, setIsEditing] = useState(false);
const [form] = Form.useForm();
const [isDeleteModalOpen, setIsDeleteModalOpen] = useState(false);
@@ -150,14 +151,19 @@ export default function KeyInfoView({ keyId, onClose, keyData, accessToken, user
</div>
{userRole && rolesWithWriteAccess.includes(userRole) && (
<div className="flex gap-2">
- <Button
- icon={RefreshIcon}
- variant="secondary"
- onClick={() => setIsRegenerateModalOpen(true)}
- className="flex items-center"
- >
- Regenerate Key
- </Button>
+ <Tooltip title={!premiumUser ? "This is a LiteLLM Enterprise feature, and requires a valid key to use." : ""}>
+ <span className="inline-block">
+ <Button
+ icon={RefreshIcon}
+ variant="secondary"
+ onClick={() => setIsRegenerateModalOpen(true)}
+ className="flex items-center"
+ disabled={!premiumUser}
+ >
+ Regenerate Key
+ </Button>
+ </span>
+ </Tooltip>
<Button
icon={TrashIcon}
variant="secondary"
@@ -176,6 +182,7 @@ export default function KeyInfoView({ keyId, onClose, keyData, accessToken, user
visible={isRegenerateModalOpen}
onClose={() => setIsRegenerateModalOpen(false)}
accessToken={accessToken}
+ premiumUser={premiumUser}
/>
{/* Delete Confirmation Modal */}