oauth-1.0a
Advanced tools
Comparing version 0.0.7 to 0.0.8
@@ -11,2 +11,6 @@ if (typeof(module) !== 'undefined' && typeof(exports) !== 'undefined') { | ||
function OAuth(opts) { | ||
if(!(this instanceof OAuth)) { | ||
return new OAuth(opts); | ||
} | ||
this.consumer = opts.consumer; | ||
@@ -27,6 +31,6 @@ this.signature_method = opts.signature_method || 'HMAC-SHA1'; | ||
case 'RSA-SHA1': | ||
console.warn('oauth-1.0a does not support this signature method right now. Coming Soon...'); | ||
throw new Error('oauth-1.0a does not support this signature method right now. Coming Soon...'); | ||
break; | ||
default: | ||
console.warn('The OAuth 1.0a protocol defines three signature methods: HMAC-SHA1, RSA-SHA1, and PLAINTEXT only'); | ||
throw new Error('The OAuth 1.0a protocol defines three signature methods: HMAC-SHA1, RSA-SHA1, and PLAINTEXT only'); | ||
break; | ||
@@ -235,5 +239,3 @@ } | ||
OAuth.prototype.getTimeStamp = function() { | ||
// return parseInt(new Date().getTime()/1000, 10); | ||
// Bitwise is faster | ||
return~~ (new Date().getTime() / 1000); | ||
return parseInt(new Date().getTime()/1000, 10); | ||
}; | ||
@@ -240,0 +242,0 @@ |
{ | ||
"name": "oauth-1.0a", | ||
"version": "0.0.7", | ||
"version": "0.0.8", | ||
"description": "OAuth 1.0a Request Authorization for Node and Browser.", | ||
@@ -24,3 +24,5 @@ "scripts": { | ||
"chai": "~1.8.1", | ||
"request": "~2.33.0" | ||
"request": "~2.33.0", | ||
"istanbul": "^0.2.7", | ||
"coveralls": "^2.10.0" | ||
}, | ||
@@ -27,0 +29,0 @@ "dependencies": { |
oauth-1.0a | ||
========== | ||
[![NPM version](https://badge.fury.io/js/oauth-1.0a.png)](http://badge.fury.io/js/oauth-1.0a) | ||
[![Dependency Status](https://david-dm.org/ddo/oauth-1.0a.png?theme=shields.io)](https://david-dm.org/ddo/oauth-1.0a) | ||
[![NPM version](https://badge.fury.io/js/oauth-1.0a.png)](http://badge.fury.io/js/oauth-1.0a) | ||
[![Coverage Status](https://coveralls.io/repos/ddo/oauth-1.0a/badge.png?branch=master)](https://coveralls.io/r/ddo/oauth-1.0a?branch=master) | ||
[![Code Climate](https://codeclimate.com/github/ddo/oauth-1.0a.png)](https://codeclimate.com/github/ddo/oauth-1.0a) | ||
@@ -51,3 +53,3 @@ ![codeship](https://www.codeship.io/projects/4388a200-ac85-0131-b0cb-7e8dce60f53f/status) | ||
###Browser | ||
Download oauth-1.0a.js [here](https://github.com/ddo/oauth-1.0a/blob/0.0.7/oauth-1.0a.js) | ||
Download oauth-1.0a.js [here](https://github.com/ddo/oauth-1.0a/blob/0.0.8/oauth-1.0a.js) | ||
@@ -246,6 +248,2 @@ <script src="http://crypto-js.googlecode.com/svn/tags/3.1.2/build/rollups/hmac-sha1.js"></script> | ||
* Browser: [crypto-js](https://code.google.com/p/crypto-js/) | ||
* Node: [crypto-js](https://github.com/evanvosberg/crypto-js) | ||
[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/ddo/oauth-1.0a/trend.png)](https://bitdeli.com/free "Bitdeli Badge") | ||
* Node: [crypto-js](https://github.com/evanvosberg/crypto-js) |
Sorry, the diff of this file is not supported yet
626448
35
19532
5
247