Bumping the version
This commit is contained in:
		
							
								
								
									
										26
									
								
								lib/oauth.js
									
									
									
									
									
								
							
							
						
						
									
										26
									
								
								lib/oauth.js
									
									
									
									
									
								
							| @ -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,14 +289,14 @@ 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="";  | ||||
| @ -306,7 +304,7 @@ exports.OAuth.prototype.signUrl= function(url, oauth_token, oauth_token_secret, | ||||
|     query+= orderedParameters[i][0]+"="+ this._encodeData(orderedParameters[i][1]) + "&"; | ||||
|   } | ||||
|   query= query.substring(0, query.length-1); | ||||
|  | ||||
|   | ||||
|   return parsedUrl.protocol + "//"+ parsedUrl.host + parsedUrl.pathname + "?" + query; | ||||
| }; | ||||
|  | ||||
|  | ||||
		Reference in New Issue
	
	Block a user