mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-03 03:04:53 -04:00
Merge pull request #1026 from matrix-org/paul/thirdpartylookup
3rd party entity lookup
This commit is contained in:
commit
5674ea3e6c
7 changed files with 189 additions and 1 deletions
|
@ -123,6 +123,15 @@ def _load_appservice(hostname, as_info, config_filename):
|
|||
raise ValueError(
|
||||
"Missing/bad type 'exclusive' key in %s", regex_obj
|
||||
)
|
||||
# protocols check
|
||||
protocols = as_info.get("protocols")
|
||||
if protocols:
|
||||
# Because strings are lists in python
|
||||
if isinstance(protocols, str) or not isinstance(protocols, list):
|
||||
raise KeyError("Optional 'protocols' must be a list if present.")
|
||||
for p in protocols:
|
||||
if not isinstance(p, str):
|
||||
raise KeyError("Bad value for 'protocols' item")
|
||||
return ApplicationService(
|
||||
token=as_info["as_token"],
|
||||
url=as_info["url"],
|
||||
|
@ -130,4 +139,5 @@ def _load_appservice(hostname, as_info, config_filename):
|
|||
hs_token=as_info["hs_token"],
|
||||
sender=user_id,
|
||||
id=as_info["id"],
|
||||
protocols=protocols,
|
||||
)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue