diff options
author | Andrew Morgan <1342360+anoadragon453@users.noreply.github.com> | 2020-01-22 13:36:43 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-01-22 13:36:43 +0000 |
commit | 90a28fb475a29daa9e7a9ee7204f6f76cc8af441 (patch) | |
tree | 259fe9fa93613a420f65a09dbabeda22121fe8e3 /synapse/rest/admin/_base.py | |
parent | Merge pull request #6764 from matrix-org/babolivier/fix-thumbnail (diff) | |
download | synapse-90a28fb475a29daa9e7a9ee7204f6f76cc8af441.tar.xz |
Admin API to list, filter and sort rooms (#6720)
Diffstat (limited to 'synapse/rest/admin/_base.py')
-rw-r--r-- | synapse/rest/admin/_base.py | 15 |
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 |