New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactor OAuth into separate module #1366
Conversation
👍 looks fine to me. I'm not an expert on OAuth (or our OAuth code) but my test scripts against oauthbin.com still pass so I think moving I'll merge this in a couple of days if no one objects or beats me to it. |
Always set oauth signature as last parameter
@nylen I just enabled the About the signature position I read this, so although it might work I decided to stick with the spec. I tested with a dozen of providers using OAuth1, everything seems to be fine. |
Per discussion in #1122 I'm nominating this for $30 bounty. @seanstrom @FredKSchott and anyone else, let me know your thoughts on using this a a guinea pig for bounty :) |
Im fine with this being a bounty, good work @simov 👍 |
Not needed at all, but if you insist on giving a bounty for this, I'm fine with your decision. As for the unit testing the new modules, that would come too, still we're going to need our system like tests that involves the entire request object. So for now we can safely rely on what we already have as tests, as I'm not changing or adding behavior during this refactoring, after all it is a refactoring :) |
Oh we will pay you whether you like it or not :). |
Bountysource says this issue is closed for some reason. Closing and reopening to see if that fixes it. |
Do I need account on BountySource? EDIT: Here is my new shiny account on BountySource https://www.bountysource.com/people/30682-simov in case this can be of any help |
yeah, looks like if you log in and go here you may be able to request it: https://www.bountysource.com/issues/7999758-refactor-oauth-into-separate-module/developers |
ok, posted my claim here https://www.bountysource.com/issues/7999758-refactor-oauth-into-separate-module/developers |
bleh. looks like you are all set to be paid $0. I'll get in touch with bountysource support and see if they can help. |
Probably I have to enter the amount in my comment? |
Reply from Bountysource support: Hey James, There's some quirkiness regarding how Bountysource handles GitHub Pull Requests at the moment. All bounties should be on open Issues, not pull requests, so that should be disallowed. There are actually two issues that you've highlighted here:
Is there an issue that corresponds to that open PR (or can you create one)? I would suggest putting the bounty on that issue and, when the issue gets closed the developer can claim the bounty. As a backer of the issue you will have the ability to approve/deny the bounty claim. Sorry about the rather poor experience in this situation, we have some edge cases to clean up :). Hope this answers your questions. |
Refactor OAuth into separate module
This is a follow up to my previous PR #1350 Also it might be related to this one #1360
The
getParams
function is about the generation of OAuth parameters. I think it's pretty straightforward to understand which parameters have defaults, which are excluded, and what parameters are required for the OAuth signature.The
concatParams
function is the oldbuildSortedParams
but I though it deserves it's own function, I mean theoa
parameter was used from the outer scope, so it was not exactly a function in that sense.One change in
concatParams
is that the signature is no longer appended to the end of the string, but that can be changed if it not confront to the spec in some way.The
oauth
function is pretty much what's left from the original one, but I think now it's more compact and easy to follow, it even fits on my screen. ThegetParams
andconcatParams
are called from there, there is only one level of indirection so again it's very easy to follow.All of the available input
args
parameters are listed on top of theoauth
function. Also right now in Request this module is called likevar result = oauth.oauth
which is a bit silly, but I couldn't come up with something more reasonable.At first I thought that returning of a map is not a good idea for the
oauth
method, but then I liked how it feels, I meanresult.transport
andresult.oauth
sounds good to me.That's all I could think of at the moment.