summaryrefslogtreecommitdiffstats
path: root/Bugzilla/WebService/Util.pm
diff options
context:
space:
mode:
authorDavid Lawrence <dkl@mozilla.com>2014-05-12 16:36:59 +0200
committerDavid Lawrence <dkl@mozilla.com>2014-05-12 16:36:59 +0200
commit70e8ab711072845b5a39394268e70a88729e9d9a (patch)
treeb4df8c8d36bb350d709ac97ec2108a3164c366dd /Bugzilla/WebService/Util.pm
parent8243604780d562f47af41b9e9b2f78b00d29f424 (diff)
downloadbugzilla-70e8ab711072845b5a39394268e70a88729e9d9a.tar.gz
bugzilla-70e8ab711072845b5a39394268e70a88729e9d9a.tar.xz
Bug 1001462 - Bug.search causes error when using simple token auth and specifying 'token' instead of 'Bugzilla_token'
r/a=glob
Diffstat (limited to 'Bugzilla/WebService/Util.pm')
-rw-r--r--Bugzilla/WebService/Util.pm23
1 files changed, 11 insertions, 12 deletions
diff --git a/Bugzilla/WebService/Util.pm b/Bugzilla/WebService/Util.pm
index bba6122e5..8e66a9b53 100644
--- a/Bugzilla/WebService/Util.pm
+++ b/Bugzilla/WebService/Util.pm
@@ -261,18 +261,17 @@ sub params_to_objects {
sub fix_credentials {
my ($params) = @_;
- # Allow user to pass in login=foo&password=bar as a convenience
- # even if not calling GET /login. We also do not delete them as
- # GET /login requires "login" and "password".
- if (exists $params->{'login'} && exists $params->{'password'}) {
- $params->{'Bugzilla_login'} = $params->{'login'};
- $params->{'Bugzilla_password'} = $params->{'password'};
- }
- # Allow user to pass token=12345678 as a convenience which becomes
- # "Bugzilla_token" which is what the auth code looks for.
- if (exists $params->{'token'}) {
- $params->{'Bugzilla_token'} = $params->{'token'};
- }
+
+ # Allow user to pass in login, password, restrict_login, and
+ # token as short-cuts to the longer versions.
+ $params->{'Bugzilla_login'} = delete $params->{'login'}
+ if exists $params->{'login'};
+ $params->{'Bugzilla_password'} = delete $params->{'password'}
+ if exists $params->{'password'};
+ $params->{'Bugzilla_restrictlogin'} = delete $params->{'restrict_login'}
+ if exists $params->{'restrict_login'};
+ $params->{'Bugzilla_token'} = delete $params->{'token'}
+ if exists $params->{'token'};
# Allow extensions to modify the credential data before login
Bugzilla::Hook::process('webservice_fix_credentials', { params => $params });