Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

authy

Package Overview
Dependencies
Maintainers
1
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

authy - npm Package Compare versions

Comparing version 0.0.5 to 0.1.0

39

index.js

@@ -40,3 +40,3 @@ var request = require('request');

} else {
throw new Error(err);
callback(err);
}

@@ -62,3 +62,3 @@ });

} else {
throw new Error(err);
callback(err);
}

@@ -92,3 +92,3 @@ });

} else {
throw new Error(err);
callback(err);
}

@@ -122,3 +122,3 @@ });

} else {
throw new Error(err);
callback(err);
}

@@ -128,3 +128,32 @@ });

// Utility functions. Should live somebody else probably.
Authy.prototype.request_call = function (id, force, callback) {
var qs = {
api_key: this.apiKey
};
if (arguments.length > 2) {
qs.force = force;
} else {
callback = force;
}
request.get({
url: this.apiURL + "/protected/json/call/" + id,
qs: qs,
jar: false,
strictSSL: true
}, function (err, res, body) {
if (!err) {
if (res.statusCode === 200) {
callback(null, toJSON(body));
} else {
callback(body);
}
} else {
callback(err);
}
});
};
// Utility functions. Should live somewhere else probably.
function isJSON(data) {

@@ -131,0 +160,0 @@ if (typeof data === 'object') return true;

7

package.json
{
"name": "authy",
"version": "0.0.5",
"version": "0.1.0",
"description": "Authy.com API lib for node.js",

@@ -27,4 +27,7 @@ "main": "index.js",

"dependencies": {
"request": "~2.21.0"
"request": "2.33.0"
},
"devDependencies": {
"nodeunit": "*"
}
}

@@ -1,3 +0,2 @@

node-authy
==========
# node-authy [![Dependency Status](https://david-dm.org/evilpacket/node-authy.png)](https://david-dm.org/evilpacket/node-authy)

@@ -66,2 +65,13 @@ [Authy](https://authy.com/) API Client for node.js

Request Call (Email support@authy.com to enable this feature)
-------------------------------------------------------------
request_call(id, [force], callback);
```javascript
authy.request_call('1337', function (err, res) {
});
```
Delete Registered User

@@ -68,0 +78,0 @@ ----------------------

@@ -64,1 +64,18 @@ var apikey = "0cd08abec2e9b9641e40e9470a7fc336";

/*
* Request Call Tests
*/
exports['Request Call'] = function (test) {
authy.request_call(test_user.id, function (err, res) {
test.ok(res);
test.done();
});
};
exports['Request Call - Force'] = function (test) {
authy.request_call(test_user.id, true, function (err, res) {
test.ok(res);
test.done();
});
};
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc