mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-04 06:54:54 -04:00
Remove deprecated /_matrix/client/*/admin
endpoints (#8785)
These are now only available via `/_synapse/admin/v1`.
This commit is contained in:
parent
2b110dda2a
commit
3f0ff53158
16 changed files with 176 additions and 68 deletions
|
@ -22,28 +22,6 @@ from synapse.api.errors import AuthError
|
|||
from synapse.types import UserID
|
||||
|
||||
|
||||
def historical_admin_path_patterns(path_regex):
|
||||
"""Returns the list of patterns for an admin endpoint, including historical ones
|
||||
|
||||
This is a backwards-compatibility hack. Previously, the Admin API was exposed at
|
||||
various paths under /_matrix/client. This function returns a list of patterns
|
||||
matching those paths (as well as the new one), so that existing scripts which rely
|
||||
on the endpoints being available there are not broken.
|
||||
|
||||
Note that this should only be used for existing endpoints: new ones should just
|
||||
register for the /_synapse/admin path.
|
||||
"""
|
||||
return [
|
||||
re.compile(prefix + path_regex)
|
||||
for prefix in (
|
||||
"^/_synapse/admin/v1",
|
||||
"^/_matrix/client/api/v1/admin",
|
||||
"^/_matrix/client/unstable/admin",
|
||||
"^/_matrix/client/r0/admin",
|
||||
)
|
||||
]
|
||||
|
||||
|
||||
def admin_patterns(path_regex: str, version: str = "v1"):
|
||||
"""Returns the list of patterns for an admin endpoint
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue