Skip to content

Commit 9affca9

Browse files
committed
tighten credential_auto handling and disallow path+auto combo
Cursor Bugbot follow-up: credential_auto=false was treated as a valid provider variant, and credential_path + credential_auto: true were silently allowed together. Only credential_auto: true now counts as a provider mode, and path/auto are enforced as mutually exclusive.
1 parent 4aa97f9 commit 9affca9

1 file changed

Lines changed: 15 additions & 5 deletions

File tree

src/app/[transport]/route.ts

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2307,8 +2307,8 @@ Based on your issue "${issue_description}", start with:
23072307
const hasName = !!params.credential_name;
23082308
const hasProvider = !!params.credential_provider;
23092309
const hasPath = !!params.credential_path;
2310-
const hasAuto = params.credential_auto !== undefined;
2311-
if (hasName && (hasProvider || hasPath || hasAuto)) {
2310+
const autoTrue = params.credential_auto === true;
2311+
if (hasName && (hasProvider || hasPath || autoTrue)) {
23122312
return {
23132313
content: [
23142314
{
@@ -2318,7 +2318,7 @@ Based on your issue "${issue_description}", start with:
23182318
],
23192319
};
23202320
}
2321-
if ((hasPath || hasAuto) && !hasProvider) {
2321+
if ((hasPath || autoTrue) && !hasProvider) {
23222322
return {
23232323
content: [
23242324
{
@@ -2328,7 +2328,17 @@ Based on your issue "${issue_description}", start with:
23282328
],
23292329
};
23302330
}
2331-
if (hasProvider && !hasPath && !hasAuto) {
2331+
if (hasPath && autoTrue) {
2332+
return {
2333+
content: [
2334+
{
2335+
type: "text",
2336+
text: "Error: credential_path and credential_auto: true are alternatives — provide exactly one.",
2337+
},
2338+
],
2339+
};
2340+
}
2341+
if (hasProvider && !hasPath && !autoTrue) {
23322342
return {
23332343
content: [
23342344
{
@@ -2346,7 +2356,7 @@ Based on your issue "${issue_description}", start with:
23462356
provider: params.credential_provider,
23472357
}),
23482358
...(hasPath && { path: params.credential_path }),
2349-
...(hasAuto && { auto: params.credential_auto }),
2359+
...(autoTrue && { auto: true }),
23502360
}
23512361
: undefined;
23522362
const proxy = buildProxy();

0 commit comments

Comments
 (0)