Research
Security News
Threat Actor Exposes Playbook for Exploiting npm to Build Blockchain-Powered Botnets
A threat actor's playbook for exploiting the npm ecosystem was exposed on the dark web, detailing how to build a blockchain-powered botnet.
@volcengine/imagex-openapi
Advanced tools
The documentation for the Volcengine VCloud API can be found here
The documentation for the nodejs SDK API can be found here
The documentation for the Volcengine AK&SK can be found here
@volcengine/imagex-openapi
uses a modified version of Semantic Versioning for all changes.
This library supports Nodejs version 12 and above.
Available in three settings
import VolcSdk from '@volcengine/imagex-openapi';
const client = new VolcSdk({
accessKey: 'your own accessKey',
secretKey: 'your own secretKey'
});
VOLC_ACCESSKEY="your ak" VOLC_SECRETKEY="your sk"
Put it in ~/.volc/config in json format, the format is:
{"VOLC_ACCESSKEY":"your ak","VOLC_SECRETKEY":"your sk"}
You could specify the target Region and/or Host for the client:
import VCloudSdk from '@volcengine/imagex-openapi';
const client = new VCloudSdk({
accessKey: 'your own accessKey',
secretKey: 'your own secretKey',
region: 'cn-north-1',
host: 'open.volcengineapi.com'
});
To log this SDK request, you could set the logLevel or set your own application log policy by setting LoggerOptions.log method.
import VCloudSdk from '@volcengine/imagex-openapi';
import winston from 'winston';
const appLogger = winston.createLogger();
const client = new VCloudSdk({
accessKey: 'your own accessKey',
secretKey: 'your own secretKey',
loggerOptions: {
level: 'debug',
log: function(opts) {
appLogger.log(opts);
},
},
});
The Volcengine VCloud nodejs SDK uses axios, a promise-based HTTP client, to make requests. You can also provide your own httpClient to customize requests as needed.
import VCloudSdk from '@volcengine/imagex-openapi';
import customHttpRequest from './customHttpRequest';
const client = new VCloudSdk({
accessKey: 'your own accessKey',
secretKey: 'your own secretKey',
region: 'cn-north-1',
host: 'open.volcengineapi.com',
httpRequest: customHttpRequest,
});
Write a custom HTTP client
async function request(url, options) {
const { headers = {}, proxy, maxBodyLength = 0 } = options;
const reqOption: AxiosRequestConfig = {
url,
...options,
headers: {
...headers,
'User-Agent': 'your own user agent'
}
};
try {
const res = await axios(reqOption);
return {status: res.status, body: res.data, headers: res.headers};
} catch(e) {
// report metrics and so on...
}
}
Use a custom HTTP client with this SDK, you could mock the Volcengine API responses, and run your unit and integration tests quickly without the need to make a connection to Volcengine.
If the current features can't meet your needs, you can try to write a custom plugin following the next format
function plugin () {
return async (context, next) => {
// ...
// execute before send request
await next() // execute the rest plugins and send request at last
// execute after send request
// ...
}
}
there is a simple example
export default function accessPlugin() {
return async (context, next) => {
if(checkAccess()) {
await next();
} else {
context.response = 'has no access';
}
return;
};
}
then you need to register this plugin to a client
const client = new VCloudSdk({
accessKey: 'your own accessKey',
secretKey: 'your own secretKey',
region: 'cn-north-1',
host: 'open.volcengineapi.com',
httpRequest: customHttpRequest,
});
client.addPlugin(accessPlugin);
To make request via a proxy host, you could set the proxy options.
import VCloudSdk from '@volcengine/imagex-openapi';
const client = new VCloudSdk({
accessKey: 'your own accessKey',
secretKey: 'your own secretKey',
proxy: {
protocol: 'https',
host: 'your own proxy host ip',
auth: 'your own proxy host auth',
port: 8080, // your own proxy host port
}
});
VOLC_PROXY_HOST="your own proxy host" VOLC_PROXY_PORT="your own proxy host port"
If you need help installing or using the sdk, please check the Volcengine Support Help Center first.
If you've instead found a bug in the library or would like new features added, go ahead and open issues or pull requests against this repo!
FAQs
火山引擎视频云 Nodejs SDK,提供完备的 OPENAPI 请求调用能力
We found that @volcengine/imagex-openapi demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 23 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
A threat actor's playbook for exploiting the npm ecosystem was exposed on the dark web, detailing how to build a blockchain-powered botnet.
Security News
NVD’s backlog surpasses 20,000 CVEs as analysis slows and NIST announces new system updates to address ongoing delays.
Security News
Research
A malicious npm package disguised as a WhatsApp client is exploiting authentication flows with a remote kill switch to exfiltrate data and destroy files.