mirror of
https://git.anonymousland.org/anonymousland/synapse-product.git
synced 2025-05-09 01:15:06 -04:00
Type hints and validation improvements. (#9321)
* Adds type hints to the groups servlet and stringutils code. * Assert the maximum length of some input values for spec compliance.
This commit is contained in:
parent
0963d39ea6
commit
3f58fc848d
6 changed files with 177 additions and 79 deletions
|
@ -25,7 +25,17 @@ import abc
|
|||
import functools
|
||||
import logging
|
||||
import os
|
||||
from typing import TYPE_CHECKING, Any, Callable, Dict, List, Optional, TypeVar, cast
|
||||
from typing import (
|
||||
TYPE_CHECKING,
|
||||
Any,
|
||||
Callable,
|
||||
Dict,
|
||||
List,
|
||||
Optional,
|
||||
TypeVar,
|
||||
Union,
|
||||
cast,
|
||||
)
|
||||
|
||||
import twisted.internet.base
|
||||
import twisted.internet.tcp
|
||||
|
@ -588,7 +598,9 @@ class HomeServer(metaclass=abc.ABCMeta):
|
|||
return UserDirectoryHandler(self)
|
||||
|
||||
@cache_in_self
|
||||
def get_groups_local_handler(self):
|
||||
def get_groups_local_handler(
|
||||
self,
|
||||
) -> Union[GroupsLocalWorkerHandler, GroupsLocalHandler]:
|
||||
if self.config.worker_app:
|
||||
return GroupsLocalWorkerHandler(self)
|
||||
else:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue