Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
In ~/.b2cloud.json place your credentials
i.e.
{ "accountId": "", "applicationKey": "" }
https://www.backblaze.com/b2/docs/
I also will be adding helpers methods such as uploadFile, getBucketByName to make it easier to use
npm install b2cloud
Setup a file .b2cloud
in your home folder. Setup like this:,
{
"accountId": "",
"applicationKey": ""
}
var b2cloud = require('b2cloud');
return b2cloud.authorize.getBasicAuth().then(function(auth) {
console.log('authenticated', auth);
});
Kind: global class
Param | Type |
---|---|
cache | object |
object
Fetches an authenticated session for interacting with b2cloud.
Kind: instance method of Authorize
Returns: object
- auth Returns an authenticated session
Param | Type |
---|---|
[callback] | function |
Kind: global class
Param | Type | Description |
---|---|---|
cache | object | Object used for caching requests. |
object
Creates a bucket in the b2cloud
Kind: instance method of Bucket
Returns: object
- The response from b2_create_bucket
Param | Type | Description |
---|---|---|
name | string | Name of the bucket |
type | string | Either allPublic or allPrivate, sets the bucket to public or private access. |
[callback] | function | The optional callback |
object
Deletes a bucket from the b2cloud
Kind: instance method of Bucket
Returns: object
- The response from b2_create_bucket
Param | Type | Description |
---|---|---|
bucketId | string | BucketId as recieved from listBuckets or getBucketByName |
[callback] | function | The optional callback |
object
Lists all buckets you have created.
Kind: instance method of Bucket
Returns: object
- The response from b2_list_buckets
Param | Type | Description |
---|---|---|
[callback] | function | The optional callback. |
object
Helper function that returns a bucket object by its name.
Kind: instance method of Bucket
Returns: object
- The response from b2_list_buckets
Param | Type | Description |
---|---|---|
name | string | The name of the bucket. |
[callback] | function | An optional callback |
object
Lists all files inside of a bucket.
Kind: instance method of Bucket
Returns: object
- The response from b2_list_file_names
See: https://www.backblaze.com/b2/docs/b2_list_file_names.html
Param | Type | Description |
---|---|---|
name | string | The name of the bucket |
[startFileName] | string | If the number of files exceeds the response limit, this will set which file to start listing from |
[maxFileCount] | number | Max number of files to return, cannot be greater than 1000 |
[callback] | function | The optional callback |
Kind: global class
Class constructor, instantiates auth and bucket classes
Param | Type | Description |
---|---|---|
cache | object | Cache object shared amongst classes. |
object
Gets the uploadUrl for uploadinga file to b2cloud
Kind: instance method of File
Returns: object
- - The response from b2_get_upload_url
Param | Type | Description |
---|---|---|
bucketName | string | Name of the bucket to get a uploadUrl for |
[callback] | function | Optional callback |
object
Helper function that automatically generates the uploadUrl, hashes the file and uploads it to b2cloud.
Kind: instance method of File
Returns: object
- - The newly created b2cloud object.
Param | Type | Description |
---|---|---|
filePath | string | The file path to the file you want to upload |
bucketName | string | The bucke to upload the file to. |
[callback] | function | The optional callback |
Promsise
Downloads a file from b2cloud
Kind: instance method of File
Returns: Promsise
- That resolves if the file is downloaded succesfully, otherwise rejects.
See: https://www.backblaze.com/b2/docs/b2_download_file_by_name.html
Param | Type | Description |
---|---|---|
name | string | Name of the file to download |
bucketName | string | Bucket the file resides in |
savePath | string | Path to save the file to |
range | object | The range object used to fetch only a byte range, byte range is inclusive |
range.start | number | The start byte to download |
range.end | number | The end byte to download |
[callback] | function | The optional callback |
*
Deletes a specific version of a file from b2cloud.
Kind: instance method of File
Param | Type | Description |
---|---|---|
fileName | string | Name of the file to delete. |
fileId | string | The unique fileid to delete |
[callback] | function | Optional callback |
FAQs
Module for interacting with back blaze b2cloud api
The npm package b2cloud receives a total of 1 weekly downloads. As such, b2cloud popularity was classified as not popular.
We found that b2cloud 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
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.