summary refs log tree commit diff
path: root/synapse/rest/admin/_base.py
diff options
context:
space:
mode:
authorAndrew Morgan <andrew@amorgan.xyz>2020-03-23 13:15:24 +0000
committerAndrew Morgan <andrew@amorgan.xyz>2020-03-23 13:15:24 +0000
commitfc43d20d9d005e1ada5683a29a02913b7480c8da (patch)
tree3aa14e304d2432d24b8f801fd954eef12984eb6c /synapse/rest/admin/_base.py
parentMerge pull request #6764 from matrix-org/babolivier/fix-thumbnail (diff)
parentAdmin API to list, filter and sort rooms (#6720) (diff)
downloadsynapse-fc43d20d9d005e1ada5683a29a02913b7480c8da.tar.xz
Admin API to list, filter and sort rooms (#6720)
* commit '90a28fb47':
  Admin API to list, filter and sort rooms (#6720)
Diffstat (limited to 'synapse/rest/admin/_base.py')
-rw-r--r--synapse/rest/admin/_base.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/synapse/rest/admin/_base.py b/synapse/rest/admin/_base.py

index afd0647205..459482eb6d 100644 --- a/synapse/rest/admin/_base.py +++ b/synapse/rest/admin/_base.py
@@ -40,6 +40,21 @@ def historical_admin_path_patterns(path_regex): ) +def admin_patterns(path_regex: str): + """Returns the list of patterns for an admin endpoint + + Args: + path_regex: The regex string to match. This should NOT have a ^ + as this will be prefixed. + + Returns: + A list of regex patterns. + """ + admin_prefix = "^/_synapse/admin/v1" + patterns = [re.compile(admin_prefix + path_regex)] + return patterns + + async def assert_requester_is_admin(auth, request): """Verify that the requester is an admin user