Bug 525734: Allow WebService clients to authenticate using Bugzilla_login and Bugzilla_password

Patch by Max Kanat-Alexander <mkanat@bugzilla.org> r=dkl, a=mkanat


git-svn-id: svn://10.0.0.236/trunk@258941 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
mkanat%bugzilla.org
2009-11-09 19:15:30 +00:00
parent cd2d814549
commit 0dfd6e55e2
10 changed files with 135 additions and 21 deletions

View File

@@ -112,12 +112,6 @@ sub _argument_type_check {
my $self = shift;
my $params = $self->SUPER::_argument_type_check(@_);
# This is the best time to do login checks.
$self->handle_login();
# If there are no parameters, we don't need to parse them.
return $params if !ref $params;
# JSON-RPC 1.0 requires all parameters to be passed as an array, so
# we just pull out the first item and assume it's an object.
if (ref $params eq 'ARRAY') {
@@ -144,6 +138,11 @@ sub _argument_type_check {
}
}
Bugzilla->input_params($params);
# This is the best time to do login checks.
$self->handle_login();
# Bugzilla::WebService packages call internal methods like
# $self->_some_private_method. So we have to inherit from
# that class as well as this Server class.

View File

@@ -78,6 +78,7 @@ sub deserialize {
$som->{_bz_do_taint} = 1;
}
bless $som, 'Bugzilla::XMLRPC::SOM';
Bugzilla->input_params($som->paramsin);
return $som;
}
@@ -146,11 +147,13 @@ use Bugzilla::WebService::Util qw(taint_data);
sub paramsin {
my $self = shift;
return $self->{bz_params_in} if $self->{bz_params_in};
my $params = $self->SUPER::paramsin(@_);
if ($self->{_bz_do_taint}) {
taint_data($params);
}
return $params;
$self->{bz_params_in} = $params;
return $self->{bz_params_in};
}
1;