bytespider / jsOAuth

JavaScript implimentation of the OAuth protocol. Currently supports version 1.0 (RFC5849) of the specification. Node.js & CommonJS compatible.
http://bytespider.github.com/jsOAuth/
MIT License
557 stars 109 forks source link

Support multiple parameters with the same name in requests and responses #54

Open gauthierm opened 10 years ago

gauthierm commented 10 years ago

Changes query string from a hash to a list. Changes the JSON data structure for passing in parameters.

Where previously data was an object hash, it is now an array:

oauth.request({
    method: 'POST',
    url: endpoint + '/oauth/access_token',
    data: [
        [ 'xauth_username' , username ],
        [ 'xauth_password' , password ],
        [ 'xauth_mode'     , 'client_auth' ]
    ],
    success: handlexAuthSuccess,
    failure: handleFailure
});
bytespider commented 10 years ago

Changes looks great, I think I may have to bump the version number to 2.0.0 as these changes are clearly API breaking.

Could you also update the docs https://github.com/bytespider/jsOAuth/blob/gh-pages/api-reference/index.markdown to reflect the changes to the API?

Other than that, great work, I'll let the changing of == to === and a few other formatting things slide.

gauthierm commented 10 years ago

Thanks. A couple of questions:

  1. Do you want me to open the PR to a 2.0 branch so you can push changes easily?
  2. Do you want the commits squashed before merging?

I can update the docs. The tests are probably also out of date.

bytespider commented 10 years ago

Yeah tests would be good.

No, the 2.0 branch was meant for a complete rewrite that I never completed. What I've done is branched off master for 1.x, so I'm happy for these 2.x changes to be on master.

Yea if you could rebase with master, if you didnt already, and squash to a couple or one commit, that would make the merge/history simpler I suspect