add admin_api_url
This commit is contained in:
parent
5dd0096826
commit
928bc7c3f4
1 changed files with 5 additions and 5 deletions
|
@ -14,9 +14,6 @@ class SynapseConfig:
|
|||
"""Validate Synapse config after initialization."""
|
||||
if not self.homeserver.strip():
|
||||
raise ValueError("Homeserver URL cannot be empty")
|
||||
parsed = urlparse(self.homeserver)
|
||||
if not all([parsed.scheme, parsed.netloc]):
|
||||
raise ValueError(f"Invalid homeserver URL: {self.homeserver}")
|
||||
|
||||
if not self.access_token.strip():
|
||||
raise ValueError("Access token cannot be empty")
|
||||
|
@ -28,9 +25,12 @@ class SynapseConfig:
|
|||
raise ValueError("Blacklist contains invalid username")
|
||||
|
||||
@property
|
||||
def base_url(self) -> str:
|
||||
def admin_api_url(self) -> str:
|
||||
"""Get normalized base URL with trailing slash."""
|
||||
return self.homeserver.rstrip('/') + '/_synapse/admin'
|
||||
parsed = urlparse(self.homeserver)
|
||||
if not parsed.scheme:
|
||||
return f"https://{self.homeserver}/_synapse/admin"
|
||||
return self.homeserver.rstrip('/') + "/_synapse/admin"
|
||||
|
||||
@property
|
||||
def headers(self) -> Dict[str, str]:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue