fix: use proper values for addTo field when auth type is api-key (#3966)

This commit is contained in:
Akash K
2024-04-16 17:44:28 +05:30
committed by GitHub
parent 787aab650f
commit 0f592d1789
12 changed files with 182 additions and 30 deletions

View File

@@ -260,7 +260,7 @@ const resolveOpenAPIV3SecurityObj = (
return {
authType: "api-key",
authActive: true,
addTo: "Headers",
addTo: "HEADERS",
key: scheme.name,
value: "",
}
@@ -268,7 +268,7 @@ const resolveOpenAPIV3SecurityObj = (
return {
authType: "api-key",
authActive: true,
addTo: "Query params",
addTo: "QUERY_PARAMS",
key: scheme.in,
value: "",
}
@@ -430,7 +430,7 @@ const resolveOpenAPIV2SecurityScheme = (
// V2 only supports in: header and in: query
return {
authType: "api-key",
addTo: scheme.in === "header" ? "Headers" : "Query params",
addTo: scheme.in === "header" ? "HEADERS" : "QUERY_PARAMS",
authActive: true,
key: scheme.name,
value: "",

View File

@@ -150,8 +150,8 @@ const getHoppReqAuth = (item: Item): HoppRESTAuth => {
),
addTo:
(getVariableValue(auth.apikey, "in") ?? "query") === "query"
? "Query params"
: "Headers",
? "QUERY_PARAMS"
: "HEADERS",
}
} else if (auth.type === "bearer") {
return {