mirror of
https://github.com/diegosouzapw/OmniRoute.git
synced 2026-08-06 15:22:12 +03:00
fix(security): require auth for /v1/models when management auth is configured (#9320)
This commit is contained in:
committed by
GitHub
parent
7e55abbc41
commit
b07182c72a
@@ -14,7 +14,9 @@ export async function getModelCatalogAuthRejection(
|
||||
settings: Record<string, any>,
|
||||
headers: Record<string, string>
|
||||
): Promise<Response | null> {
|
||||
if (settings.requireAuthForModels !== true || !(await isAuthRequired(request))) return null;
|
||||
const authRequired = await isAuthRequired(request);
|
||||
if (!authRequired) return null;
|
||||
if (settings.requireAuthForModels === false) return null;
|
||||
|
||||
const apiKey = extractApiKey(request);
|
||||
if (apiKey) {
|
||||
|
||||
Reference in New Issue
Block a user