mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-23 00:41:40 +00:00
fix: address greptile review concerns
- _types.py: narrow LiteLLM_JWTAuth.issuer from Union[str, List[str]] to str — PyJWT performs strict string equality on the 'iss' claim and silently rejects all tokens when passed a list value - SSOModals.tsx: replace inline provider-detection block with the shared detectSSOProvider() utility (same logic already used in EditSSOSettingsModal.tsx via utils.ts) to prevent the two paths from diverging when new providers are added Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
f663da9f4f
commit
b7f93a8913
2 changed files with 4 additions and 18 deletions
|
|
@ -4448,9 +4448,9 @@ class LiteLLM_JWTAuth(LiteLLMPydanticObjectBase):
|
|||
default=None,
|
||||
description="Expected JWT aud claim. Falls back to JWT_AUDIENCE.",
|
||||
)
|
||||
issuer: Optional[Union[str, List[str]]] = Field(
|
||||
issuer: Optional[str] = Field(
|
||||
default=None,
|
||||
description="Expected JWT iss claim. Falls back to JWT_ISSUER.",
|
||||
description="Expected JWT iss claim. Falls back to JWT_ISSUER. Must be a single string — PyJWT performs strict string equality on the 'iss' claim.",
|
||||
)
|
||||
public_allowed_routes: List[str] = ["public_routes"]
|
||||
enforce_rbac: bool = False
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ import React, { useEffect, useState } from "react";
|
|||
import { Modal, Form, Input, Button as Button2, Select, Checkbox } from "antd";
|
||||
import { Text, TextInput } from "@tremor/react";
|
||||
import { getSSOSettings, updateSSOSettings } from "./networking";
|
||||
import { detectSSOProvider } from "./Settings/AdminSettings/SSOSettings/utils";
|
||||
import NotificationsManager from "./molecules/notifications_manager";
|
||||
import { parseErrorMessage } from "./shared/errorUtils";
|
||||
|
||||
|
|
@ -114,22 +115,7 @@ const SSOModals: React.FC<SSOModalsProps> = ({
|
|||
try {
|
||||
const ssoData = await getSSOSettings(accessToken);
|
||||
if (ssoData && ssoData.values) {
|
||||
// Determine which SSO provider is configured
|
||||
let selectedProvider = null;
|
||||
if (ssoData.values.google_client_id) {
|
||||
selectedProvider = "google";
|
||||
} else if (ssoData.values.microsoft_client_id) {
|
||||
selectedProvider = "microsoft";
|
||||
} else if (ssoData.values.okta_client_id) {
|
||||
selectedProvider = "okta";
|
||||
} else if (ssoData.values.generic_client_id) {
|
||||
// Backward compatibility: older Okta UI settings were stored as generic OIDC endpoints.
|
||||
if (ssoData.values.generic_authorization_endpoint?.includes("okta")) {
|
||||
selectedProvider = "okta";
|
||||
} else {
|
||||
selectedProvider = "generic";
|
||||
}
|
||||
}
|
||||
const selectedProvider = detectSSOProvider(ssoData.values);
|
||||
|
||||
// Extract role mappings if they exist
|
||||
let roleMappingFields = {};
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue