Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion packages/proxy/schema/secrets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,10 @@ export const AzureMetadataSchema = BaseMetadataSchema.merge(
api_base: z.string().url(),
api_version: z.string().default("2023-07-01-preview"),
deployment: z.string().nullish(),
auth_type: z.enum(["api_key", "entra_api"]).default("api_key"),
auth_type: z
.enum(["api_key", "entra_api", "entra_oidc", "entra_bearer"])
.default("api_key"),
Comment on lines +31 to +32
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Reject unimplemented Azure auth types in schema

Allowing entra_oidc and entra_bearer here makes config validation succeed even though request execution only implements entra_api (packages/proxy/src/proxy.ts only branches on auth_type === "entra_api" around lines 2235-2258). For entra_oidc, users are expected to store structured JSON (per the new OIDC schema), but the fallback path treats secret.secret as a raw bearer token and then also sets api-key from that same value, producing invalid Azure auth at runtime. This is a regression introduced by broadening the enum before the corresponding auth flow is wired in.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is fine, this is only gonna be supported for gateway

auth_source: z.string().nullish(),
no_named_deployment: z
.boolean()
.default(false)
Expand All @@ -45,6 +48,14 @@ export const AzureEntraSecretSchema = z.object({
});
export type AzureEntraSecret = z.infer<typeof AzureEntraSecretSchema>;

export const AzureEntraOidcSecretSchema = z.object({
client_id: z.string().min(1, "Client ID cannot be empty"),
connection_id: z.string().min(1, "Subject suffix cannot be empty"),
scope: z.string().min(1, "Scope cannot be empty"),
tenant_id: z.string().min(1, "Tenant ID cannot be empty"),
});
export type AzureEntraOidcSecret = z.infer<typeof AzureEntraOidcSecretSchema>;

const BedrockMetadataSchemaBase = BaseMetadataSchema.merge(
z.object({
region: z.string().min(1, "Region cannot be empty"),
Expand Down
Loading