Remove the requirement to authenticate for /admin/server_version. (#5122)
This endpoint isn't much use for its intended purpose if you first need to get yourself an admin's auth token. I've restricted it to the `/_synapse/admin` path to make it a bit easier to lock down for those concerned about exposing this information. I don't imagine anyone is using it in anger currently.
This commit is contained in:
committed by
GitHub
parent
3fdff14207
commit
59e2d2694d
@@ -181,10 +181,7 @@ class HomeserverTestCase(TestCase):
|
||||
raise Exception("A homeserver wasn't returned, but %r" % (self.hs,))
|
||||
|
||||
# Register the resources
|
||||
self.resource = JsonResource(self.hs)
|
||||
|
||||
for servlet in self.servlets:
|
||||
servlet(self.hs, self.resource)
|
||||
self.resource = self.create_test_json_resource()
|
||||
|
||||
from tests.rest.client.v1.utils import RestHelper
|
||||
|
||||
@@ -230,6 +227,23 @@ class HomeserverTestCase(TestCase):
|
||||
hs = self.setup_test_homeserver()
|
||||
return hs
|
||||
|
||||
def create_test_json_resource(self):
|
||||
"""
|
||||
Create a test JsonResource, with the relevant servlets registerd to it
|
||||
|
||||
The default implementation calls each function in `servlets` to do the
|
||||
registration.
|
||||
|
||||
Returns:
|
||||
JsonResource:
|
||||
"""
|
||||
resource = JsonResource(self.hs)
|
||||
|
||||
for servlet in self.servlets:
|
||||
servlet(self.hs, resource)
|
||||
|
||||
return resource
|
||||
|
||||
def default_config(self, name="test"):
|
||||
"""
|
||||
Get a default HomeServer config object.
|
||||
|
||||
Reference in New Issue
Block a user