Permalink
Browse files

Bumping the version

  • Loading branch information...
1 parent 63dc8fa commit d7d5cfbcfed1d9ef4773bbe0558cf81c180a5b09 @ciaranj committed May 10, 2010
Showing with 14 additions and 20 deletions.
  1. +1 −1 Readme.md
  2. +0 −4 examples/facebook.js
  3. +12 −14 lib/oauth.js
  4. +1 −1 seed.yml
View
@@ -2,7 +2,7 @@ node-oauth
===========
A simple oauth API for node.js . This API allows users to authenticate against OAUTH providers, and thus act as OAuth consumers
-Tested against both Twitter (http://twitter.com) and term.ie (http://term.ie/oauth/example/)
+Tested against both Twitter (http://twitter.com), term.ie (http://term.ie/oauth/example/) and Yahoo!
Also provides rudimentary OAuth2 support, tested against facebook connect.
View
@@ -1,4 +0,0 @@
-var sys= require('sys')
-var OAuth2= require('../lib/oauth2').OAuth2;
-
-var oa= new OAuth2("113560732012113", "f53a25cf96e19743fdcd189307bf47ac", "https://graph.facebook.com")
View
@@ -108,8 +108,6 @@ exports.OAuth.prototype._createSignature= function(signatureBase, tokenSecret) {
// consumerSecret is already encoded
var key= this._consumerSecret + "&" + tokenSecret;
- //TODO: whilst we support different signature methods being passed
- // we currenting only do SHA1-HMAC
var hash= ""
if( this._signatureMethod == "PLAINTEXT" ) {
hash= this._encodeData(key);
@@ -126,10 +124,6 @@ exports.OAuth.prototype.NONCE_CHARS= ['a','b','c','d','e','f','g','h','i','j','k
'Q','R','S','T','U','V','W','X','Y','Z','0','1','2','3',
'4','5','6','7','8','9'];
-exports.OAuth.prototype._createClient= function( port, hostname, sshEnabled, credentials ) {
- return http.createClient(port, hostname, sshEnabled, credentials);
-}
-
exports.OAuth.prototype._getNonce= function(nonceSize) {
var result = [];
var chars= this.NONCE_CHARS;
@@ -143,6 +137,10 @@ exports.OAuth.prototype._getNonce= function(nonceSize) {
return result.join('');
}
+exports.OAuth.prototype._createClient= function( port, hostname, sshEnabled, credentials ) {
+ return http.createClient(port, hostname, sshEnabled, credentials);
+}
+
exports.OAuth.prototype._performSecureRequest= function( oauth_token, oauth_token_secret, method, url, extra_params, callback ) {
var oauthParameters= {
"oauth_timestamp": this._getTimestamp(),
@@ -271,7 +269,7 @@ exports.OAuth.prototype.getOAuthRequestToken= function(callback) {
}
exports.OAuth.prototype.signUrl= function(url, oauth_token, oauth_token_secret, method) {
- var oauthParameters= {
+ var collectedParameters= {
"oauth_timestamp": this._getTimestamp(),
"oauth_nonce": this._getNonce(this._nonceSize),
"oauth_version": this._version,
@@ -280,7 +278,7 @@ exports.OAuth.prototype.signUrl= function(url, oauth_token, oauth_token_secret,
};
if( oauth_token ) {
- oauthParameters["oauth_token"]= oauth_token;
+ collectedParameters["oauth_token"]= oauth_token;
}
if( method === undefined ) {
var method= "GET";
@@ -291,22 +289,22 @@ exports.OAuth.prototype.signUrl= function(url, oauth_token, oauth_token_secret,
if( parsedUrl.protocol == "https:" && !parsedUrl.port ) parsedUrl.port= 443;
if( parsedUrl.query ) {
- var extraParameters= querystring.parse(parsedUrl.query);
- for(var key in extraParameters ) {
- oauthParameters[key]= extraParameters[key];
+ var queryParams= querystring.parse(parsedUrl.query);
+ for(var key in queryParams ) {
+ collectedParameters[key]= queryParams[key];
}
}
- var sig= this._getSignature( method, url, this._normaliseRequestParams(oauthParameters), oauth_token_secret);
- var orderedParameters= this._sortRequestParams( oauthParameters );
+ var sig= this._getSignature( method, url, this._normaliseRequestParams(collectedParameters), oauth_token_secret);
+ var orderedParameters= this._sortRequestParams( collectedParameters );
orderedParameters[orderedParameters.length]= ["oauth_signature", sig];
var query="";
for( var i= 0 ; i < orderedParameters.length; i++) {
query+= orderedParameters[i][0]+"="+ this._encodeData(orderedParameters[i][1]) + "&";
}
query= query.substring(0, query.length-1);
-
+
return parsedUrl.protocol + "//"+ parsedUrl.host + parsedUrl.pathname + "?" + query;
};
View
@@ -1,4 +1,4 @@
---
name: oauth
description: An implementation of an OAuth client.
- version: 0.0.6
+ version: 0.0.7

0 comments on commit d7d5cfb

Please sign in to comment.