Skip to content

Commit 2175a37

Browse files
committed
Make xmlrpc and rest APIs configurable
1 parent 558339b commit 2175a37

File tree

2 files changed

+17
-2
lines changed

2 files changed

+17
-2
lines changed

roundup/cgi/client.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -426,10 +426,13 @@ def setTranslator(self, translator=None):
426426
def main(self):
427427
""" Wrap the real main in a try/finally so we always close off the db.
428428
"""
429+
xmlrpc_enabled = self.instance.config.WEB_ENABLE_XMLRPC
430+
rest_enabled = self.instance.config.WEB_ENABLE_REST
429431
try:
430-
if self.path == 'xmlrpc':
432+
if xmlrpc_enabled and self.path == 'xmlrpc':
431433
self.handle_xmlrpc()
432-
elif self.path == 'rest' or self.path[:5] == 'rest/':
434+
elif rest_enabled and (self.path == 'rest' or
435+
self.path[:5] == 'rest/'):
433436
self.handle_rest()
434437
else:
435438
self.inner_main()

roundup/configuration.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -727,6 +727,18 @@ def str2value(self, value):
727727
are logged into roundup and open a roundup link
728728
from a source other than roundup (e.g. link in
729729
email)."""),
730+
(BooleanOption, 'enable_xmlrpc', "yes",
731+
"""Whether to enable the XMLRPC API in the roundup web
732+
interface. By default the XMLRPC endpoint is the string 'xmlrpc'
733+
after the roundup web url configured in the 'tracker' section.
734+
If this variable is set to 'no', the xmlrpc path has no special meaning
735+
and will yield an error message."""),
736+
(BooleanOption, 'enable_rest', "yes",
737+
"""Whether to enable the REST API in the roundup web
738+
interface. By default the REST endpoint is the string 'rest' plus any
739+
additional REST-API parameters after the roundup web url configured in
740+
the tracker section. If this variable is set to 'no', the rest path has
741+
no special meaning and will yield an error message."""),
730742
(CsrfSettingOption, 'csrf_enforce_token', "yes",
731743
"""How do we deal with @csrf fields in posted forms.
732744
Set this to 'required' to block the post and notify

0 commit comments

Comments
 (0)