mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-06 14:24:58 -04:00
Use admin_patterns for all admin APIs. (#8331)
This reduces duplication of the admin prefix in regular expressions.
This commit is contained in:
parent
53284c425e
commit
c3c9732c53
7 changed files with 20 additions and 26 deletions
|
@ -12,14 +12,13 @@
|
|||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
import re
|
||||
|
||||
from synapse.http.servlet import (
|
||||
RestServlet,
|
||||
assert_params_in_dict,
|
||||
parse_json_object_from_request,
|
||||
)
|
||||
from synapse.rest.admin import assert_requester_is_admin
|
||||
from synapse.rest.admin._base import admin_patterns
|
||||
|
||||
|
||||
class PurgeRoomServlet(RestServlet):
|
||||
|
@ -35,7 +34,7 @@ class PurgeRoomServlet(RestServlet):
|
|||
{}
|
||||
"""
|
||||
|
||||
PATTERNS = (re.compile("^/_synapse/admin/v1/purge_room$"),)
|
||||
PATTERNS = admin_patterns("/purge_room$")
|
||||
|
||||
def __init__(self, hs):
|
||||
"""
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue