Skip to content

Commit 895673a

Browse files
author
FalkWolsky
committed
Fixing Lowcoder API Wrong Auth Mechanism
1 parent 1a49885 commit 895673a

File tree

4 files changed

+12
-13
lines changed

4 files changed

+12
-13
lines changed

server/node-service/src/plugins/lowcoder/index.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ const dataSourceConfig = {
3030
{
3131
type: "password",
3232
key: "bearerAuth.value",
33-
label: "Authorization",
33+
label: "API Key",
3434
"tooltip": "API Key Authentication with a Bearer token. Copy your API Key here. (e.g. 'Bearer eyJhbGciO...')",
3535
"placeholder": "API Key Authentication with a Bearer token. Copy your API Key here. (e.g. 'Bearer eyJhbGciO...')"
3636
},
@@ -72,6 +72,7 @@ const lowcoderPlugin: DataSourcePlugin<any, DataSourceConfigType> = {
7272
};
7373
},
7474
run: function (actionData, dataSourceConfig): Promise<any> {
75+
7576
const { serverURL, specVersion, dynamicParamsConfig, ...otherDataSourceConfig } = dataSourceConfig;
7677

7778
const runApiDsConfig = {
@@ -81,6 +82,8 @@ const lowcoderPlugin: DataSourcePlugin<any, DataSourceConfigType> = {
8182
specVersion: specVersion
8283
};
8384

85+
console.log("runApiDsConfig: ", runApiDsConfig)
86+
8487
return runOpenApi(actionData, runApiDsConfig, version2spec(specs, dataSourceConfig.specVersion) as OpenAPIV3.Document);
8588
},
8689
};

server/node-service/src/plugins/lowcoder/lowcoder.spec-v1.0.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8255,7 +8255,7 @@
82558255
"type": "http",
82568256
"scheme": "bearer",
82578257
"bearerFormat": "JWT",
8258-
"description": "API Key Authentication with a Bearer token. Copy your API Key and prefix it here with 'Bearer ' (e.g. 'Bearer eyJhbGciO...'"
8258+
"description": "JWT Authorization header using the Bearer scheme. Example: 'Authorization: Bearer {token}'"
82598259
}
82608260
}
82618261
},

server/node-service/src/plugins/lowcoder/lowcoder.spec-v1.1.json

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9180,11 +9180,9 @@
91809180
"securitySchemes": {
91819181
"bearerAuth": {
91829182
"type": "http",
9183-
"description": "API Key Authentication with a Bearer token. Copy your API Key and prefix it here with 'Bearer ' (e.g. 'Bearer eyJhbGciO...'",
9184-
"name": "Authorization",
9185-
"in": "header",
91869183
"scheme": "bearer",
9187-
"bearerFormat": "JWT"
9184+
"bearerFormat": "JWT",
9185+
"description": "JWT Authorization header using the Bearer scheme. Example: 'Authorization: Bearer {token}'"
91889186
}
91899187
}
91909188
},

server/node-service/src/plugins/lowcoder/lowcoder.spec-v1.2.json

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
],
3939
"security": [
4040
{
41-
"LOWCODER_CE_SELFHOST_TOKEN": []
41+
"bearerAuth": []
4242
}
4343
],
4444
"tags": [
@@ -10629,13 +10629,11 @@
1062910629
}
1063010630
},
1063110631
"securitySchemes": {
10632-
"APIKey": {
10633-
"type": "apiKey",
10634-
"description": "API Key Authentication with a Bearer token. Copy your API Key and prefix it here with 'Bearer ' (e.g. 'Bearer eyJhbGciO...')",
10635-
"name": "Authorization",
10636-
"in": "header",
10632+
"bearerAuth": {
10633+
"type": "http",
1063710634
"scheme": "bearer",
10638-
"bearerFormat": "JWT"
10635+
"bearerFormat": "JWT",
10636+
"description": "JWT Authorization header using the Bearer scheme. Example: 'Authorization: Bearer {token}'"
1063910637
}
1064010638
}
1064110639
}

0 commit comments

Comments
 (0)