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.
Wrapper for the Divshot API.
npm install divshot --save
Refer to the Narrator api for a more in depth understanding of all available methods.
CommonJS (Node/Browserify)
var Divshot = require('divshot');
Standalone
<script src="/path/to/divshot.standalone.min.js"></div>
###Instantiate
var api = Divshot.createClient({
email: 'someone@divshot.com',
password: 'somepassword123!',
// OR
token: 'your divshot access token'
});
###Angular Module
Located at /dist/divshot.angular.js
angular.module('myApp', ['divshot'])
.config(function (divshotProvider) {
divshotProvider.configure({
token: 'divshot_api_access_token'
});
}).
controller('SomeCtrl', function ($scope, divshot) {
$scope.apps = divshot.apps.list();
});
###User
By default, the authenticate
method will be called on each request as a pre hook. If a token is provided, this does not create another http request.
api.user.authenticate(function (err, token) {
});
api.user.setCredentials({
email: 'someone@divshot.com',
password: 'somepassword123!',
// OR
token: 'some_really_long_access_token_from_divshot'
});
// User data
api.user.self().then(function (user) {
});
// OR
api.user.id(userId).get().then(function (user) {
});
// Update user
var user = api.user.id(userId);
user.update({
name: 'First Last'
}).then(function (user) {
});
// Change password
divshot.user.password.update({
password: 'Password123',
password_confirm: 'Password123'
}).then(function (res) {
});
// Add email
divshot.user.emails.add('something@aol.com').then(function (res) {
});
// Set primary email
divshot.user.emails.primary('something@aol.com').then(function (res) {
});
// Remove email
divshot.user.emails.remove('something@aol.com').then(function (res) {
});
// Resend email
divshot.user.emails.resend('something@aol.com').then(function (res) {
});
// Users orgs
divshot.organizations.list().then(function (orgs) {
});
// A single organization
divshot.organizations.id(someOrgId).get().then(function (org) {
});
// Apps from an organization
divshot.organizations.id(someOrgId).apps.list().then(function (apps) {
});
// Update organization
divshot.organizations.id(someOrgId).update({
name: 'name',
billing_email: 'someone@aol.com',
gravatar_email: 'someone@aol.com',
etc: 'other stuff'
}).then(function (res) {
});
// Get org members
divshot.organizations.id(someOrg).members.list().then(function (members) {
});
// Invite members to organization
divshot.organizations.id(someOrg).members.create({
name: email,
email: email
}).then(function (res) {
});
// Update a member in organiztion
divshot.organizations.id(someOrg).members.id(memberid).update({
admin: false // or true
}).then(function (res) {
});
// Remove a member from an organization
divshot.organizations.id(someOrg).members.id(memberId).remove().then(function () {
});
// List apps
api.apps.list().then(function (apps) {
});
// Create an app
api.apps.create('app-name').then(function (app) {
});
// A specific app
var app = api.apps.id('app name');
app.get().then(function (app) {
});
app.builds.list(function (err, builds) {
});
app.builds.id('build id').get(function (err, build) {
// Specific build by id
});
app.builds.id('build id').finalize(function (err, response) {
});
app.builds.id('build id').release('production', function (err, response) {
});
###Releases
app.releases.list(function (err, releases) {
});
app.releases.env('production').get(function (err, release) {
// Release by environment
});
app.releases.env('production').rollback(function (err, response) {
});
app.releases.env('production').promote('staging', function (err, callback) {
// Here, "staging" is the from environment
// and "production" is the to-environment
});
###Domains
// List domains for an app
app.domains.list().then(function(domains) {
});
// Add a domain
app.domains.add('www.domain.com').then(function (response) {
});
// Remove a domain
app.domains.remove('www.domain.com').then(function (response) {
});
###App Environment Configuration
app.env('development').config({
auth: 'username:password'
}, function (err, response) {
});
grunt build
FAQs
Wrapper for the Divshot api
We found that divshot demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 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.
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.