Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
@alicloud/pop-core
Advanced tools
The core SDK of POP API.
Install it and write into package.json dependences.
$ npm install @alicloud/pop-core -S
Node.js >= 8.x
You must know your AK
(accessKeyId/accessKeySecret
), and the cloud product's endpoint
and apiVersion
.
For example, The ECS OpenAPI(https://help.aliyun.com/document_detail/25490.html), the API version is 2014-05-26
.
And the endpoint list can be found at here, the center endpoint is ecs.aliyuncs.com. Add http protocol http
or https
, should be http://ecs.aliyuncs.com/
.
API Developer Portal provides the ability to call the cloud product OpenAPI online, and dynamically generate SDK Example code and quick retrieval interface, which can significantly reduce the difficulty of using the cloud API. It is highly recommended.
The RPC style client:
var RPCClient = require('@alicloud/pop-core').RPCClient;
var client = new RPCClient({
accessKeyId: '<accessKeyId>',
accessKeySecret: '<accessKeySecret>',
endpoint: '<endpoint>',
apiVersion: '<apiVersion>'
});
// => returns Promise
client.request(action, params);
// co/yield, async/await
// options
client.request(action, params, {
timeout: 3000, // default 3000 ms
formatAction: true, // default true, format the action to Action
formatParams: true, // default true, format the parameter name to first letter upper case
method: 'GET', // set the http method, default is GET
headers: {}, // set the http request headers
});
The ROA style client:
var ROAClient = require('@alicloud/pop-core').ROAClient;
var client = new ROAClient({
accessKeyId: '<accessKeyId>',
accessKeySecret: '<secretAccessKey>',
endpoint: '<endpoint>',
apiVersion: '<apiVersion>'
});
// => returns Promise
// request(HTTPMethod, uriPath, queries, body, headers, options);
// options => {timeout}
client.request('GET', '/regions');
// co/yield, async/await
We offer two ways to customize request opts.
One way is passing opts through the Client constructor. You should treat opts passed through the constructor as default custom opts, because all requests will use this opts.
var client = new RPCClient({
accessKeyId: '<accessKeyId>',
accessKeySecret: '<accessKeySecret>',
endpoint: '<endpoint>',
apiVersion: '<apiVersion>',
opts: {
timeout: 3000
}
});
Another way is passing opts through the function's parameter. You should use this way when you want to just pass opts in specific functions.
client.request(action, params, {
timeout: 3000
});
When both ways are used, opts will be merged. But for the opt with the same key, the opts provided by the function parameter overrides the opts provided by the constructor.
var tunnel = require('tunnel-agent');
var RPCClient = require('@alicloud/pop-core').RPCClient;
var client = new RPCClient({
accessKeyId: '<accessKeyId>',
accessKeySecret: '<accessKeySecret>',
endpoint: '<endpoint>',
apiVersion: '<apiVersion>'
});
client.request(action, params, {
agent: tunnel.httpOverHttp({
proxy: {
host: 'host',
port: port
}
});
});
The MIT License
1.8.0 (2024-12-09)
Feature:
FAQs
AliCloud POP SDK core
The npm package @alicloud/pop-core receives a total of 9,092 weekly downloads. As such, @alicloud/pop-core popularity was classified as popular.
We found that @alicloud/pop-core demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 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.
Security News
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.