
Research
Security News
Lazarus Strikes npm Again with New Wave of Malicious Packages
The Socket Research Team has discovered six new malicious npm packages linked to North Korea’s Lazarus Group, designed to steal credentials and deploy backdoors.
node-dropbox-v2
Advanced tools
A simple node.js API client for Dropbox API v2
npm install node-dropbox-v2 --save
Before starting anything you need to go create your app over at: https://www.dropbox.com/developers/apps then go ahead and grab your Key and Secret.
Just use the Authenticate method to generate a url for your user to go to. This will be redirected back to another page.
var node_dropbox = require('node-dropbox-v2');
node_dropbox.Authenticate('key', 'secret', 'redirect_url', function(err, url){
// redirect user to the url.
// looks like this: "https://www.dropbox.com/1/oauth2/authorize?client_id=<key_here>&response_type=code&redirect_uri=<redirect_url_here>"
});
On the page where you redirected to, you will need to use the AccessToken method to get the users access token for api use. The redirect_url this time is only for validation, it will not need to redirect again.
node_dropbox.AccessToken('key', 'secret', 'access_code', 'redirect_url', function(err, body) {
access_token = body.access_token;
});
When you have the access token in hand, all you need to do is make api calls. That's all it takes to get started with this client.
api = node_dropbox.api(access_token);
api.account(function(err, res, body) {
console.log(body);
});
The above output will be something like:
{
"referral_link": "https://www.dropbox.com/referrals/r1a2n3d4m5s6t7",
"display_name": "John P. User",
"uid": 12345678,
"team": {
"name": "Acme Inc."
},
"country": "US",
"quota_info": {
"shared": 253738410565,
"quota": 107374182400000,
"normal": 680031877871
}
}
api.account(callback); // Fetches the account information.
api.createDir(path, callback); // Creates a directory.
api.removeDir(path, callback); // Deletes a directory.
api.createFile(path, contents, callback); // Creates a new file.
api.removeFile(path, callback) // Deletes a file.
api.moveSomething(from_path, to_path, callback); // Moves/renames a file.
api.getMetadata(path, callback) // Retrieves file and folder metadata. Can be used to list a folder's content.
api.getFile(path, callback) // Downloads a file.
api.getDelta(cursor, path, callback) // Gets changes to files and folders in a user's Dropbox.
// Each callback will return the error message, response, and body(json data).
api.account(function(error, response, body){
console.log(body.display_name);
});
FAQs
A simple Dropbox API v2 client for node.js
The npm package node-dropbox-v2 receives a total of 2 weekly downloads. As such, node-dropbox-v2 popularity was classified as not popular.
We found that node-dropbox-v2 demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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
The Socket Research Team has discovered six new malicious npm packages linked to North Korea’s Lazarus Group, designed to steal credentials and deploy backdoors.
Security News
Socket CEO Feross Aboukhadijeh discusses the open web, open source security, and how Socket tackles software supply chain attacks on The Pair Program podcast.
Security News
Opengrep continues building momentum with the alpha release of its Playground tool, demonstrating the project's rapid evolution just two months after its initial launch.