oauth-1.0a
Advanced tools
Comparing version 2.1.0 to 2.1.1
@@ -142,4 +142,5 @@ if (typeof(module) !== 'undefined' && typeof(exports) !== 'undefined') { | ||
//base_string_data to string | ||
for(var key in base_string_data) { | ||
var value = base_string_data[key]; | ||
for(var i in base_string_data) { | ||
var key = base_string_data[i].key; | ||
var value = base_string_data[i].value; | ||
// check if the value is an array | ||
@@ -276,10 +277,11 @@ // this means that this key has multiple values | ||
OAuth.prototype.toHeader = function(oauth_data) { | ||
oauth_data = this.sortObject(oauth_data); | ||
var sorted = this.sortObject(oauth_data); | ||
var header_value = 'OAuth '; | ||
for(var key in oauth_data) { | ||
if (key.indexOf('oauth_') === -1) | ||
for(var i = 0; i < sorted.length; i++) { | ||
if (sorted[i].key.indexOf('oauth_') !== 0 && sorted[i].key !== 'realm') | ||
continue; | ||
header_value += this.percentEncode(key) + '="' + this.percentEncode(oauth_data[key]) + '"' + this.parameter_seperator; | ||
header_value += this.percentEncode(sorted[i].key) + '="' + this.percentEncode(sorted[i].value) + '"' + this.parameter_seperator; | ||
} | ||
@@ -341,3 +343,3 @@ | ||
var keys = Object.keys(data); | ||
var result = {}; | ||
var result = []; | ||
@@ -348,3 +350,6 @@ keys.sort(); | ||
var key = keys[i]; | ||
result[key] = data[key]; | ||
result.push({ | ||
key: key, | ||
value: data[key], | ||
}); | ||
} | ||
@@ -351,0 +356,0 @@ |
{ | ||
"name": "oauth-1.0a", | ||
"version": "2.1.0", | ||
"version": "2.1.1", | ||
"description": "OAuth 1.0a Request Authorization for Node and Browser.", | ||
@@ -5,0 +5,0 @@ "scripts": { |
@@ -1,2 +0,2 @@ | ||
oauth-1.0a ![semaphore][semaphore-img] | ||
oauth-1.0a [![semaphore][semaphore-img]][semaphore-url] | ||
========== | ||
@@ -15,3 +15,3 @@ | ||
[semaphore-img]: https://semaphoreci.com/api/v1/ddo/oauth-1-0a/branches/master/badge.svg | ||
[semaphore-url]: https://semaphoreci.com/ddo/oauth-1-0a) | ||
[semaphore-url]: https://semaphoreci.com/ddo/oauth-1-0a | ||
@@ -111,5 +111,5 @@ [download-img]: https://img.shields.io/npm/dm/oauth-1.0a.svg?style=flat-square | ||
##Installation | ||
## Installation | ||
###Node.js | ||
### Node.js | ||
$ npm install oauth-1.0a --production | ||
@@ -126,3 +126,3 @@ | ||
###Browser | ||
### Browser | ||
Download oauth-1.0a.js [here](https://raw.githubusercontent.com/ddo/oauth-1.0a/master/oauth-1.0a.js) | ||
@@ -142,5 +142,5 @@ | ||
##Examples | ||
## Examples | ||
###Work with [request](https://github.com/mikeal/request) (Node.js) | ||
### Work with [request](https://github.com/mikeal/request) (Node.js) | ||
@@ -213,3 +213,3 @@ Depencies | ||
###Work with [jQuery.ajax](http://api.jquery.com/jQuery.ajax/) (Browser) | ||
### Work with [jQuery.ajax](http://api.jquery.com/jQuery.ajax/) (Browser) | ||
@@ -276,3 +276,3 @@ **Caution:** please make sure you understand what happen when use OAuth protocol at client side [here](#client-side-usage-caution) | ||
##.authorize(/* options */) | ||
## .authorize(/* options */) | ||
@@ -294,3 +294,3 @@ * url: ``String`` | ||
##.toHeader(/* signed data */) | ||
## .toHeader(/* signed data */) | ||
@@ -310,3 +310,3 @@ convert signed data into headers | ||
##Init Options | ||
## Init Options | ||
```js | ||
@@ -334,3 +334,3 @@ var oauth = OAuth(/* options */); | ||
##Notes | ||
## Notes | ||
@@ -346,3 +346,3 @@ * Some OAuth requests without token use ``.authorize(request_data)`` instead of ``.authorize(request_data, {})`` | ||
##Client Side Usage Caution | ||
## Client Side Usage Caution | ||
@@ -362,2 +362,2 @@ OAuth is based around allowing tools and websites to talk to each other. | ||
##[Changelog](https://github.com/ddo/oauth-1.0a/releases) | ||
## [Changelog](https://github.com/ddo/oauth-1.0a/releases) |
@@ -31,2 +31,6 @@ var expect = require('chai').expect; | ||
while(random === 0) { | ||
random = parseInt(Math.random()*100, 10); | ||
} | ||
var oauth = new OAuth({ | ||
@@ -33,0 +37,0 @@ consumer: {}, |
@@ -1,6 +0,6 @@ | ||
##Core testing | ||
## Core testing | ||
``twitter_sample_data.js`` | ||
##Services | ||
## Services | ||
@@ -13,3 +13,3 @@ * Twitter | ||
##Setup | ||
## Setup | ||
@@ -33,4 +33,4 @@ Please these define Node environment variables: | ||
##Run test | ||
## Run test | ||
``make test`` |
@@ -6,3 +6,3 @@ var expect = require('chai').expect; | ||
describe("Openbank Personal Consumer", function() { | ||
describe.skip("Openbank Personal Consumer", function() { | ||
this.timeout(10000); | ||
@@ -9,0 +9,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
57853
1228