Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
bugzilla
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
etersoft
bugzilla
Commits
22ac4064
Commit
22ac4064
authored
Apr 17, 2008
by
bbaetz%acm.org
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bug 428941 â Allow extension webservices to override LOGIN_EXEMPT
r/a=mkanat
parent
32b928ba
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
47 additions
and
21 deletions
+47
-21
WebService.pm
Bugzilla/WebService.pm
+17
-3
Bugzilla.pm
Bugzilla/WebService/Bugzilla.pm
+6
-0
Constants.pm
Bugzilla/WebService/Constants.pm
+0
-11
User.pm
Bugzilla/WebService/User.pm
+6
-0
xmlrpc.cgi
xmlrpc.cgi
+18
-7
No files found.
Bugzilla/WebService.pm
View file @
22ac4064
...
...
@@ -42,10 +42,24 @@ sub datetime_format {
}
sub
handle_login
{
my
(
$self
,
$module
,
$method
)
=
@_
;
my
$exempt
=
LOGIN_EXEMPT
->
{
$module
};
return
if
$exempt
&&
grep
{
$_
eq
$method
}
@$exempt
;
my
(
$classes
,
$action
,
$uri
,
$method
)
=
@_
;
my
$class
=
$classes
->
{
$uri
};
eval
"require $class"
;
return
if
$class
->
login_exempt
(
$method
);
Bugzilla
->
login
;
return
;
}
# For some methods, we shouldn't call Bugzilla->login before we call them
use
constant
LOGIN_EXEMPT
=>
{
};
sub
login_exempt
{
my
(
$class
,
$method
)
=
@_
;
return
$class
->
LOGIN_EXEMPT
->
{
$method
};
}
1
;
...
...
Bugzilla/WebService/Bugzilla.pm
View file @
22ac4064
...
...
@@ -26,6 +26,12 @@ import SOAP::Data qw(type);
use
Time::
Zone
;
# Basic info that is needed before logins
use
constant
LOGIN_EXEMPT
=>
{
timezone
=>
1
,
version
=>
1
,
};
sub
version
{
return
{
version
=>
type
(
'string'
)
->
value
(
BUGZILLA_VERSION
)
};
}
...
...
Bugzilla/WebService/Constants.pm
View file @
22ac4064
...
...
@@ -27,8 +27,6 @@ use base qw(Exporter);
ERROR_AUTH_NODATA
ERROR_UNIMPLEMENTED
LOGIN_EXEMPT
)
;
# This maps the error names in global/*-error.html.tmpl to numbers.
...
...
@@ -108,13 +106,4 @@ use constant ERROR_AUTH_NODATA => 410;
use
constant
ERROR_UNIMPLEMENTED
=>
910
;
use
constant
ERROR_GENERAL
=>
999
;
# For some methods, we shouldn't call Bugzilla->login before we call them.
# This is a hash--package names pointing to an arrayref of method names.
use
constant
LOGIN_EXEMPT
=>
{
# Callers may have to know the Bugzilla version before logging in,
# even on a requirelogin installation.
Bugzilla
=>
[
'version'
,
'timezone'
],
User
=>
[
'offer_account_by_email'
,
'login'
],
};
1
;
Bugzilla/WebService/User.pm
View file @
22ac4064
...
...
@@ -30,6 +30,12 @@ use Bugzilla::User;
use
Bugzilla::
Util
qw(trim)
;
use
Bugzilla::
Token
;
# Don't need auth to login
use
constant
LOGIN_EXEMPT
=>
{
login
=>
1
,
offer_account_by_email
=>
1
,
};
##############
# User Login #
##############
...
...
xmlrpc.cgi
View file @
22ac4064
...
...
@@ -35,12 +35,23 @@ my %hook_dispatch;
Bugzilla::Hook::
process
(
'webservice'
,
{
dispatch
=>
\%
hook_dispatch
});
local
@INC
=
(
bz_locations
()
->
{
extensionsdir
},
@INC
);
my
$dispatch
=
{
'Bugzilla'
=>
'Bugzilla::WebService::Bugzilla'
,
'Bug'
=>
'Bugzilla::WebService::Bug'
,
'User'
=>
'Bugzilla::WebService::User'
,
'Product'
=>
'Bugzilla::WebService::Product'
,
%
hook_dispatch
};
# The on_action sub needs to be wrapped so that we can work out which
# class to use; when the XMLRPC module calls it theres no indication
# of which dispatch class will be handling it.
# Note that using this to get code thats called before the actual routine
# is a bit of a hack; its meant to be for modifying the SOAPAction
# headers, which XMLRPC doesn't use; it relies on the XMLRPC modules
# using SOAP::Lite internally....
my
$response
=
Bugzilla::WebService::XMLRPC::Transport::HTTP::
CGI
->
dispatch_with
({
'Bugzilla'
=>
'Bugzilla::WebService::Bugzilla'
,
'Bug'
=>
'Bugzilla::WebService::Bug'
,
'User'
=>
'Bugzilla::WebService::User'
,
'Product'
=>
'Bugzilla::WebService::Product'
,
%
hook_dispatch
})
->
on_action
(
\&
Bugzilla::WebService::
handle_login
)
->
dispatch_with
(
$dispatch
)
->
on_action
(
sub
{
Bugzilla::WebService::
handle_login
(
$dispatch
,
@_
)
}
)
->
handle
;
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment