@cloudbase/cloud-api
Advanced tools
@@ -60,2 +60,6 @@ "use strict"; | ||
| }; | ||
| const USE_INTERNAL_ENDPOINT = "USE_INTERNAL_ENDPOINT"; | ||
| const intranetUrlMap = Object.keys(ServiceVersionMap).map((service) => ({ | ||
| [service]: `https://${service}.internal.tencentcloudapi.com`, | ||
| })).reduce((acc, cur) => (Object.assign(Object.assign({}, acc), cur)), {}); | ||
| exports.fetch = request_1.fetch; | ||
@@ -105,7 +109,8 @@ exports.fetchStream = request_1.fetchStream; | ||
| const urlMap = { | ||
| tcb: 'https://tcb.tencentcloudapi.com', | ||
| tcb: process.env.CLOUDBASE_TCB_CLOUDAPI_URL || 'https://tcb.tencentcloudapi.com', | ||
| flexdb: 'https://flexdb.tencentcloudapi.com', | ||
| }; | ||
| if (this.service === 'tcb' && process.env.CLOUDBASE_TCB_CLOUDAPI_URL) { | ||
| return process.env.CLOUDBASE_TCB_CLOUDAPI_URL; | ||
| // 云梯账号走内网域名 | ||
| if (USE_INTERNAL_ENDPOINT in process.env) { | ||
| return intranetUrlMap[this.service]; | ||
| } | ||
@@ -112,0 +117,0 @@ if (urlMap[this.service]) { |
+1
-1
| { | ||
| "name": "@cloudbase/cloud-api", | ||
| "version": "0.5.3", | ||
| "version": "0.5.4", | ||
| "description": "The cloud api request package.", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
@@ -63,2 +63,8 @@ import crypto from 'crypto'; | ||
| const USE_INTERNAL_ENDPOINT = "USE_INTERNAL_ENDPOINT"; | ||
| const intranetUrlMap = Object.keys(ServiceVersionMap).map((service) => ({ | ||
| [service]: `https://${service}.internal.tencentcloudapi.com`, | ||
| })).reduce((acc, cur) => ({ ...acc, ...cur }), {}); | ||
| export interface ServiceOptions { | ||
@@ -169,10 +175,15 @@ service: string; | ||
| const urlMap = { | ||
| tcb: 'https://tcb.tencentcloudapi.com', | ||
| tcb: process.env.CLOUDBASE_TCB_CLOUDAPI_URL || 'https://tcb.tencentcloudapi.com', | ||
| flexdb: 'https://flexdb.tencentcloudapi.com', | ||
| }; | ||
| if (this.service === 'tcb' && process.env.CLOUDBASE_TCB_CLOUDAPI_URL) { | ||
| return process.env.CLOUDBASE_TCB_CLOUDAPI_URL; | ||
| // 云梯账号走内网域名 | ||
| if(USE_INTERNAL_ENDPOINT in process.env) { | ||
| return intranetUrlMap[this.service]; | ||
| } | ||
| if(this.service === 'lowcode' && process.env.CLOUDBASE_LOWCODE_CLOUDAPI_URL) { | ||
| return process.env.CLOUDBASE_LOWCODE_CLOUDAPI_URL; | ||
| } | ||
| if (urlMap[this.service]) { | ||
@@ -341,3 +352,3 @@ return urlMap[this.service]; | ||
| const querystring = urlObj.search.slice(1); | ||
@@ -344,0 +355,0 @@ |
Network access
Supply chain riskThis module accesses the network.
Found 2 instances in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 6 instances in 1 package
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
Network access
Supply chain riskThis module accesses the network.
Found 2 instances in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 5 instances in 1 package
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
56703
1.34%1319
1%25
-3.85%20
11.11%