zen: add security check
This commit is contained in:
parent
76ced5418f
commit
4438f69aac
1 changed files with 5 additions and 1 deletions
|
|
@ -775,7 +775,11 @@ export async function handler(
|
|||
)
|
||||
|
||||
if (!data) throw new AuthError(t("zen.api.error.invalidApiKey"))
|
||||
if (data.workspace.isBlocked || data.workspace.isFlaggedByAnthropic || data.workspace.isFlaggedByOpenAI)
|
||||
if (
|
||||
data.workspace.isBlocked ||
|
||||
(data.workspace.isFlaggedByAnthropic && modelInfo.id.startsWith("claude-")) ||
|
||||
(data.workspace.isFlaggedByOpenAI && modelInfo.id.startsWith("gpt-"))
|
||||
)
|
||||
throw new AuthError(t("zen.api.error.requestBlockedByUpstreamProvider"))
|
||||
if (
|
||||
modelInfo.id.startsWith("alpha-") &&
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue