ISSUE-232 feature flag addition of the oauth_token parameter#378
Open
davidalpert wants to merge 2 commits intosumoheavy:masterfrom
Open
ISSUE-232 feature flag addition of the oauth_token parameter#378davidalpert wants to merge 2 commits intosumoheavy:masterfrom
davidalpert wants to merge 2 commits intosumoheavy:masterfrom
Conversation
previously an empty oauth_token parameter was appended to the
query before sending it to jira when the auth_type parameter
was set to oauth_2legged, but it appears that oauth v0.5.5
is appending the actual value of oauth_token as a parameter
as a result the code which was appending an empty oauth_token
parameter was actually appending it to the existing oauth_token
value, thereby corrupting the token and resulting in a vague
parameter_rejected (OAuth::Problem)
error. I had to look at the detail in the server
atlassian-jira.log file in order to see the actual problem.
in order to preserve behaviour and backwards compatibilty with
the previous release of the jira-ruby gem, this commit introduces
a new feature flag :append_explicit_oauth_token_parameter which
defaults to true, same as before, but can now be explicitly
toggled off to avoid corrupting the access token in this way.
using this commit I am able to query for jira issues via JQL
without my username and password but instead using client options
configured like this:
oauth_options = {
site: 'https://my.jir.com',
context_path: '',
auth_type: :oauth_2legged,
private_key_file: File.absolute_path(File.join(__dir__, 'privatekey.pem')),
consumer_key: 'oauthtest',
append_explicit_oauth_token_parameter: false
}
Contributor
|
Hi @davidalpert , thank you for your suggestion. |
Contributor
Author
|
thank you @SimonMiaou; it's been a while since I looked at this change but thank you for the feedback. let me see if I can rebase this on top of latest (to resolve conflicts) and add a test for the change. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
this PR should help address #232
previously an empty
oauth_tokenparameter was appended to thequery before sending it to jira when the
:auth_typeparameterwas set to
:oauth_2legged, but it appears that oauth v0.5.5is appending the actual value of
oauth_tokenas a parameteras a result the code which was appending an empty
oauth_tokenparameter was actually appending it to the existing
oauth_tokenvalue, thereby corrupting the token and resulting in a vague
error. I had to look at the detail in the server
atlassian-jira.logfile in order to see the actual problem.in order to preserve behaviour and backwards compatibilty with
the previous release of the jira-ruby gem, this commit introduces
a new feature flag
:append_explicit_oauth_token_parameterwhichdefaults to true, same as before, but can now be explicitly
toggled off to avoid corrupting the access token in this way.
using this commit I am able to query for jira issues via JQL
without my username and password but instead using client options
configured like this:
I welcome feedback on: