mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-08-08 22:12:21 -04:00
Add a primitive helper script for listing worker endpoints. (#15243)
Co-authored-by: Patrick Cloke <patrickc@matrix.org>
This commit is contained in:
parent
3b0083c92a
commit
98fd558382
31 changed files with 424 additions and 12 deletions
|
@ -43,19 +43,22 @@ def client_patterns(
|
|||
Returns:
|
||||
An iterable of patterns.
|
||||
"""
|
||||
patterns = []
|
||||
versions = []
|
||||
|
||||
if unstable:
|
||||
unstable_prefix = CLIENT_API_PREFIX + "/unstable"
|
||||
patterns.append(re.compile("^" + unstable_prefix + path_regex))
|
||||
if v1:
|
||||
v1_prefix = CLIENT_API_PREFIX + "/api/v1"
|
||||
patterns.append(re.compile("^" + v1_prefix + path_regex))
|
||||
for release in releases:
|
||||
new_prefix = CLIENT_API_PREFIX + f"/{release}"
|
||||
patterns.append(re.compile("^" + new_prefix + path_regex))
|
||||
versions.append("api/v1")
|
||||
versions.extend(releases)
|
||||
if unstable:
|
||||
versions.append("unstable")
|
||||
|
||||
return patterns
|
||||
if len(versions) == 1:
|
||||
versions_str = versions[0]
|
||||
elif len(versions) > 1:
|
||||
versions_str = "(" + "|".join(versions) + ")"
|
||||
else:
|
||||
raise RuntimeError("Must have at least one version for a URL")
|
||||
|
||||
return [re.compile("^" + CLIENT_API_PREFIX + "/" + versions_str + path_regex)]
|
||||
|
||||
|
||||
def set_timeline_upper_limit(filter_json: JsonDict, filter_timeline_limit: int) -> None:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue