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.
#var FileFog = require('filefog')
There are many cloud storage options for consumers. However each provider has their own API and API design philosophy, making it harder for developers to easily integrate their applications.
The idea behind FileFog is to provide a single consistent, promise-based API for developers to access user uploaded data, without having to worry about differing OAuth implementations, base urls or data parsing.
The FileFog philosophy is as follows:
Initally FileFog will be released with only support for the following popular Cloud Services.
Providers for the following Cloud Services are also planned:
var FileFog = require('filefog')
//This configuration should only be run once on setup.
FileFog.setConfig({
google : {
client_key : '777041726477-a5o1tp6f3i9m1me3tj5vhpnrn1jge43c.apps.googleusercontent.com',
client_secret : 'mWURYHmMKZxr6aeR7DTjRu-q',
client_scope : "https://www.googleapis.com/auth/drive"
},
skydrive : {
client_key : '',
client_secret : '',
client_scope : "wl.basic wl.emails wl.offline_access wl.skydrive_update"
},
box : {
client_key : 'cch3sssk23ueqsbdh2k2zlv2i7rz06lp',
client_secret : '6v7ywbCdut5FRdIjDeREofrFGc2ymGmA'
},
dropbox : {
client_key : 'sl47p7pijvtp73h',
client_secret : 'j6vluc5yq7dxnj6'
}
});
var googleProvider = FileFog.provider('google');
##provider.oAuthGetAuthorizeUrl()
Returns the URL of the third party service’s authorization page. This is the URL that your application should forward the user to in first leg of OAuth 2.
Returns
{String}
the authorization URL
##provider.oAuthGetAccessToken(code)
Used to swap the code provided by the OAuth redirect webhook into an access token (and refresh token if applicable)
Parameters
code {String}
An authorization code you retrieved in the first leg of OAuth 2Returns
{Promise}
A promise that will successfully resolve into an Object
with the following parameters
##provider.oAuthRefreshAccessToken(oauth_data)
When applicable this method can be used to swap a possibly expired access_token
for a new access_token
using the refresh_token
. In the interest of keeping a consistent API this method will pass-through the oauth_data
without changing it if the api does not support refresh_token
s.
Please note, due to the way that certain API's work (re. Google) the result of this method call will extend the current oauth_data.raw
object instead of sending back just the raw refresh_token
data, to ensure that data is not lost.
Parameters
oauth_data {Object}
An object containing the refresh_token
needed to generate a new access_token
Returns
{Promise}
A promise that will successfully resolve into an Object
with the following parameters
##provider.CreateClient(oauth_data)
This is a wrapper for the client
constructor. It provides simple access to the cloud service client
Parameters
oauth_data {Object}
An object containing the access_token
needed to authenticate to the cloud API.Returns
{Promise}
A promise that will successfully resolve into a client
##client.AccountInfo()
Retrieves information about the logged in user.
Parameters
Returns
{Promise}
A promise that will successfully resolve into an Object
with the following parameters
##client.CheckQuota()
Retrieves information about the logged in user's file storage quota.
Parameters
Returns
{Promise}
A promise that will successfully resolve into an Object
with the following parameters
##client.CreateFile(fileName,parentIdentifier, content_buffer, options)
Use the file upload or create API to allow users to add a new file. Depending on the service the parentIdentifier
should the destination folder identifier or destination path for the file . If the user provides a file name that already exists in the destination folder, the user will receive an error.
Parameters
fileName {String}
The name of the file to be created on the cloud service
parentIdentifier {String}
Depending on the service,this should either be the path of the file to be created or the identifier for the parent folder. Use null
if the file should be created in the root
cloud storage directory.
content_buffer {Buffer}
the contents to be written to the file
options {Object}
(optional) one or more of the options below:
Dropbox
Returns
{Promise}
A promise that will successfully resolve into an Object
with the following parameters
##client.UpdateFile(identifier, content_buffer, options)
Update and replace uploaded file content.
Parameters
identifier {String}
Depending on the service,this should either be the path of the file to be updated or the identifier for the file.content_buffer {Buffer}
the contents to be written to the fileoptions {Object}
(optional) one or more of the options below:Returns
{Promise}
A promise that will successfully resolve into an Object
with the following parameters
##client.DeleteFile(identifier, options)
Deletes a file. Depending on the service the identifier
should the destination file identifier or full path for the file.
Parameters
parentIdentifier {String}
Depending on the service,this should either be the path of the file to be deleted or the identifier for the file.options {Object}
(optional) one or more of the options below:Returns
{Promise}
A promise that will successfully resolve into an Object
with the following parameters
##client.DownloadFile(identifier, options)
Retrieves the actual data of the file.
Parameters
identifier {String}
Depending on the service,this should either be the path of the file to be downloaded or the identifier for the file.options {Object}
(optional) one or more of the options below:Returns
{Promise}
A promise that will successfully resolve into an Object
with the following parameters
##client.GetFileInformation(identifier, options)
Used to retrieve the metadata about a file..
Parameters
identifier {String}
Depending on the service,this should either be the path of the file or the identifier for the file.
options {Object}
(optional) one or more of the options below:Returns
{Promise}
A promise that will successfully resolve into an Object
with the following parameters
##client.CreateFolder(folderName, parentIdentifier, options)
Use this API to allow users to add a new folder. Depending on the service the parentIdentifier
should the destination folder identifier or destination path for the folder. If the user provides a folder name that already exists in the destination folder, the user will receive an error.
Parameters
folderName {String}
The name of the folder to be created on the cloud serviceparentIdentifier {String}
Depending on the service,this should either be the path of the folder to be created or the identifier for the parent folder. Use null
if the folder should be created in the root
cloud storage directory.options {Object}
(optional) one or more of the options below:##client.DeleteFolder(identifier, options)
Deletes a folder. Depending on the service the identifier
should the destination folder identifier or full path for the folder.
Parameters
identifier {String}
Depending on the service,this should either be the path of the folder to be deleted or the identifier for the folder.options {Object}
(optional) one or more of the options below:Returns
{Promise}
A promise that will successfully resolve into an Object
with the following parameters
##client.GetFolderInformation(identifier, options)
Used to retrieve the metadata about a folder.
Parameters
identifier {String}
Depending on the service,this should either be the path of the folder or the identifier for the folder.options {Object}
(optional) one or more of the options below:Returns
{Promise}
A promise that will successfully resolve into an Object
with the following parameters
##client.RetrieveFolderItems(identifier, options)
Used to list the files and folders inside a folder
Parameters
identifier {String}
Depending on the service,this should either be the path of the folder or the identifier for the folder.options {Object}
(optional) one or more of the options below:Returns
{Promise}
A promise that will successfully resolve into an Object
with the following parameters
##client.Search(query, options)
Used to find files and folders that match a query term
Parameters
query {String}
The string to search for; can be matched against item names, descriptions, text content of a file. Depends on the cloud service.options {Object}
(optional) one or more of the options below:Returns
{Promise}
A promise that will successfully resolve into an Object
with the following parameters
FAQs
Cloud Storage API Wrapper supporting Box, Dropbox, Skydrive, Google Drive
The npm package filefog receives a total of 20 weekly downloads. As such, filefog popularity was classified as not popular.
We found that filefog 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.