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.
spray-client
Advanced tools
This JavaScript library can be used to access ChakSoft Spray API from NodeJS 6.x.
$ npm install spray-client
const SprayClient = require('spray');
When you want to use Spray API, you will have to make sure your application has been created on the AuthWeb ChakSoft platform. Then your app has to be approved by ChakSoft and you will receive your API Key.
This key must not be known by your users.
We'll assume here the key is supersecretkey
.
const client = new SprayClient({
apiKey: 'supersecretkey', // Here goes your secret key (mandatory)
apiVersion: '2.0.0', // Here goes the API Version (default 2.0.0)
promised: true // If you don't want the client to use promises, put `false` in this field. (default true)
});
Your client is now configured.
On a login backend callback in your application :
client.login().then(data => {
// Redirect your user to the URI in `data.login.redirectTo`.
}).catch(err => console.error(err));
Your user will be redirected to AuthWeb website to login and allow your application. Then, AuthWeb will redirect the user on your application following this pattern :
${YOUR_WEBSITE_ADDRESS}/spray?allow=(0|1)[&token=LOGIN_TOKEN]
If the allow
parameter is 0
, the user has prevented your application from fetching information in AuthWeb. You cannot continue.
If the allow
parameter is 1
, the user has allowed your application, and you can store the login token in your session system to ensure your user will remain connected.
When you have created your application, a selection box let you specify which user information fields your application was authorized to fetch. Only the fields you requested will be present in the returned JSON object.
client.info(loginToken).then(data => {
// You can store this information in your own database or update fields if the user has modified something
}).catch(err => console.error(err));
If you don't want use bluebird
promises in your application, which is recommended though, you can pass a callback as the last argument of each function of the SprayClient
.
FAQs
Utility Access for Spray API
The npm package spray-client receives a total of 2 weekly downloads. As such, spray-client popularity was classified as not popular.
We found that spray-client 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.