mirror of
https://mau.dev/maunium/synapse.git
synced 2024-10-01 01:36:05 -04:00
run isort
This commit is contained in:
parent
2ee9f1bd1a
commit
49af402019
@ -18,15 +18,16 @@ import logging
|
|||||||
from six import itervalues
|
from six import itervalues
|
||||||
|
|
||||||
import pymacaroons
|
import pymacaroons
|
||||||
from twisted.internet import defer
|
|
||||||
from netaddr import IPAddress
|
from netaddr import IPAddress
|
||||||
|
|
||||||
|
from twisted.internet import defer
|
||||||
|
|
||||||
import synapse.types
|
import synapse.types
|
||||||
from synapse import event_auth
|
from synapse import event_auth
|
||||||
from synapse.api.constants import EventTypes, Membership, JoinRules
|
from synapse.api.constants import EventTypes, JoinRules, Membership
|
||||||
from synapse.api.errors import AuthError, Codes
|
from synapse.api.errors import AuthError, Codes
|
||||||
from synapse.types import UserID
|
from synapse.types import UserID
|
||||||
from synapse.util.caches import register_cache, CACHE_SIZE_FACTOR
|
from synapse.util.caches import CACHE_SIZE_FACTOR, register_cache
|
||||||
from synapse.util.caches.lrucache import LruCache
|
from synapse.util.caches.lrucache import LruCache
|
||||||
from synapse.util.metrics import Measure
|
from synapse.util.metrics import Measure
|
||||||
|
|
||||||
|
@ -17,11 +17,11 @@
|
|||||||
|
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
from canonicaljson import json
|
|
||||||
|
|
||||||
from six import iteritems
|
from six import iteritems
|
||||||
from six.moves import http_client
|
from six.moves import http_client
|
||||||
|
|
||||||
|
from canonicaljson import json
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
|
@ -12,15 +12,15 @@
|
|||||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
from synapse.api.errors import SynapseError
|
import jsonschema
|
||||||
from synapse.storage.presence import UserPresenceState
|
from canonicaljson import json
|
||||||
from synapse.types import UserID, RoomID
|
from jsonschema import FormatChecker
|
||||||
|
|
||||||
from twisted.internet import defer
|
from twisted.internet import defer
|
||||||
|
|
||||||
from canonicaljson import json
|
from synapse.api.errors import SynapseError
|
||||||
|
from synapse.storage.presence import UserPresenceState
|
||||||
import jsonschema
|
from synapse.types import RoomID, UserID
|
||||||
from jsonschema import FormatChecker
|
|
||||||
|
|
||||||
FILTER_SCHEMA = {
|
FILTER_SCHEMA = {
|
||||||
"additionalProperties": False,
|
"additionalProperties": False,
|
||||||
|
@ -15,8 +15,8 @@
|
|||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
|
|
||||||
"""Contains the URL paths to prefix various aspects of the server with. """
|
"""Contains the URL paths to prefix various aspects of the server with. """
|
||||||
from hashlib import sha256
|
|
||||||
import hmac
|
import hmac
|
||||||
|
from hashlib import sha256
|
||||||
|
|
||||||
from six.moves.urllib.parse import urlencode
|
from six.moves.urllib.parse import urlencode
|
||||||
|
|
||||||
|
@ -14,9 +14,11 @@
|
|||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
|
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
|
from synapse import python_dependencies # noqa: E402
|
||||||
|
|
||||||
sys.dont_write_bytecode = True
|
sys.dont_write_bytecode = True
|
||||||
|
|
||||||
from synapse import python_dependencies # noqa: E402
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
python_dependencies.check_requirements()
|
python_dependencies.check_requirements()
|
||||||
|
@ -17,15 +17,18 @@ import gc
|
|||||||
import logging
|
import logging
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
|
from daemonize import Daemonize
|
||||||
|
|
||||||
|
from twisted.internet import error, reactor
|
||||||
|
|
||||||
|
from synapse.util import PreserveLoggingContext
|
||||||
|
from synapse.util.rlimit import change_resource_limit
|
||||||
|
|
||||||
try:
|
try:
|
||||||
import affinity
|
import affinity
|
||||||
except Exception:
|
except Exception:
|
||||||
affinity = None
|
affinity = None
|
||||||
|
|
||||||
from daemonize import Daemonize
|
|
||||||
from synapse.util import PreserveLoggingContext
|
|
||||||
from synapse.util.rlimit import change_resource_limit
|
|
||||||
from twisted.internet import error, reactor
|
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
@ -16,6 +16,9 @@
|
|||||||
import logging
|
import logging
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
|
from twisted.internet import defer, reactor
|
||||||
|
from twisted.web.resource import NoResource
|
||||||
|
|
||||||
import synapse
|
import synapse
|
||||||
from synapse import events
|
from synapse import events
|
||||||
from synapse.app import _base
|
from synapse.app import _base
|
||||||
@ -36,8 +39,6 @@ from synapse.util.httpresourcetree import create_resource_tree
|
|||||||
from synapse.util.logcontext import LoggingContext, run_in_background
|
from synapse.util.logcontext import LoggingContext, run_in_background
|
||||||
from synapse.util.manhole import manhole
|
from synapse.util.manhole import manhole
|
||||||
from synapse.util.versionstring import get_version_string
|
from synapse.util.versionstring import get_version_string
|
||||||
from twisted.internet import reactor, defer
|
|
||||||
from twisted.web.resource import NoResource
|
|
||||||
|
|
||||||
logger = logging.getLogger("synapse.app.appservice")
|
logger = logging.getLogger("synapse.app.appservice")
|
||||||
|
|
||||||
|
@ -16,6 +16,9 @@
|
|||||||
import logging
|
import logging
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
|
from twisted.internet import reactor
|
||||||
|
from twisted.web.resource import NoResource
|
||||||
|
|
||||||
import synapse
|
import synapse
|
||||||
from synapse import events
|
from synapse import events
|
||||||
from synapse.app import _base
|
from synapse.app import _base
|
||||||
@ -44,8 +47,6 @@ from synapse.util.httpresourcetree import create_resource_tree
|
|||||||
from synapse.util.logcontext import LoggingContext
|
from synapse.util.logcontext import LoggingContext
|
||||||
from synapse.util.manhole import manhole
|
from synapse.util.manhole import manhole
|
||||||
from synapse.util.versionstring import get_version_string
|
from synapse.util.versionstring import get_version_string
|
||||||
from twisted.internet import reactor
|
|
||||||
from twisted.web.resource import NoResource
|
|
||||||
|
|
||||||
logger = logging.getLogger("synapse.app.client_reader")
|
logger = logging.getLogger("synapse.app.client_reader")
|
||||||
|
|
||||||
|
@ -16,6 +16,9 @@
|
|||||||
import logging
|
import logging
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
|
from twisted.internet import reactor
|
||||||
|
from twisted.web.resource import NoResource
|
||||||
|
|
||||||
import synapse
|
import synapse
|
||||||
from synapse import events
|
from synapse import events
|
||||||
from synapse.app import _base
|
from synapse.app import _base
|
||||||
@ -43,8 +46,10 @@ from synapse.replication.slave.storage.room import RoomStore
|
|||||||
from synapse.replication.slave.storage.transactions import TransactionStore
|
from synapse.replication.slave.storage.transactions import TransactionStore
|
||||||
from synapse.replication.tcp.client import ReplicationClientHandler
|
from synapse.replication.tcp.client import ReplicationClientHandler
|
||||||
from synapse.rest.client.v1.room import (
|
from synapse.rest.client.v1.room import (
|
||||||
RoomSendEventRestServlet, RoomMembershipRestServlet, RoomStateEventRestServlet,
|
|
||||||
JoinRoomAliasServlet,
|
JoinRoomAliasServlet,
|
||||||
|
RoomMembershipRestServlet,
|
||||||
|
RoomSendEventRestServlet,
|
||||||
|
RoomStateEventRestServlet,
|
||||||
)
|
)
|
||||||
from synapse.server import HomeServer
|
from synapse.server import HomeServer
|
||||||
from synapse.storage.engines import create_engine
|
from synapse.storage.engines import create_engine
|
||||||
@ -52,8 +57,6 @@ from synapse.util.httpresourcetree import create_resource_tree
|
|||||||
from synapse.util.logcontext import LoggingContext
|
from synapse.util.logcontext import LoggingContext
|
||||||
from synapse.util.manhole import manhole
|
from synapse.util.manhole import manhole
|
||||||
from synapse.util.versionstring import get_version_string
|
from synapse.util.versionstring import get_version_string
|
||||||
from twisted.internet import reactor
|
|
||||||
from twisted.web.resource import NoResource
|
|
||||||
|
|
||||||
logger = logging.getLogger("synapse.app.event_creator")
|
logger = logging.getLogger("synapse.app.event_creator")
|
||||||
|
|
||||||
|
@ -16,6 +16,9 @@
|
|||||||
import logging
|
import logging
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
|
from twisted.internet import reactor
|
||||||
|
from twisted.web.resource import NoResource
|
||||||
|
|
||||||
import synapse
|
import synapse
|
||||||
from synapse import events
|
from synapse import events
|
||||||
from synapse.api.urls import FEDERATION_PREFIX
|
from synapse.api.urls import FEDERATION_PREFIX
|
||||||
@ -41,8 +44,6 @@ from synapse.util.httpresourcetree import create_resource_tree
|
|||||||
from synapse.util.logcontext import LoggingContext
|
from synapse.util.logcontext import LoggingContext
|
||||||
from synapse.util.manhole import manhole
|
from synapse.util.manhole import manhole
|
||||||
from synapse.util.versionstring import get_version_string
|
from synapse.util.versionstring import get_version_string
|
||||||
from twisted.internet import reactor
|
|
||||||
from twisted.web.resource import NoResource
|
|
||||||
|
|
||||||
logger = logging.getLogger("synapse.app.federation_reader")
|
logger = logging.getLogger("synapse.app.federation_reader")
|
||||||
|
|
||||||
|
@ -16,6 +16,9 @@
|
|||||||
import logging
|
import logging
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
|
from twisted.internet import defer, reactor
|
||||||
|
from twisted.web.resource import NoResource
|
||||||
|
|
||||||
import synapse
|
import synapse
|
||||||
from synapse import events
|
from synapse import events
|
||||||
from synapse.app import _base
|
from synapse.app import _base
|
||||||
@ -42,8 +45,6 @@ from synapse.util.httpresourcetree import create_resource_tree
|
|||||||
from synapse.util.logcontext import LoggingContext, run_in_background
|
from synapse.util.logcontext import LoggingContext, run_in_background
|
||||||
from synapse.util.manhole import manhole
|
from synapse.util.manhole import manhole
|
||||||
from synapse.util.versionstring import get_version_string
|
from synapse.util.versionstring import get_version_string
|
||||||
from twisted.internet import defer, reactor
|
|
||||||
from twisted.web.resource import NoResource
|
|
||||||
|
|
||||||
logger = logging.getLogger("synapse.app.federation_sender")
|
logger = logging.getLogger("synapse.app.federation_sender")
|
||||||
|
|
||||||
|
@ -16,6 +16,9 @@
|
|||||||
import logging
|
import logging
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
|
from twisted.internet import defer, reactor
|
||||||
|
from twisted.web.resource import NoResource
|
||||||
|
|
||||||
import synapse
|
import synapse
|
||||||
from synapse import events
|
from synapse import events
|
||||||
from synapse.api.errors import SynapseError
|
from synapse.api.errors import SynapseError
|
||||||
@ -25,9 +28,7 @@ from synapse.config.homeserver import HomeServerConfig
|
|||||||
from synapse.config.logger import setup_logging
|
from synapse.config.logger import setup_logging
|
||||||
from synapse.crypto import context_factory
|
from synapse.crypto import context_factory
|
||||||
from synapse.http.server import JsonResource
|
from synapse.http.server import JsonResource
|
||||||
from synapse.http.servlet import (
|
from synapse.http.servlet import RestServlet, parse_json_object_from_request
|
||||||
RestServlet, parse_json_object_from_request,
|
|
||||||
)
|
|
||||||
from synapse.http.site import SynapseSite
|
from synapse.http.site import SynapseSite
|
||||||
from synapse.metrics import RegistryProxy
|
from synapse.metrics import RegistryProxy
|
||||||
from synapse.metrics.resource import METRICS_PREFIX, MetricsResource
|
from synapse.metrics.resource import METRICS_PREFIX, MetricsResource
|
||||||
@ -44,8 +45,6 @@ from synapse.util.httpresourcetree import create_resource_tree
|
|||||||
from synapse.util.logcontext import LoggingContext
|
from synapse.util.logcontext import LoggingContext
|
||||||
from synapse.util.manhole import manhole
|
from synapse.util.manhole import manhole
|
||||||
from synapse.util.versionstring import get_version_string
|
from synapse.util.versionstring import get_version_string
|
||||||
from twisted.internet import defer, reactor
|
|
||||||
from twisted.web.resource import NoResource
|
|
||||||
|
|
||||||
logger = logging.getLogger("synapse.app.frontend_proxy")
|
logger = logging.getLogger("synapse.app.frontend_proxy")
|
||||||
|
|
||||||
|
@ -18,27 +18,39 @@ import logging
|
|||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
|
from twisted.application import service
|
||||||
|
from twisted.internet import defer, reactor
|
||||||
|
from twisted.web.resource import EncodingResourceWrapper, NoResource
|
||||||
|
from twisted.web.server import GzipEncoderFactory
|
||||||
|
from twisted.web.static import File
|
||||||
|
|
||||||
import synapse
|
import synapse
|
||||||
import synapse.config.logger
|
import synapse.config.logger
|
||||||
from synapse import events
|
from synapse import events
|
||||||
from synapse.api.urls import CONTENT_REPO_PREFIX, FEDERATION_PREFIX, \
|
from synapse.api.urls import (
|
||||||
LEGACY_MEDIA_PREFIX, MEDIA_PREFIX, SERVER_KEY_PREFIX, SERVER_KEY_V2_PREFIX, \
|
CONTENT_REPO_PREFIX,
|
||||||
STATIC_PREFIX, WEB_CLIENT_PREFIX
|
FEDERATION_PREFIX,
|
||||||
|
LEGACY_MEDIA_PREFIX,
|
||||||
|
MEDIA_PREFIX,
|
||||||
|
SERVER_KEY_PREFIX,
|
||||||
|
SERVER_KEY_V2_PREFIX,
|
||||||
|
STATIC_PREFIX,
|
||||||
|
WEB_CLIENT_PREFIX,
|
||||||
|
)
|
||||||
from synapse.app import _base
|
from synapse.app import _base
|
||||||
from synapse.app._base import quit_with_error, listen_ssl, listen_tcp
|
from synapse.app._base import listen_ssl, listen_tcp, quit_with_error
|
||||||
from synapse.config._base import ConfigError
|
from synapse.config._base import ConfigError
|
||||||
from synapse.config.homeserver import HomeServerConfig
|
from synapse.config.homeserver import HomeServerConfig
|
||||||
from synapse.crypto import context_factory
|
from synapse.crypto import context_factory
|
||||||
from synapse.federation.transport.server import TransportLayerServer
|
from synapse.federation.transport.server import TransportLayerServer
|
||||||
from synapse.module_api import ModuleApi
|
|
||||||
from synapse.http.additional_resource import AdditionalResource
|
from synapse.http.additional_resource import AdditionalResource
|
||||||
from synapse.http.server import RootRedirect
|
from synapse.http.server import RootRedirect
|
||||||
from synapse.http.site import SynapseSite
|
from synapse.http.site import SynapseSite
|
||||||
from synapse.metrics import RegistryProxy
|
from synapse.metrics import RegistryProxy
|
||||||
from synapse.metrics.resource import METRICS_PREFIX, MetricsResource
|
from synapse.metrics.resource import METRICS_PREFIX, MetricsResource
|
||||||
from synapse.python_dependencies import CONDITIONAL_REQUIREMENTS, \
|
from synapse.module_api import ModuleApi
|
||||||
check_requirements
|
from synapse.python_dependencies import CONDITIONAL_REQUIREMENTS, check_requirements
|
||||||
from synapse.replication.http import ReplicationRestResource, REPLICATION_PREFIX
|
from synapse.replication.http import REPLICATION_PREFIX, ReplicationRestResource
|
||||||
from synapse.replication.tcp.resource import ReplicationStreamProtocolFactory
|
from synapse.replication.tcp.resource import ReplicationStreamProtocolFactory
|
||||||
from synapse.rest import ClientRestResource
|
from synapse.rest import ClientRestResource
|
||||||
from synapse.rest.key.v1.server_key_resource import LocalKey
|
from synapse.rest.key.v1.server_key_resource import LocalKey
|
||||||
@ -55,11 +67,6 @@ from synapse.util.manhole import manhole
|
|||||||
from synapse.util.module_loader import load_module
|
from synapse.util.module_loader import load_module
|
||||||
from synapse.util.rlimit import change_resource_limit
|
from synapse.util.rlimit import change_resource_limit
|
||||||
from synapse.util.versionstring import get_version_string
|
from synapse.util.versionstring import get_version_string
|
||||||
from twisted.application import service
|
|
||||||
from twisted.internet import defer, reactor
|
|
||||||
from twisted.web.resource import EncodingResourceWrapper, NoResource
|
|
||||||
from twisted.web.server import GzipEncoderFactory
|
|
||||||
from twisted.web.static import File
|
|
||||||
|
|
||||||
logger = logging.getLogger("synapse.app.homeserver")
|
logger = logging.getLogger("synapse.app.homeserver")
|
||||||
|
|
||||||
|
@ -16,11 +16,12 @@
|
|||||||
import logging
|
import logging
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
|
from twisted.internet import reactor
|
||||||
|
from twisted.web.resource import NoResource
|
||||||
|
|
||||||
import synapse
|
import synapse
|
||||||
from synapse import events
|
from synapse import events
|
||||||
from synapse.api.urls import (
|
from synapse.api.urls import CONTENT_REPO_PREFIX, LEGACY_MEDIA_PREFIX, MEDIA_PREFIX
|
||||||
CONTENT_REPO_PREFIX, LEGACY_MEDIA_PREFIX, MEDIA_PREFIX
|
|
||||||
)
|
|
||||||
from synapse.app import _base
|
from synapse.app import _base
|
||||||
from synapse.config._base import ConfigError
|
from synapse.config._base import ConfigError
|
||||||
from synapse.config.homeserver import HomeServerConfig
|
from synapse.config.homeserver import HomeServerConfig
|
||||||
@ -43,8 +44,6 @@ from synapse.util.httpresourcetree import create_resource_tree
|
|||||||
from synapse.util.logcontext import LoggingContext
|
from synapse.util.logcontext import LoggingContext
|
||||||
from synapse.util.manhole import manhole
|
from synapse.util.manhole import manhole
|
||||||
from synapse.util.versionstring import get_version_string
|
from synapse.util.versionstring import get_version_string
|
||||||
from twisted.internet import reactor
|
|
||||||
from twisted.web.resource import NoResource
|
|
||||||
|
|
||||||
logger = logging.getLogger("synapse.app.media_repository")
|
logger = logging.getLogger("synapse.app.media_repository")
|
||||||
|
|
||||||
|
@ -16,6 +16,9 @@
|
|||||||
import logging
|
import logging
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
|
from twisted.internet import defer, reactor
|
||||||
|
from twisted.web.resource import NoResource
|
||||||
|
|
||||||
import synapse
|
import synapse
|
||||||
from synapse import events
|
from synapse import events
|
||||||
from synapse.app import _base
|
from synapse.app import _base
|
||||||
@ -37,8 +40,6 @@ from synapse.util.httpresourcetree import create_resource_tree
|
|||||||
from synapse.util.logcontext import LoggingContext, run_in_background
|
from synapse.util.logcontext import LoggingContext, run_in_background
|
||||||
from synapse.util.manhole import manhole
|
from synapse.util.manhole import manhole
|
||||||
from synapse.util.versionstring import get_version_string
|
from synapse.util.versionstring import get_version_string
|
||||||
from twisted.internet import defer, reactor
|
|
||||||
from twisted.web.resource import NoResource
|
|
||||||
|
|
||||||
logger = logging.getLogger("synapse.app.pusher")
|
logger = logging.getLogger("synapse.app.pusher")
|
||||||
|
|
||||||
|
@ -17,6 +17,11 @@ import contextlib
|
|||||||
import logging
|
import logging
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
|
from six import iteritems
|
||||||
|
|
||||||
|
from twisted.internet import defer, reactor
|
||||||
|
from twisted.web.resource import NoResource
|
||||||
|
|
||||||
import synapse
|
import synapse
|
||||||
from synapse.api.constants import EventTypes
|
from synapse.api.constants import EventTypes
|
||||||
from synapse.app import _base
|
from synapse.app import _base
|
||||||
@ -36,12 +41,12 @@ from synapse.replication.slave.storage.deviceinbox import SlavedDeviceInboxStore
|
|||||||
from synapse.replication.slave.storage.devices import SlavedDeviceStore
|
from synapse.replication.slave.storage.devices import SlavedDeviceStore
|
||||||
from synapse.replication.slave.storage.events import SlavedEventStore
|
from synapse.replication.slave.storage.events import SlavedEventStore
|
||||||
from synapse.replication.slave.storage.filtering import SlavedFilteringStore
|
from synapse.replication.slave.storage.filtering import SlavedFilteringStore
|
||||||
|
from synapse.replication.slave.storage.groups import SlavedGroupServerStore
|
||||||
from synapse.replication.slave.storage.presence import SlavedPresenceStore
|
from synapse.replication.slave.storage.presence import SlavedPresenceStore
|
||||||
from synapse.replication.slave.storage.push_rule import SlavedPushRuleStore
|
from synapse.replication.slave.storage.push_rule import SlavedPushRuleStore
|
||||||
from synapse.replication.slave.storage.receipts import SlavedReceiptsStore
|
from synapse.replication.slave.storage.receipts import SlavedReceiptsStore
|
||||||
from synapse.replication.slave.storage.registration import SlavedRegistrationStore
|
from synapse.replication.slave.storage.registration import SlavedRegistrationStore
|
||||||
from synapse.replication.slave.storage.room import RoomStore
|
from synapse.replication.slave.storage.room import RoomStore
|
||||||
from synapse.replication.slave.storage.groups import SlavedGroupServerStore
|
|
||||||
from synapse.replication.tcp.client import ReplicationClientHandler
|
from synapse.replication.tcp.client import ReplicationClientHandler
|
||||||
from synapse.rest.client.v1 import events
|
from synapse.rest.client.v1 import events
|
||||||
from synapse.rest.client.v1.initial_sync import InitialSyncRestServlet
|
from synapse.rest.client.v1.initial_sync import InitialSyncRestServlet
|
||||||
@ -56,10 +61,6 @@ from synapse.util.logcontext import LoggingContext, run_in_background
|
|||||||
from synapse.util.manhole import manhole
|
from synapse.util.manhole import manhole
|
||||||
from synapse.util.stringutils import random_string
|
from synapse.util.stringutils import random_string
|
||||||
from synapse.util.versionstring import get_version_string
|
from synapse.util.versionstring import get_version_string
|
||||||
from twisted.internet import defer, reactor
|
|
||||||
from twisted.web.resource import NoResource
|
|
||||||
|
|
||||||
from six import iteritems
|
|
||||||
|
|
||||||
logger = logging.getLogger("synapse.app.synchrotron")
|
logger = logging.getLogger("synapse.app.synchrotron")
|
||||||
|
|
||||||
|
@ -16,16 +16,17 @@
|
|||||||
|
|
||||||
import argparse
|
import argparse
|
||||||
import collections
|
import collections
|
||||||
|
import errno
|
||||||
import glob
|
import glob
|
||||||
import os
|
import os
|
||||||
import os.path
|
import os.path
|
||||||
import signal
|
import signal
|
||||||
import subprocess
|
import subprocess
|
||||||
import sys
|
import sys
|
||||||
import yaml
|
|
||||||
import errno
|
|
||||||
import time
|
import time
|
||||||
|
|
||||||
|
import yaml
|
||||||
|
|
||||||
SYNAPSE = [sys.executable, "-B", "-m", "synapse.app.homeserver"]
|
SYNAPSE = [sys.executable, "-B", "-m", "synapse.app.homeserver"]
|
||||||
|
|
||||||
GREEN = "\x1b[1;32m"
|
GREEN = "\x1b[1;32m"
|
||||||
|
@ -17,6 +17,9 @@
|
|||||||
import logging
|
import logging
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
|
from twisted.internet import defer, reactor
|
||||||
|
from twisted.web.resource import NoResource
|
||||||
|
|
||||||
import synapse
|
import synapse
|
||||||
from synapse import events
|
from synapse import events
|
||||||
from synapse.app import _base
|
from synapse.app import _base
|
||||||
@ -43,8 +46,6 @@ from synapse.util.httpresourcetree import create_resource_tree
|
|||||||
from synapse.util.logcontext import LoggingContext, run_in_background
|
from synapse.util.logcontext import LoggingContext, run_in_background
|
||||||
from synapse.util.manhole import manhole
|
from synapse.util.manhole import manhole
|
||||||
from synapse.util.versionstring import get_version_string
|
from synapse.util.versionstring import get_version_string
|
||||||
from twisted.internet import reactor, defer
|
|
||||||
from twisted.web.resource import NoResource
|
|
||||||
|
|
||||||
logger = logging.getLogger("synapse.app.user_dir")
|
logger = logging.getLogger("synapse.app.user_dir")
|
||||||
|
|
||||||
|
@ -12,17 +12,17 @@
|
|||||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
from synapse.api.constants import EventTypes
|
|
||||||
from synapse.util.caches.descriptors import cachedInlineCallbacks
|
|
||||||
from synapse.types import GroupID, get_domain_from_id
|
|
||||||
|
|
||||||
from twisted.internet import defer
|
|
||||||
|
|
||||||
import logging
|
import logging
|
||||||
import re
|
import re
|
||||||
|
|
||||||
from six import string_types
|
from six import string_types
|
||||||
|
|
||||||
|
from twisted.internet import defer
|
||||||
|
|
||||||
|
from synapse.api.constants import EventTypes
|
||||||
|
from synapse.types import GroupID, get_domain_from_id
|
||||||
|
from synapse.util.caches.descriptors import cachedInlineCallbacks
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
|
@ -12,20 +12,20 @@
|
|||||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
from twisted.internet import defer
|
|
||||||
|
|
||||||
from synapse.api.constants import ThirdPartyEntityKind
|
|
||||||
from synapse.api.errors import CodeMessageException
|
|
||||||
from synapse.http.client import SimpleHttpClient
|
|
||||||
from synapse.events.utils import serialize_event
|
|
||||||
from synapse.util.caches.response_cache import ResponseCache
|
|
||||||
from synapse.types import ThirdPartyInstanceID
|
|
||||||
|
|
||||||
import logging
|
import logging
|
||||||
import urllib
|
import urllib
|
||||||
|
|
||||||
from prometheus_client import Counter
|
from prometheus_client import Counter
|
||||||
|
|
||||||
|
from twisted.internet import defer
|
||||||
|
|
||||||
|
from synapse.api.constants import ThirdPartyEntityKind
|
||||||
|
from synapse.api.errors import CodeMessageException
|
||||||
|
from synapse.events.utils import serialize_event
|
||||||
|
from synapse.http.client import SimpleHttpClient
|
||||||
|
from synapse.types import ThirdPartyInstanceID
|
||||||
|
from synapse.util.caches.response_cache import ResponseCache
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
sent_transactions_counter = Counter(
|
sent_transactions_counter = Counter(
|
||||||
|
@ -48,14 +48,14 @@ UP & quit +---------- YES SUCCESS
|
|||||||
This is all tied together by the AppServiceScheduler which DIs the required
|
This is all tied together by the AppServiceScheduler which DIs the required
|
||||||
components.
|
components.
|
||||||
"""
|
"""
|
||||||
|
import logging
|
||||||
|
|
||||||
from twisted.internet import defer
|
from twisted.internet import defer
|
||||||
|
|
||||||
from synapse.appservice import ApplicationServiceState
|
from synapse.appservice import ApplicationServiceState
|
||||||
from synapse.util.logcontext import run_in_background
|
from synapse.util.logcontext import run_in_background
|
||||||
from synapse.util.metrics import Measure
|
from synapse.util.metrics import Measure
|
||||||
|
|
||||||
import logging
|
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
|
@ -16,11 +16,12 @@
|
|||||||
import argparse
|
import argparse
|
||||||
import errno
|
import errno
|
||||||
import os
|
import os
|
||||||
import yaml
|
|
||||||
from textwrap import dedent
|
from textwrap import dedent
|
||||||
|
|
||||||
from six import integer_types
|
from six import integer_types
|
||||||
|
|
||||||
|
import yaml
|
||||||
|
|
||||||
|
|
||||||
class ConfigError(Exception):
|
class ConfigError(Exception):
|
||||||
pass
|
pass
|
||||||
|
@ -12,10 +12,10 @@
|
|||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
|
|
||||||
from ._base import Config
|
|
||||||
|
|
||||||
from synapse.api.constants import EventTypes
|
from synapse.api.constants import EventTypes
|
||||||
|
|
||||||
|
from ._base import Config
|
||||||
|
|
||||||
|
|
||||||
class ApiConfig(Config):
|
class ApiConfig(Config):
|
||||||
|
|
||||||
|
@ -12,19 +12,19 @@
|
|||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
|
|
||||||
from ._base import Config, ConfigError
|
|
||||||
|
|
||||||
from synapse.appservice import ApplicationService
|
|
||||||
from synapse.types import UserID
|
|
||||||
|
|
||||||
from netaddr import IPSet
|
|
||||||
|
|
||||||
import yaml
|
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
from six import string_types
|
from six import string_types
|
||||||
from six.moves.urllib import parse as urlparse
|
from six.moves.urllib import parse as urlparse
|
||||||
|
|
||||||
|
import yaml
|
||||||
|
from netaddr import IPSet
|
||||||
|
|
||||||
|
from synapse.appservice import ApplicationService
|
||||||
|
from synapse.types import UserID
|
||||||
|
|
||||||
|
from ._base import Config, ConfigError
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
|
@ -13,32 +13,32 @@
|
|||||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
from .tls import TlsConfig
|
|
||||||
from .server import ServerConfig
|
|
||||||
from .logger import LoggingConfig
|
|
||||||
from .database import DatabaseConfig
|
|
||||||
from .ratelimiting import RatelimitConfig
|
|
||||||
from .repository import ContentRepositoryConfig
|
|
||||||
from .captcha import CaptchaConfig
|
|
||||||
from .voip import VoipConfig
|
|
||||||
from .registration import RegistrationConfig
|
|
||||||
from .metrics import MetricsConfig
|
|
||||||
from .api import ApiConfig
|
from .api import ApiConfig
|
||||||
from .appservice import AppServiceConfig
|
from .appservice import AppServiceConfig
|
||||||
from .key import KeyConfig
|
from .captcha import CaptchaConfig
|
||||||
from .saml2 import SAML2Config
|
|
||||||
from .cas import CasConfig
|
from .cas import CasConfig
|
||||||
from .password import PasswordConfig
|
|
||||||
from .jwt import JWTConfig
|
|
||||||
from .password_auth_providers import PasswordAuthProviderConfig
|
|
||||||
from .emailconfig import EmailConfig
|
|
||||||
from .workers import WorkerConfig
|
|
||||||
from .push import PushConfig
|
|
||||||
from .spam_checker import SpamCheckerConfig
|
|
||||||
from .groups import GroupsConfig
|
|
||||||
from .user_directory import UserDirectoryConfig
|
|
||||||
from .consent_config import ConsentConfig
|
from .consent_config import ConsentConfig
|
||||||
|
from .database import DatabaseConfig
|
||||||
|
from .emailconfig import EmailConfig
|
||||||
|
from .groups import GroupsConfig
|
||||||
|
from .jwt import JWTConfig
|
||||||
|
from .key import KeyConfig
|
||||||
|
from .logger import LoggingConfig
|
||||||
|
from .metrics import MetricsConfig
|
||||||
|
from .password import PasswordConfig
|
||||||
|
from .password_auth_providers import PasswordAuthProviderConfig
|
||||||
|
from .push import PushConfig
|
||||||
|
from .ratelimiting import RatelimitConfig
|
||||||
|
from .registration import RegistrationConfig
|
||||||
|
from .repository import ContentRepositoryConfig
|
||||||
|
from .saml2 import SAML2Config
|
||||||
|
from .server import ServerConfig
|
||||||
from .server_notices_config import ServerNoticesConfig
|
from .server_notices_config import ServerNoticesConfig
|
||||||
|
from .spam_checker import SpamCheckerConfig
|
||||||
|
from .tls import TlsConfig
|
||||||
|
from .user_directory import UserDirectoryConfig
|
||||||
|
from .voip import VoipConfig
|
||||||
|
from .workers import WorkerConfig
|
||||||
|
|
||||||
|
|
||||||
class HomeServerConfig(TlsConfig, ServerConfig, DatabaseConfig, LoggingConfig,
|
class HomeServerConfig(TlsConfig, ServerConfig, DatabaseConfig, LoggingConfig,
|
||||||
|
@ -15,7 +15,6 @@
|
|||||||
|
|
||||||
from ._base import Config, ConfigError
|
from ._base import Config, ConfigError
|
||||||
|
|
||||||
|
|
||||||
MISSING_JWT = (
|
MISSING_JWT = (
|
||||||
"""Missing jwt library. This is required for jwt login.
|
"""Missing jwt library. This is required for jwt login.
|
||||||
|
|
||||||
|
@ -13,21 +13,24 @@
|
|||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
|
|
||||||
from ._base import Config, ConfigError
|
|
||||||
|
|
||||||
from synapse.util.stringutils import random_string
|
|
||||||
from signedjson.key import (
|
|
||||||
generate_signing_key, is_signing_algorithm_supported,
|
|
||||||
decode_signing_key_base64, decode_verify_key_bytes,
|
|
||||||
read_signing_keys, write_signing_keys, NACL_ED25519
|
|
||||||
)
|
|
||||||
from unpaddedbase64 import decode_base64
|
|
||||||
from synapse.util.stringutils import random_string_with_symbols
|
|
||||||
|
|
||||||
import os
|
|
||||||
import hashlib
|
import hashlib
|
||||||
import logging
|
import logging
|
||||||
|
import os
|
||||||
|
|
||||||
|
from signedjson.key import (
|
||||||
|
NACL_ED25519,
|
||||||
|
decode_signing_key_base64,
|
||||||
|
decode_verify_key_bytes,
|
||||||
|
generate_signing_key,
|
||||||
|
is_signing_algorithm_supported,
|
||||||
|
read_signing_keys,
|
||||||
|
write_signing_keys,
|
||||||
|
)
|
||||||
|
from unpaddedbase64 import decode_base64
|
||||||
|
|
||||||
|
from synapse.util.stringutils import random_string, random_string_with_symbols
|
||||||
|
|
||||||
|
from ._base import Config, ConfigError
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
@ -16,15 +16,17 @@ import logging
|
|||||||
import logging.config
|
import logging.config
|
||||||
import os
|
import os
|
||||||
import signal
|
import signal
|
||||||
from string import Template
|
|
||||||
import sys
|
import sys
|
||||||
|
from string import Template
|
||||||
|
|
||||||
|
import yaml
|
||||||
|
|
||||||
from twisted.logger import STDLibLogObserver, globalLogBeginner
|
from twisted.logger import STDLibLogObserver, globalLogBeginner
|
||||||
import yaml
|
|
||||||
|
|
||||||
import synapse
|
import synapse
|
||||||
from synapse.util.logcontext import LoggingContextFilter
|
from synapse.util.logcontext import LoggingContextFilter
|
||||||
from synapse.util.versionstring import get_version_string
|
from synapse.util.versionstring import get_version_string
|
||||||
|
|
||||||
from ._base import Config
|
from ._base import Config
|
||||||
|
|
||||||
DEFAULT_LOG_CONFIG = Template("""
|
DEFAULT_LOG_CONFIG = Template("""
|
||||||
|
@ -13,10 +13,10 @@
|
|||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
|
|
||||||
from ._base import Config
|
|
||||||
|
|
||||||
from synapse.util.module_loader import load_module
|
from synapse.util.module_loader import load_module
|
||||||
|
|
||||||
|
from ._base import Config
|
||||||
|
|
||||||
LDAP_PROVIDER = 'ldap_auth_provider.LdapAuthProvider'
|
LDAP_PROVIDER = 'ldap_auth_provider.LdapAuthProvider'
|
||||||
|
|
||||||
|
|
||||||
|
@ -13,11 +13,11 @@
|
|||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
|
|
||||||
from ._base import Config
|
from distutils.util import strtobool
|
||||||
|
|
||||||
from synapse.util.stringutils import random_string_with_symbols
|
from synapse.util.stringutils import random_string_with_symbols
|
||||||
|
|
||||||
from distutils.util import strtobool
|
from ._base import Config
|
||||||
|
|
||||||
|
|
||||||
class RegistrationConfig(Config):
|
class RegistrationConfig(Config):
|
||||||
|
@ -13,11 +13,11 @@
|
|||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
|
|
||||||
from ._base import Config, ConfigError
|
|
||||||
from collections import namedtuple
|
from collections import namedtuple
|
||||||
|
|
||||||
from synapse.util.module_loader import load_module
|
from synapse.util.module_loader import load_module
|
||||||
|
|
||||||
|
from ._base import Config, ConfigError
|
||||||
|
|
||||||
MISSING_NETADDR = (
|
MISSING_NETADDR = (
|
||||||
"Missing netaddr library. This is required for URL preview API."
|
"Missing netaddr library. This is required for URL preview API."
|
||||||
|
@ -17,6 +17,7 @@
|
|||||||
import logging
|
import logging
|
||||||
|
|
||||||
from synapse.http.endpoint import parse_and_validate_server_name
|
from synapse.http.endpoint import parse_and_validate_server_name
|
||||||
|
|
||||||
from ._base import Config, ConfigError
|
from ._base import Config, ConfigError
|
||||||
|
|
||||||
logger = logging.Logger(__name__)
|
logger = logging.Logger(__name__)
|
||||||
|
@ -12,9 +12,10 @@
|
|||||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
from ._base import Config
|
|
||||||
from synapse.types import UserID
|
from synapse.types import UserID
|
||||||
|
|
||||||
|
from ._base import Config
|
||||||
|
|
||||||
DEFAULT_CONFIG = """\
|
DEFAULT_CONFIG = """\
|
||||||
# Server Notices room configuration
|
# Server Notices room configuration
|
||||||
#
|
#
|
||||||
|
@ -13,14 +13,15 @@
|
|||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
|
|
||||||
from ._base import Config
|
import os
|
||||||
|
import subprocess
|
||||||
|
from hashlib import sha256
|
||||||
|
|
||||||
|
from unpaddedbase64 import encode_base64
|
||||||
|
|
||||||
from OpenSSL import crypto
|
from OpenSSL import crypto
|
||||||
import subprocess
|
|
||||||
import os
|
|
||||||
|
|
||||||
from hashlib import sha256
|
from ._base import Config
|
||||||
from unpaddedbase64 import encode_base64
|
|
||||||
|
|
||||||
GENERATE_DH_PARAMS = False
|
GENERATE_DH_PARAMS = False
|
||||||
|
|
||||||
|
@ -12,12 +12,12 @@
|
|||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
|
|
||||||
from twisted.internet import ssl
|
|
||||||
from OpenSSL import SSL, crypto
|
|
||||||
from twisted.internet._sslverify import _defaultCurveName
|
|
||||||
|
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
|
from OpenSSL import SSL, crypto
|
||||||
|
from twisted.internet import ssl
|
||||||
|
from twisted.internet._sslverify import _defaultCurveName
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
|
@ -15,16 +15,16 @@
|
|||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
|
|
||||||
|
|
||||||
from synapse.api.errors import SynapseError, Codes
|
|
||||||
from synapse.events.utils import prune_event
|
|
||||||
|
|
||||||
from canonicaljson import encode_canonical_json
|
|
||||||
from unpaddedbase64 import encode_base64, decode_base64
|
|
||||||
from signedjson.sign import sign_json
|
|
||||||
|
|
||||||
import hashlib
|
import hashlib
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
|
from canonicaljson import encode_canonical_json
|
||||||
|
from signedjson.sign import sign_json
|
||||||
|
from unpaddedbase64 import decode_base64, encode_base64
|
||||||
|
|
||||||
|
from synapse.api.errors import Codes, SynapseError
|
||||||
|
from synapse.events.utils import prune_event
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
|
@ -13,14 +13,16 @@
|
|||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
|
|
||||||
from synapse.util import logcontext
|
|
||||||
from twisted.web.http import HTTPClient
|
|
||||||
from twisted.internet.protocol import Factory
|
|
||||||
from twisted.internet import defer, reactor
|
|
||||||
from synapse.http.endpoint import matrix_federation_endpoint
|
|
||||||
from canonicaljson import json
|
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
|
from canonicaljson import json
|
||||||
|
|
||||||
|
from twisted.internet import defer, reactor
|
||||||
|
from twisted.internet.protocol import Factory
|
||||||
|
from twisted.web.http import HTTPClient
|
||||||
|
|
||||||
|
from synapse.http.endpoint import matrix_federation_endpoint
|
||||||
|
from synapse.util import logcontext
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
@ -14,9 +14,31 @@
|
|||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
|
|
||||||
|
import hashlib
|
||||||
|
import logging
|
||||||
|
import urllib
|
||||||
|
from collections import namedtuple
|
||||||
|
|
||||||
|
from signedjson.key import (
|
||||||
|
decode_verify_key_bytes,
|
||||||
|
encode_verify_key_base64,
|
||||||
|
is_signing_algorithm_supported,
|
||||||
|
)
|
||||||
|
from signedjson.sign import (
|
||||||
|
SignatureVerifyException,
|
||||||
|
encode_canonical_json,
|
||||||
|
sign_json,
|
||||||
|
signature_ids,
|
||||||
|
verify_signed_json,
|
||||||
|
)
|
||||||
|
from unpaddedbase64 import decode_base64, encode_base64
|
||||||
|
|
||||||
|
from OpenSSL import crypto
|
||||||
|
from twisted.internet import defer
|
||||||
|
|
||||||
|
from synapse.api.errors import Codes, SynapseError
|
||||||
from synapse.crypto.keyclient import fetch_server_key
|
from synapse.crypto.keyclient import fetch_server_key
|
||||||
from synapse.api.errors import SynapseError, Codes
|
from synapse.util import logcontext, unwrapFirstError
|
||||||
from synapse.util import unwrapFirstError, logcontext
|
|
||||||
from synapse.util.logcontext import (
|
from synapse.util.logcontext import (
|
||||||
PreserveLoggingContext,
|
PreserveLoggingContext,
|
||||||
preserve_fn,
|
preserve_fn,
|
||||||
@ -24,26 +46,6 @@ from synapse.util.logcontext import (
|
|||||||
)
|
)
|
||||||
from synapse.util.metrics import Measure
|
from synapse.util.metrics import Measure
|
||||||
|
|
||||||
from twisted.internet import defer
|
|
||||||
|
|
||||||
from signedjson.sign import (
|
|
||||||
verify_signed_json, signature_ids, sign_json, encode_canonical_json,
|
|
||||||
SignatureVerifyException,
|
|
||||||
)
|
|
||||||
from signedjson.key import (
|
|
||||||
is_signing_algorithm_supported, decode_verify_key_bytes,
|
|
||||||
encode_verify_key_base64,
|
|
||||||
)
|
|
||||||
from unpaddedbase64 import decode_base64, encode_base64
|
|
||||||
|
|
||||||
from OpenSSL import crypto
|
|
||||||
|
|
||||||
from collections import namedtuple
|
|
||||||
import urllib
|
|
||||||
import hashlib
|
|
||||||
import logging
|
|
||||||
|
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
|
@ -17,11 +17,11 @@ import logging
|
|||||||
|
|
||||||
from canonicaljson import encode_canonical_json
|
from canonicaljson import encode_canonical_json
|
||||||
from signedjson.key import decode_verify_key_bytes
|
from signedjson.key import decode_verify_key_bytes
|
||||||
from signedjson.sign import verify_signed_json, SignatureVerifyException
|
from signedjson.sign import SignatureVerifyException, verify_signed_json
|
||||||
from unpaddedbase64 import decode_base64
|
from unpaddedbase64 import decode_base64
|
||||||
|
|
||||||
from synapse.api.constants import EventTypes, Membership, JoinRules
|
from synapse.api.constants import EventTypes, JoinRules, Membership
|
||||||
from synapse.api.errors import AuthError, SynapseError, EventSizeError
|
from synapse.api.errors import AuthError, EventSizeError, SynapseError
|
||||||
from synapse.types import UserID, get_domain_from_id
|
from synapse.types import UserID, get_domain_from_id
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
@ -13,9 +13,8 @@
|
|||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
|
|
||||||
from synapse.util.frozenutils import freeze
|
|
||||||
from synapse.util.caches import intern_dict
|
from synapse.util.caches import intern_dict
|
||||||
|
from synapse.util.frozenutils import freeze
|
||||||
|
|
||||||
# Whether we should use frozen_dict in FrozenEvent. Using frozen_dicts prevents
|
# Whether we should use frozen_dict in FrozenEvent. Using frozen_dicts prevents
|
||||||
# bugs where we accidentally share e.g. signature dicts. However, converting
|
# bugs where we accidentally share e.g. signature dicts. However, converting
|
||||||
|
@ -13,13 +13,12 @@
|
|||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
|
|
||||||
from . import EventBase, FrozenEvent, _event_dict_property
|
import copy
|
||||||
|
|
||||||
from synapse.types import EventID
|
from synapse.types import EventID
|
||||||
|
|
||||||
from synapse.util.stringutils import random_string
|
from synapse.util.stringutils import random_string
|
||||||
|
|
||||||
import copy
|
from . import EventBase, FrozenEvent, _event_dict_property
|
||||||
|
|
||||||
|
|
||||||
class EventBuilder(EventBase):
|
class EventBuilder(EventBase):
|
||||||
|
@ -13,10 +13,10 @@
|
|||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
|
|
||||||
from twisted.internet import defer
|
|
||||||
|
|
||||||
from frozendict import frozendict
|
from frozendict import frozendict
|
||||||
|
|
||||||
|
from twisted.internet import defer
|
||||||
|
|
||||||
|
|
||||||
class EventContext(object):
|
class EventContext(object):
|
||||||
"""
|
"""
|
||||||
|
@ -13,15 +13,16 @@
|
|||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
|
|
||||||
from synapse.api.constants import EventTypes
|
|
||||||
from . import EventBase
|
|
||||||
|
|
||||||
from frozendict import frozendict
|
|
||||||
|
|
||||||
import re
|
import re
|
||||||
|
|
||||||
from six import string_types
|
from six import string_types
|
||||||
|
|
||||||
|
from frozendict import frozendict
|
||||||
|
|
||||||
|
from synapse.api.constants import EventTypes
|
||||||
|
|
||||||
|
from . import EventBase
|
||||||
|
|
||||||
# Split strings on "." but not "\." This uses a negative lookbehind assertion for '\'
|
# Split strings on "." but not "\." This uses a negative lookbehind assertion for '\'
|
||||||
# (?<!stuff) matches if the current position in the string is not preceded
|
# (?<!stuff) matches if the current position in the string is not preceded
|
||||||
# by a match for 'stuff'.
|
# by a match for 'stuff'.
|
||||||
|
@ -13,12 +13,12 @@
|
|||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
|
|
||||||
from synapse.types import EventID, RoomID, UserID
|
|
||||||
from synapse.api.errors import SynapseError
|
|
||||||
from synapse.api.constants import EventTypes, Membership
|
|
||||||
|
|
||||||
from six import string_types
|
from six import string_types
|
||||||
|
|
||||||
|
from synapse.api.constants import EventTypes, Membership
|
||||||
|
from synapse.api.errors import SynapseError
|
||||||
|
from synapse.types import EventID, RoomID, UserID
|
||||||
|
|
||||||
|
|
||||||
class EventValidator(object):
|
class EventValidator(object):
|
||||||
|
|
||||||
|
@ -16,14 +16,15 @@ import logging
|
|||||||
|
|
||||||
import six
|
import six
|
||||||
|
|
||||||
|
from twisted.internet import defer
|
||||||
|
|
||||||
from synapse.api.constants import MAX_DEPTH
|
from synapse.api.constants import MAX_DEPTH
|
||||||
from synapse.api.errors import SynapseError, Codes
|
from synapse.api.errors import Codes, SynapseError
|
||||||
from synapse.crypto.event_signing import check_event_content_hash
|
from synapse.crypto.event_signing import check_event_content_hash
|
||||||
from synapse.events import FrozenEvent
|
from synapse.events import FrozenEvent
|
||||||
from synapse.events.utils import prune_event
|
from synapse.events.utils import prune_event
|
||||||
from synapse.http.servlet import assert_params_in_request
|
from synapse.http.servlet import assert_params_in_request
|
||||||
from synapse.util import unwrapFirstError, logcontext
|
from synapse.util import logcontext, unwrapFirstError
|
||||||
from twisted.internet import defer
|
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
@ -21,25 +21,25 @@ import random
|
|||||||
|
|
||||||
from six.moves import range
|
from six.moves import range
|
||||||
|
|
||||||
|
from prometheus_client import Counter
|
||||||
|
|
||||||
from twisted.internet import defer
|
from twisted.internet import defer
|
||||||
|
|
||||||
from synapse.api.constants import Membership
|
from synapse.api.constants import Membership
|
||||||
from synapse.api.errors import (
|
from synapse.api.errors import (
|
||||||
CodeMessageException, HttpResponseException, SynapseError, FederationDeniedError
|
CodeMessageException,
|
||||||
|
FederationDeniedError,
|
||||||
|
HttpResponseException,
|
||||||
|
SynapseError,
|
||||||
)
|
)
|
||||||
from synapse.events import builder
|
from synapse.events import builder
|
||||||
from synapse.federation.federation_base import (
|
from synapse.federation.federation_base import FederationBase, event_from_pdu_json
|
||||||
FederationBase,
|
|
||||||
event_from_pdu_json,
|
|
||||||
)
|
|
||||||
from synapse.util import logcontext, unwrapFirstError
|
from synapse.util import logcontext, unwrapFirstError
|
||||||
from synapse.util.caches.expiringcache import ExpiringCache
|
from synapse.util.caches.expiringcache import ExpiringCache
|
||||||
from synapse.util.logcontext import make_deferred_yieldable, run_in_background
|
from synapse.util.logcontext import make_deferred_yieldable, run_in_background
|
||||||
from synapse.util.logutils import log_function
|
from synapse.util.logutils import log_function
|
||||||
from synapse.util.retryutils import NotRetryingDestination
|
from synapse.util.retryutils import NotRetryingDestination
|
||||||
|
|
||||||
from prometheus_client import Counter
|
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
sent_queries_counter = Counter("synapse_federation_client_sent_queries", "", ["type"])
|
sent_queries_counter = Counter("synapse_federation_client_sent_queries", "", ["type"])
|
||||||
|
@ -16,19 +16,19 @@
|
|||||||
import logging
|
import logging
|
||||||
import re
|
import re
|
||||||
|
|
||||||
from canonicaljson import json
|
|
||||||
import six
|
import six
|
||||||
|
from six import iteritems
|
||||||
|
|
||||||
|
from canonicaljson import json
|
||||||
|
from prometheus_client import Counter
|
||||||
|
|
||||||
from twisted.internet import defer
|
from twisted.internet import defer
|
||||||
from twisted.internet.abstract import isIPAddress
|
from twisted.internet.abstract import isIPAddress
|
||||||
|
|
||||||
from synapse.api.constants import EventTypes
|
from synapse.api.constants import EventTypes
|
||||||
from synapse.api.errors import AuthError, FederationError, SynapseError, NotFoundError
|
from synapse.api.errors import AuthError, FederationError, NotFoundError, SynapseError
|
||||||
from synapse.crypto.event_signing import compute_event_signature
|
from synapse.crypto.event_signing import compute_event_signature
|
||||||
from synapse.federation.federation_base import (
|
from synapse.federation.federation_base import FederationBase, event_from_pdu_json
|
||||||
FederationBase,
|
|
||||||
event_from_pdu_json,
|
|
||||||
)
|
|
||||||
|
|
||||||
from synapse.federation.persistence import TransactionActions
|
from synapse.federation.persistence import TransactionActions
|
||||||
from synapse.federation.units import Edu, Transaction
|
from synapse.federation.units import Edu, Transaction
|
||||||
from synapse.http.endpoint import parse_server_name
|
from synapse.http.endpoint import parse_server_name
|
||||||
@ -37,10 +37,6 @@ from synapse.util import async
|
|||||||
from synapse.util.caches.response_cache import ResponseCache
|
from synapse.util.caches.response_cache import ResponseCache
|
||||||
from synapse.util.logutils import log_function
|
from synapse.util.logutils import log_function
|
||||||
|
|
||||||
from prometheus_client import Counter
|
|
||||||
|
|
||||||
from six import iteritems
|
|
||||||
|
|
||||||
# when processing incoming transactions, we try to handle multiple rooms in
|
# when processing incoming transactions, we try to handle multiple rooms in
|
||||||
# parallel, up to this limit.
|
# parallel, up to this limit.
|
||||||
TRANSACTION_CONCURRENCY_LIMIT = 10
|
TRANSACTION_CONCURRENCY_LIMIT = 10
|
||||||
|
@ -19,13 +19,12 @@ package.
|
|||||||
These actions are mostly only used by the :py:mod:`.replication` module.
|
These actions are mostly only used by the :py:mod:`.replication` module.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
import logging
|
||||||
|
|
||||||
from twisted.internet import defer
|
from twisted.internet import defer
|
||||||
|
|
||||||
from synapse.util.logutils import log_function
|
from synapse.util.logutils import log_function
|
||||||
|
|
||||||
import logging
|
|
||||||
|
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
|
@ -29,18 +29,18 @@ dead worker doesn't cause the queues to grow limitlessly.
|
|||||||
Events are replicated via a separate events stream.
|
Events are replicated via a separate events stream.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
from .units import Edu
|
import logging
|
||||||
|
|
||||||
from synapse.storage.presence import UserPresenceState
|
|
||||||
from synapse.util.metrics import Measure
|
|
||||||
from synapse.metrics import LaterGauge
|
|
||||||
|
|
||||||
from sortedcontainers import SortedDict
|
|
||||||
from collections import namedtuple
|
from collections import namedtuple
|
||||||
|
|
||||||
import logging
|
from six import iteritems, itervalues
|
||||||
|
|
||||||
from six import itervalues, iteritems
|
from sortedcontainers import SortedDict
|
||||||
|
|
||||||
|
from synapse.metrics import LaterGauge
|
||||||
|
from synapse.storage.presence import UserPresenceState
|
||||||
|
from synapse.util.metrics import Measure
|
||||||
|
|
||||||
|
from .units import Edu
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
@ -13,31 +13,29 @@
|
|||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
import datetime
|
import datetime
|
||||||
|
import logging
|
||||||
from twisted.internet import defer
|
|
||||||
|
|
||||||
from .persistence import TransactionActions
|
|
||||||
from .units import Transaction, Edu
|
|
||||||
|
|
||||||
from synapse.api.errors import HttpResponseException, FederationDeniedError
|
|
||||||
from synapse.util import logcontext, PreserveLoggingContext
|
|
||||||
from synapse.util.retryutils import NotRetryingDestination, get_retry_limiter
|
|
||||||
from synapse.util.metrics import measure_func
|
|
||||||
from synapse.handlers.presence import format_user_presence_state, get_interested_remotes
|
|
||||||
import synapse.metrics
|
|
||||||
from synapse.metrics import LaterGauge
|
|
||||||
from synapse.metrics import (
|
|
||||||
sent_edus_counter,
|
|
||||||
sent_transactions_counter,
|
|
||||||
events_processed_counter,
|
|
||||||
)
|
|
||||||
|
|
||||||
from prometheus_client import Counter
|
|
||||||
|
|
||||||
from six import itervalues
|
from six import itervalues
|
||||||
|
|
||||||
import logging
|
from prometheus_client import Counter
|
||||||
|
|
||||||
|
from twisted.internet import defer
|
||||||
|
|
||||||
|
import synapse.metrics
|
||||||
|
from synapse.api.errors import FederationDeniedError, HttpResponseException
|
||||||
|
from synapse.handlers.presence import format_user_presence_state, get_interested_remotes
|
||||||
|
from synapse.metrics import (
|
||||||
|
LaterGauge,
|
||||||
|
events_processed_counter,
|
||||||
|
sent_edus_counter,
|
||||||
|
sent_transactions_counter,
|
||||||
|
)
|
||||||
|
from synapse.util import PreserveLoggingContext, logcontext
|
||||||
|
from synapse.util.metrics import measure_func
|
||||||
|
from synapse.util.retryutils import NotRetryingDestination, get_retry_limiter
|
||||||
|
|
||||||
|
from .persistence import TransactionActions
|
||||||
|
from .units import Edu, Transaction
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
@ -14,15 +14,14 @@
|
|||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
|
|
||||||
from twisted.internet import defer
|
|
||||||
from synapse.api.constants import Membership
|
|
||||||
|
|
||||||
from synapse.api.urls import FEDERATION_PREFIX as PREFIX
|
|
||||||
from synapse.util.logutils import log_function
|
|
||||||
|
|
||||||
import logging
|
import logging
|
||||||
import urllib
|
import urllib
|
||||||
|
|
||||||
|
from twisted.internet import defer
|
||||||
|
|
||||||
|
from synapse.api.constants import Membership
|
||||||
|
from synapse.api.urls import FEDERATION_PREFIX as PREFIX
|
||||||
|
from synapse.util.logutils import log_function
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
@ -14,26 +14,27 @@
|
|||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
|
|
||||||
from twisted.internet import defer
|
|
||||||
|
|
||||||
from synapse.api.urls import FEDERATION_PREFIX as PREFIX
|
|
||||||
from synapse.api.errors import Codes, SynapseError, FederationDeniedError
|
|
||||||
from synapse.http.endpoint import parse_and_validate_server_name
|
|
||||||
from synapse.http.server import JsonResource
|
|
||||||
from synapse.http.servlet import (
|
|
||||||
parse_json_object_from_request, parse_integer_from_args, parse_string_from_args,
|
|
||||||
parse_boolean_from_args,
|
|
||||||
)
|
|
||||||
from synapse.util.ratelimitutils import FederationRateLimiter
|
|
||||||
from synapse.util.versionstring import get_version_string
|
|
||||||
from synapse.util.logcontext import run_in_background
|
|
||||||
from synapse.types import ThirdPartyInstanceID, get_domain_from_id
|
|
||||||
|
|
||||||
import functools
|
import functools
|
||||||
import logging
|
import logging
|
||||||
import re
|
import re
|
||||||
import synapse
|
|
||||||
|
|
||||||
|
from twisted.internet import defer
|
||||||
|
|
||||||
|
import synapse
|
||||||
|
from synapse.api.errors import Codes, FederationDeniedError, SynapseError
|
||||||
|
from synapse.api.urls import FEDERATION_PREFIX as PREFIX
|
||||||
|
from synapse.http.endpoint import parse_and_validate_server_name
|
||||||
|
from synapse.http.server import JsonResource
|
||||||
|
from synapse.http.servlet import (
|
||||||
|
parse_boolean_from_args,
|
||||||
|
parse_integer_from_args,
|
||||||
|
parse_json_object_from_request,
|
||||||
|
parse_string_from_args,
|
||||||
|
)
|
||||||
|
from synapse.types import ThirdPartyInstanceID, get_domain_from_id
|
||||||
|
from synapse.util.logcontext import run_in_background
|
||||||
|
from synapse.util.ratelimitutils import FederationRateLimiter
|
||||||
|
from synapse.util.versionstring import get_version_string
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
@ -17,10 +17,9 @@
|
|||||||
server protocol.
|
server protocol.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
from synapse.util.jsonobject import JsonEncodedObject
|
|
||||||
|
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
|
from synapse.util.jsonobject import JsonEncodedObject
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
@ -38,15 +38,14 @@ An attestsation is a signed blob of json that looks like:
|
|||||||
import logging
|
import logging
|
||||||
import random
|
import random
|
||||||
|
|
||||||
|
from signedjson.sign import sign_json
|
||||||
|
|
||||||
from twisted.internet import defer
|
from twisted.internet import defer
|
||||||
|
|
||||||
from synapse.api.errors import SynapseError
|
from synapse.api.errors import SynapseError
|
||||||
from synapse.types import get_domain_from_id
|
from synapse.types import get_domain_from_id
|
||||||
from synapse.util.logcontext import run_in_background
|
from synapse.util.logcontext import run_in_background
|
||||||
|
|
||||||
from signedjson.sign import sign_json
|
|
||||||
|
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
|
@ -16,11 +16,12 @@
|
|||||||
|
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
from synapse.api.errors import SynapseError
|
from six import string_types
|
||||||
from synapse.types import GroupID, RoomID, UserID, get_domain_from_id
|
|
||||||
from twisted.internet import defer
|
from twisted.internet import defer
|
||||||
|
|
||||||
from six import string_types
|
from synapse.api.errors import SynapseError
|
||||||
|
from synapse.types import GroupID, RoomID, UserID, get_domain_from_id
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
@ -13,13 +13,13 @@
|
|||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
|
|
||||||
|
from .admin import AdminHandler
|
||||||
|
from .directory import DirectoryHandler
|
||||||
|
from .federation import FederationHandler
|
||||||
|
from .identity import IdentityHandler
|
||||||
|
from .message import MessageHandler
|
||||||
from .register import RegistrationHandler
|
from .register import RegistrationHandler
|
||||||
from .room import RoomContextHandler
|
from .room import RoomContextHandler
|
||||||
from .message import MessageHandler
|
|
||||||
from .federation import FederationHandler
|
|
||||||
from .directory import DirectoryHandler
|
|
||||||
from .admin import AdminHandler
|
|
||||||
from .identity import IdentityHandler
|
|
||||||
from .search import SearchHandler
|
from .search import SearchHandler
|
||||||
|
|
||||||
|
|
||||||
|
@ -18,11 +18,10 @@ import logging
|
|||||||
from twisted.internet import defer
|
from twisted.internet import defer
|
||||||
|
|
||||||
import synapse.types
|
import synapse.types
|
||||||
from synapse.api.constants import Membership, EventTypes
|
from synapse.api.constants import EventTypes, Membership
|
||||||
from synapse.api.errors import LimitExceededError
|
from synapse.api.errors import LimitExceededError
|
||||||
from synapse.types import UserID
|
from synapse.types import UserID
|
||||||
|
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
|
@ -13,12 +13,12 @@
|
|||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
|
|
||||||
|
import logging
|
||||||
|
|
||||||
from twisted.internet import defer
|
from twisted.internet import defer
|
||||||
|
|
||||||
from ._base import BaseHandler
|
from ._base import BaseHandler
|
||||||
|
|
||||||
import logging
|
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
|
@ -13,19 +13,18 @@
|
|||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
|
|
||||||
from twisted.internet import defer
|
import logging
|
||||||
|
|
||||||
from six import itervalues
|
from six import itervalues
|
||||||
|
|
||||||
import synapse
|
|
||||||
from synapse.api.constants import EventTypes
|
|
||||||
from synapse.util.metrics import Measure
|
|
||||||
from synapse.util.logcontext import (
|
|
||||||
make_deferred_yieldable, run_in_background,
|
|
||||||
)
|
|
||||||
from prometheus_client import Counter
|
from prometheus_client import Counter
|
||||||
|
|
||||||
import logging
|
from twisted.internet import defer
|
||||||
|
|
||||||
|
import synapse
|
||||||
|
from synapse.api.constants import EventTypes
|
||||||
|
from synapse.util.logcontext import make_deferred_yieldable, run_in_background
|
||||||
|
from synapse.util.metrics import Measure
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
@ -14,14 +14,24 @@
|
|||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
|
|
||||||
from twisted.internet import defer, threads
|
import logging
|
||||||
|
|
||||||
|
import attr
|
||||||
|
import bcrypt
|
||||||
|
import pymacaroons
|
||||||
from canonicaljson import json
|
from canonicaljson import json
|
||||||
|
|
||||||
from ._base import BaseHandler
|
from twisted.internet import defer, threads
|
||||||
|
from twisted.web.client import PartialDownloadError
|
||||||
|
|
||||||
|
import synapse.util.stringutils as stringutils
|
||||||
from synapse.api.constants import LoginType
|
from synapse.api.constants import LoginType
|
||||||
from synapse.api.errors import (
|
from synapse.api.errors import (
|
||||||
AuthError, Codes, InteractiveAuthIncompleteError, LoginError, StoreError,
|
AuthError,
|
||||||
|
Codes,
|
||||||
|
InteractiveAuthIncompleteError,
|
||||||
|
LoginError,
|
||||||
|
StoreError,
|
||||||
SynapseError,
|
SynapseError,
|
||||||
)
|
)
|
||||||
from synapse.module_api import ModuleApi
|
from synapse.module_api import ModuleApi
|
||||||
@ -29,15 +39,7 @@ from synapse.types import UserID
|
|||||||
from synapse.util.caches.expiringcache import ExpiringCache
|
from synapse.util.caches.expiringcache import ExpiringCache
|
||||||
from synapse.util.logcontext import make_deferred_yieldable
|
from synapse.util.logcontext import make_deferred_yieldable
|
||||||
|
|
||||||
from twisted.web.client import PartialDownloadError
|
from ._base import BaseHandler
|
||||||
|
|
||||||
import logging
|
|
||||||
import bcrypt
|
|
||||||
import pymacaroons
|
|
||||||
import attr
|
|
||||||
|
|
||||||
import synapse.util.stringutils as stringutils
|
|
||||||
|
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
@ -12,14 +12,15 @@
|
|||||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
|
import logging
|
||||||
|
|
||||||
from twisted.internet import defer
|
from twisted.internet import defer
|
||||||
|
|
||||||
from ._base import BaseHandler
|
from synapse.api.errors import SynapseError
|
||||||
from synapse.types import UserID, create_requester
|
from synapse.types import UserID, create_requester
|
||||||
from synapse.util.logcontext import run_in_background
|
from synapse.util.logcontext import run_in_background
|
||||||
from synapse.api.errors import SynapseError
|
|
||||||
|
|
||||||
import logging
|
from ._base import BaseHandler
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
@ -12,22 +12,24 @@
|
|||||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
|
import logging
|
||||||
|
|
||||||
|
from six import iteritems, itervalues
|
||||||
|
|
||||||
|
from twisted.internet import defer
|
||||||
|
|
||||||
from synapse.api import errors
|
from synapse.api import errors
|
||||||
from synapse.api.constants import EventTypes
|
from synapse.api.constants import EventTypes
|
||||||
from synapse.api.errors import FederationDeniedError
|
from synapse.api.errors import FederationDeniedError
|
||||||
|
from synapse.types import RoomStreamToken, get_domain_from_id
|
||||||
from synapse.util import stringutils
|
from synapse.util import stringutils
|
||||||
from synapse.util.async import Linearizer
|
from synapse.util.async import Linearizer
|
||||||
from synapse.util.caches.expiringcache import ExpiringCache
|
from synapse.util.caches.expiringcache import ExpiringCache
|
||||||
from synapse.util.retryutils import NotRetryingDestination
|
|
||||||
from synapse.util.metrics import measure_func
|
from synapse.util.metrics import measure_func
|
||||||
from synapse.types import get_domain_from_id, RoomStreamToken
|
from synapse.util.retryutils import NotRetryingDestination
|
||||||
from twisted.internet import defer
|
|
||||||
from ._base import BaseHandler
|
from ._base import BaseHandler
|
||||||
|
|
||||||
import logging
|
|
||||||
|
|
||||||
from six import itervalues, iteritems
|
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
|
@ -18,10 +18,9 @@ import logging
|
|||||||
from twisted.internet import defer
|
from twisted.internet import defer
|
||||||
|
|
||||||
from synapse.api.errors import SynapseError
|
from synapse.api.errors import SynapseError
|
||||||
from synapse.types import get_domain_from_id, UserID
|
from synapse.types import UserID, get_domain_from_id
|
||||||
from synapse.util.stringutils import random_string
|
from synapse.util.stringutils import random_string
|
||||||
|
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
|
@ -14,16 +14,17 @@
|
|||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
|
|
||||||
|
|
||||||
from twisted.internet import defer
|
|
||||||
from ._base import BaseHandler
|
|
||||||
|
|
||||||
from synapse.api.errors import SynapseError, Codes, CodeMessageException, AuthError
|
|
||||||
from synapse.api.constants import EventTypes
|
|
||||||
from synapse.types import RoomAlias, UserID, get_domain_from_id
|
|
||||||
|
|
||||||
import logging
|
import logging
|
||||||
import string
|
import string
|
||||||
|
|
||||||
|
from twisted.internet import defer
|
||||||
|
|
||||||
|
from synapse.api.constants import EventTypes
|
||||||
|
from synapse.api.errors import AuthError, CodeMessageException, Codes, SynapseError
|
||||||
|
from synapse.types import RoomAlias, UserID, get_domain_from_id
|
||||||
|
|
||||||
|
from ._base import BaseHandler
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
|
@ -16,14 +16,14 @@
|
|||||||
|
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
from canonicaljson import encode_canonical_json, json
|
|
||||||
from twisted.internet import defer
|
|
||||||
from six import iteritems
|
from six import iteritems
|
||||||
|
|
||||||
from synapse.api.errors import (
|
from canonicaljson import encode_canonical_json, json
|
||||||
SynapseError, CodeMessageException, FederationDeniedError,
|
|
||||||
)
|
from twisted.internet import defer
|
||||||
from synapse.types import get_domain_from_id, UserID
|
|
||||||
|
from synapse.api.errors import CodeMessageException, FederationDeniedError, SynapseError
|
||||||
|
from synapse.types import UserID, get_domain_from_id
|
||||||
from synapse.util.logcontext import make_deferred_yieldable, run_in_background
|
from synapse.util.logcontext import make_deferred_yieldable, run_in_background
|
||||||
from synapse.util.retryutils import NotRetryingDestination
|
from synapse.util.retryutils import NotRetryingDestination
|
||||||
|
|
||||||
|
@ -13,19 +13,18 @@
|
|||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
|
|
||||||
from twisted.internet import defer
|
|
||||||
|
|
||||||
from synapse.util.logutils import log_function
|
|
||||||
from synapse.types import UserID
|
|
||||||
from synapse.events.utils import serialize_event
|
|
||||||
from synapse.api.constants import Membership, EventTypes
|
|
||||||
from synapse.events import EventBase
|
|
||||||
|
|
||||||
from ._base import BaseHandler
|
|
||||||
|
|
||||||
import logging
|
import logging
|
||||||
import random
|
import random
|
||||||
|
|
||||||
|
from twisted.internet import defer
|
||||||
|
|
||||||
|
from synapse.api.constants import EventTypes, Membership
|
||||||
|
from synapse.events import EventBase
|
||||||
|
from synapse.events.utils import serialize_event
|
||||||
|
from synapse.types import UserID
|
||||||
|
from synapse.util.logutils import log_function
|
||||||
|
|
||||||
|
from ._base import BaseHandler
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
@ -20,38 +20,42 @@ import itertools
|
|||||||
import logging
|
import logging
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
|
import six
|
||||||
|
from six import iteritems
|
||||||
|
from six.moves import http_client
|
||||||
|
|
||||||
from signedjson.key import decode_verify_key_bytes
|
from signedjson.key import decode_verify_key_bytes
|
||||||
from signedjson.sign import verify_signed_json
|
from signedjson.sign import verify_signed_json
|
||||||
import six
|
|
||||||
from six.moves import http_client
|
|
||||||
from six import iteritems
|
|
||||||
from twisted.internet import defer
|
|
||||||
from unpaddedbase64 import decode_base64
|
from unpaddedbase64 import decode_base64
|
||||||
|
|
||||||
from ._base import BaseHandler
|
from twisted.internet import defer
|
||||||
|
|
||||||
from synapse.api.errors import (
|
|
||||||
AuthError, FederationError, StoreError, CodeMessageException, SynapseError,
|
|
||||||
FederationDeniedError,
|
|
||||||
)
|
|
||||||
from synapse.api.constants import EventTypes, Membership, RejectedReason
|
from synapse.api.constants import EventTypes, Membership, RejectedReason
|
||||||
from synapse.events.validator import EventValidator
|
from synapse.api.errors import (
|
||||||
from synapse.util import unwrapFirstError, logcontext
|
AuthError,
|
||||||
from synapse.util.metrics import measure_func
|
CodeMessageException,
|
||||||
from synapse.util.logutils import log_function
|
FederationDeniedError,
|
||||||
from synapse.util.async import Linearizer
|
FederationError,
|
||||||
from synapse.util.frozenutils import unfreeze
|
StoreError,
|
||||||
from synapse.crypto.event_signing import (
|
SynapseError,
|
||||||
compute_event_signature, add_hashes_and_signatures,
|
|
||||||
)
|
)
|
||||||
|
from synapse.crypto.event_signing import (
|
||||||
|
add_hashes_and_signatures,
|
||||||
|
compute_event_signature,
|
||||||
|
)
|
||||||
|
from synapse.events.utils import prune_event
|
||||||
|
from synapse.events.validator import EventValidator
|
||||||
from synapse.state import resolve_events_with_factory
|
from synapse.state import resolve_events_with_factory
|
||||||
from synapse.types import UserID, get_domain_from_id
|
from synapse.types import UserID, get_domain_from_id
|
||||||
|
from synapse.util import logcontext, unwrapFirstError
|
||||||
from synapse.events.utils import prune_event
|
from synapse.util.async import Linearizer
|
||||||
|
from synapse.util.distributor import user_joined_room
|
||||||
|
from synapse.util.frozenutils import unfreeze
|
||||||
|
from synapse.util.logutils import log_function
|
||||||
|
from synapse.util.metrics import measure_func
|
||||||
from synapse.util.retryutils import NotRetryingDestination
|
from synapse.util.retryutils import NotRetryingDestination
|
||||||
|
|
||||||
from synapse.util.distributor import user_joined_room
|
from ._base import BaseHandler
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
@ -14,14 +14,15 @@
|
|||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
|
|
||||||
from twisted.internet import defer
|
import logging
|
||||||
|
|
||||||
from six import iteritems
|
from six import iteritems
|
||||||
|
|
||||||
|
from twisted.internet import defer
|
||||||
|
|
||||||
from synapse.api.errors import SynapseError
|
from synapse.api.errors import SynapseError
|
||||||
from synapse.types import get_domain_from_id
|
from synapse.types import get_domain_from_id
|
||||||
|
|
||||||
import logging
|
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
|
@ -24,10 +24,13 @@ from canonicaljson import json
|
|||||||
from twisted.internet import defer
|
from twisted.internet import defer
|
||||||
|
|
||||||
from synapse.api.errors import (
|
from synapse.api.errors import (
|
||||||
MatrixCodeMessageException, CodeMessageException
|
CodeMessageException,
|
||||||
|
Codes,
|
||||||
|
MatrixCodeMessageException,
|
||||||
|
SynapseError,
|
||||||
)
|
)
|
||||||
|
|
||||||
from ._base import BaseHandler
|
from ._base import BaseHandler
|
||||||
from synapse.api.errors import SynapseError, Codes
|
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
@ -13,6 +13,8 @@
|
|||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
|
|
||||||
|
import logging
|
||||||
|
|
||||||
from twisted.internet import defer
|
from twisted.internet import defer
|
||||||
|
|
||||||
from synapse.api.constants import EventTypes, Membership
|
from synapse.api.constants import EventTypes, Membership
|
||||||
@ -21,9 +23,7 @@ from synapse.events.utils import serialize_event
|
|||||||
from synapse.events.validator import EventValidator
|
from synapse.events.validator import EventValidator
|
||||||
from synapse.handlers.presence import format_user_presence_state
|
from synapse.handlers.presence import format_user_presence_state
|
||||||
from synapse.streams.config import PaginationConfig
|
from synapse.streams.config import PaginationConfig
|
||||||
from synapse.types import (
|
from synapse.types import StreamToken, UserID
|
||||||
UserID, StreamToken,
|
|
||||||
)
|
|
||||||
from synapse.util import unwrapFirstError
|
from synapse.util import unwrapFirstError
|
||||||
from synapse.util.async import concurrently_execute
|
from synapse.util.async import concurrently_execute
|
||||||
from synapse.util.caches.snapshot_cache import SnapshotCache
|
from synapse.util.caches.snapshot_cache import SnapshotCache
|
||||||
@ -32,9 +32,6 @@ from synapse.visibility import filter_events_for_client
|
|||||||
|
|
||||||
from ._base import BaseHandler
|
from ._base import BaseHandler
|
||||||
|
|
||||||
import logging
|
|
||||||
|
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
|
@ -16,32 +16,29 @@
|
|||||||
import logging
|
import logging
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
from canonicaljson import encode_canonical_json, json
|
|
||||||
import six
|
import six
|
||||||
from six import string_types, itervalues, iteritems
|
from six import iteritems, itervalues, string_types
|
||||||
|
|
||||||
|
from canonicaljson import encode_canonical_json, json
|
||||||
|
|
||||||
from twisted.internet import defer
|
from twisted.internet import defer
|
||||||
from twisted.internet.defer import succeed
|
from twisted.internet.defer import succeed
|
||||||
from twisted.python.failure import Failure
|
from twisted.python.failure import Failure
|
||||||
|
|
||||||
from synapse.api.constants import EventTypes, Membership, MAX_DEPTH
|
from synapse.api.constants import MAX_DEPTH, EventTypes, Membership
|
||||||
from synapse.api.errors import (
|
from synapse.api.errors import AuthError, Codes, ConsentNotGivenError, SynapseError
|
||||||
AuthError, Codes, SynapseError,
|
|
||||||
ConsentNotGivenError,
|
|
||||||
)
|
|
||||||
from synapse.api.urls import ConsentURIBuilder
|
from synapse.api.urls import ConsentURIBuilder
|
||||||
from synapse.crypto.event_signing import add_hashes_and_signatures
|
from synapse.crypto.event_signing import add_hashes_and_signatures
|
||||||
from synapse.events.utils import serialize_event
|
from synapse.events.utils import serialize_event
|
||||||
from synapse.events.validator import EventValidator
|
from synapse.events.validator import EventValidator
|
||||||
from synapse.types import (
|
from synapse.replication.http.send_event import send_event_to_master
|
||||||
UserID, RoomAlias, RoomStreamToken,
|
from synapse.types import RoomAlias, RoomStreamToken, UserID
|
||||||
)
|
from synapse.util.async import Limiter, ReadWriteLock
|
||||||
from synapse.util.async import ReadWriteLock, Limiter
|
from synapse.util.frozenutils import frozendict_json_encoder
|
||||||
from synapse.util.logcontext import run_in_background
|
from synapse.util.logcontext import run_in_background
|
||||||
from synapse.util.metrics import measure_func
|
from synapse.util.metrics import measure_func
|
||||||
from synapse.util.frozenutils import frozendict_json_encoder
|
|
||||||
from synapse.util.stringutils import random_string
|
from synapse.util.stringutils import random_string
|
||||||
from synapse.visibility import filter_events_for_client
|
from synapse.visibility import filter_events_for_client
|
||||||
from synapse.replication.http.send_event import send_event_to_master
|
|
||||||
|
|
||||||
from ._base import BaseHandler
|
from ._base import BaseHandler
|
||||||
|
|
||||||
|
@ -22,27 +22,26 @@ The methods that define policy are:
|
|||||||
- should_notify
|
- should_notify
|
||||||
"""
|
"""
|
||||||
|
|
||||||
from twisted.internet import defer
|
import logging
|
||||||
from contextlib import contextmanager
|
from contextlib import contextmanager
|
||||||
|
|
||||||
from six import itervalues, iteritems
|
from six import iteritems, itervalues
|
||||||
|
|
||||||
|
from prometheus_client import Counter
|
||||||
|
|
||||||
|
from twisted.internet import defer
|
||||||
|
|
||||||
from synapse.api.errors import SynapseError
|
|
||||||
from synapse.api.constants import PresenceState
|
from synapse.api.constants import PresenceState
|
||||||
|
from synapse.api.errors import SynapseError
|
||||||
|
from synapse.metrics import LaterGauge
|
||||||
from synapse.storage.presence import UserPresenceState
|
from synapse.storage.presence import UserPresenceState
|
||||||
|
from synapse.types import UserID, get_domain_from_id
|
||||||
from synapse.util.caches.descriptors import cachedInlineCallbacks
|
|
||||||
from synapse.util.async import Linearizer
|
from synapse.util.async import Linearizer
|
||||||
|
from synapse.util.caches.descriptors import cachedInlineCallbacks
|
||||||
from synapse.util.logcontext import run_in_background
|
from synapse.util.logcontext import run_in_background
|
||||||
from synapse.util.logutils import log_function
|
from synapse.util.logutils import log_function
|
||||||
from synapse.util.metrics import Measure
|
from synapse.util.metrics import Measure
|
||||||
from synapse.util.wheel_timer import WheelTimer
|
from synapse.util.wheel_timer import WheelTimer
|
||||||
from synapse.types import UserID, get_domain_from_id
|
|
||||||
from synapse.metrics import LaterGauge
|
|
||||||
|
|
||||||
import logging
|
|
||||||
|
|
||||||
from prometheus_client import Counter
|
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
@ -17,8 +17,9 @@ import logging
|
|||||||
|
|
||||||
from twisted.internet import defer
|
from twisted.internet import defer
|
||||||
|
|
||||||
from synapse.api.errors import SynapseError, AuthError, CodeMessageException
|
from synapse.api.errors import AuthError, CodeMessageException, SynapseError
|
||||||
from synapse.types import UserID, get_domain_from_id
|
from synapse.types import UserID, get_domain_from_id
|
||||||
|
|
||||||
from ._base import BaseHandler
|
from ._base import BaseHandler
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
@ -13,13 +13,14 @@
|
|||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
|
|
||||||
from ._base import BaseHandler
|
import logging
|
||||||
|
|
||||||
from twisted.internet import defer
|
from twisted.internet import defer
|
||||||
|
|
||||||
from synapse.util.async import Linearizer
|
from synapse.util.async import Linearizer
|
||||||
|
|
||||||
import logging
|
from ._base import BaseHandler
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
|
@ -12,17 +12,15 @@
|
|||||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
from synapse.util import logcontext
|
import logging
|
||||||
|
|
||||||
from ._base import BaseHandler
|
|
||||||
|
|
||||||
from twisted.internet import defer
|
from twisted.internet import defer
|
||||||
|
|
||||||
from synapse.util.logcontext import PreserveLoggingContext
|
|
||||||
from synapse.types import get_domain_from_id
|
from synapse.types import get_domain_from_id
|
||||||
|
from synapse.util import logcontext
|
||||||
|
from synapse.util.logcontext import PreserveLoggingContext
|
||||||
|
|
||||||
import logging
|
from ._base import BaseHandler
|
||||||
|
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
@ -18,14 +18,19 @@ import logging
|
|||||||
|
|
||||||
from twisted.internet import defer
|
from twisted.internet import defer
|
||||||
|
|
||||||
|
from synapse import types
|
||||||
from synapse.api.errors import (
|
from synapse.api.errors import (
|
||||||
AuthError, Codes, SynapseError, RegistrationError, InvalidCaptchaError
|
AuthError,
|
||||||
|
Codes,
|
||||||
|
InvalidCaptchaError,
|
||||||
|
RegistrationError,
|
||||||
|
SynapseError,
|
||||||
)
|
)
|
||||||
from synapse.http.client import CaptchaServerHttpClient
|
from synapse.http.client import CaptchaServerHttpClient
|
||||||
from synapse import types
|
from synapse.types import RoomAlias, RoomID, UserID, create_requester
|
||||||
from synapse.types import UserID, create_requester, RoomID, RoomAlias
|
|
||||||
from synapse.util.async import Linearizer
|
from synapse.util.async import Linearizer
|
||||||
from synapse.util.threepids import check_3pid_allowed
|
from synapse.util.threepids import check_3pid_allowed
|
||||||
|
|
||||||
from ._base import BaseHandler
|
from ._base import BaseHandler
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
@ -15,23 +15,20 @@
|
|||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
|
|
||||||
"""Contains functions for performing events on rooms."""
|
"""Contains functions for performing events on rooms."""
|
||||||
from twisted.internet import defer
|
|
||||||
|
|
||||||
from ._base import BaseHandler
|
|
||||||
|
|
||||||
from synapse.types import UserID, RoomAlias, RoomID, RoomStreamToken
|
|
||||||
from synapse.api.constants import (
|
|
||||||
EventTypes, JoinRules, RoomCreationPreset
|
|
||||||
)
|
|
||||||
from synapse.api.errors import AuthError, Codes, StoreError, SynapseError
|
|
||||||
from synapse.util import stringutils
|
|
||||||
from synapse.visibility import filter_events_for_client
|
|
||||||
|
|
||||||
from collections import OrderedDict
|
|
||||||
|
|
||||||
import logging
|
import logging
|
||||||
import math
|
import math
|
||||||
import string
|
import string
|
||||||
|
from collections import OrderedDict
|
||||||
|
|
||||||
|
from twisted.internet import defer
|
||||||
|
|
||||||
|
from synapse.api.constants import EventTypes, JoinRules, RoomCreationPreset
|
||||||
|
from synapse.api.errors import AuthError, Codes, StoreError, SynapseError
|
||||||
|
from synapse.types import RoomAlias, RoomID, RoomStreamToken, UserID
|
||||||
|
from synapse.util import stringutils
|
||||||
|
from synapse.visibility import filter_events_for_client
|
||||||
|
|
||||||
|
from ._base import BaseHandler
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
@ -13,26 +13,24 @@
|
|||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
|
|
||||||
from twisted.internet import defer
|
import logging
|
||||||
|
from collections import namedtuple
|
||||||
|
|
||||||
from six import iteritems
|
from six import iteritems
|
||||||
from six.moves import range
|
from six.moves import range
|
||||||
|
|
||||||
from ._base import BaseHandler
|
import msgpack
|
||||||
|
from unpaddedbase64 import decode_base64, encode_base64
|
||||||
|
|
||||||
from synapse.api.constants import (
|
from twisted.internet import defer
|
||||||
EventTypes, JoinRules,
|
|
||||||
)
|
from synapse.api.constants import EventTypes, JoinRules
|
||||||
|
from synapse.types import ThirdPartyInstanceID
|
||||||
from synapse.util.async import concurrently_execute
|
from synapse.util.async import concurrently_execute
|
||||||
from synapse.util.caches.descriptors import cachedInlineCallbacks
|
from synapse.util.caches.descriptors import cachedInlineCallbacks
|
||||||
from synapse.util.caches.response_cache import ResponseCache
|
from synapse.util.caches.response_cache import ResponseCache
|
||||||
from synapse.types import ThirdPartyInstanceID
|
|
||||||
|
|
||||||
from collections import namedtuple
|
from ._base import BaseHandler
|
||||||
from unpaddedbase64 import encode_base64, decode_base64
|
|
||||||
|
|
||||||
import logging
|
|
||||||
import msgpack
|
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
@ -21,19 +21,17 @@ from six.moves import http_client
|
|||||||
|
|
||||||
from signedjson.key import decode_verify_key_bytes
|
from signedjson.key import decode_verify_key_bytes
|
||||||
from signedjson.sign import verify_signed_json
|
from signedjson.sign import verify_signed_json
|
||||||
from twisted.internet import defer
|
|
||||||
from unpaddedbase64 import decode_base64
|
from unpaddedbase64 import decode_base64
|
||||||
|
|
||||||
|
from twisted.internet import defer
|
||||||
|
|
||||||
import synapse.server
|
import synapse.server
|
||||||
import synapse.types
|
import synapse.types
|
||||||
from synapse.api.constants import (
|
from synapse.api.constants import EventTypes, Membership
|
||||||
EventTypes, Membership,
|
from synapse.api.errors import AuthError, Codes, SynapseError
|
||||||
)
|
from synapse.types import RoomID, UserID
|
||||||
from synapse.api.errors import AuthError, SynapseError, Codes
|
|
||||||
from synapse.types import UserID, RoomID
|
|
||||||
from synapse.util.async import Linearizer
|
from synapse.util.async import Linearizer
|
||||||
from synapse.util.distributor import user_left_room, user_joined_room
|
from synapse.util.distributor import user_joined_room, user_left_room
|
||||||
|
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
@ -20,11 +20,12 @@ from twisted.internet import defer
|
|||||||
from synapse.api.errors import SynapseError
|
from synapse.api.errors import SynapseError
|
||||||
from synapse.handlers.room_member import RoomMemberHandler
|
from synapse.handlers.room_member import RoomMemberHandler
|
||||||
from synapse.replication.http.membership import (
|
from synapse.replication.http.membership import (
|
||||||
remote_join, remote_reject_invite, get_or_register_3pid_guest,
|
get_or_register_3pid_guest,
|
||||||
notify_user_membership_change,
|
notify_user_membership_change,
|
||||||
|
remote_join,
|
||||||
|
remote_reject_invite,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
|
@ -13,21 +13,20 @@
|
|||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
|
|
||||||
from twisted.internet import defer
|
|
||||||
|
|
||||||
from ._base import BaseHandler
|
|
||||||
|
|
||||||
from synapse.api.constants import Membership, EventTypes
|
|
||||||
from synapse.api.filtering import Filter
|
|
||||||
from synapse.api.errors import SynapseError
|
|
||||||
from synapse.events.utils import serialize_event
|
|
||||||
from synapse.visibility import filter_events_for_client
|
|
||||||
|
|
||||||
from unpaddedbase64 import decode_base64, encode_base64
|
|
||||||
|
|
||||||
import itertools
|
import itertools
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
|
from unpaddedbase64 import decode_base64, encode_base64
|
||||||
|
|
||||||
|
from twisted.internet import defer
|
||||||
|
|
||||||
|
from synapse.api.constants import EventTypes, Membership
|
||||||
|
from synapse.api.errors import SynapseError
|
||||||
|
from synapse.api.filtering import Filter
|
||||||
|
from synapse.events.utils import serialize_event
|
||||||
|
from synapse.visibility import filter_events_for_client
|
||||||
|
|
||||||
|
from ._base import BaseHandler
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
@ -17,6 +17,7 @@ import logging
|
|||||||
from twisted.internet import defer
|
from twisted.internet import defer
|
||||||
|
|
||||||
from synapse.api.errors import Codes, StoreError, SynapseError
|
from synapse.api.errors import Codes, StoreError, SynapseError
|
||||||
|
|
||||||
from ._base import BaseHandler
|
from ._base import BaseHandler
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
@ -13,22 +13,22 @@
|
|||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
|
|
||||||
from synapse.api.constants import Membership, EventTypes
|
import collections
|
||||||
from synapse.util.async import concurrently_execute
|
import itertools
|
||||||
from synapse.util.logcontext import LoggingContext
|
import logging
|
||||||
from synapse.util.metrics import Measure, measure_func
|
|
||||||
from synapse.util.caches.response_cache import ResponseCache
|
from six import iteritems, itervalues
|
||||||
from synapse.push.clientformat import format_push_rules_for_user
|
|
||||||
from synapse.visibility import filter_events_for_client
|
|
||||||
from synapse.types import RoomStreamToken
|
|
||||||
|
|
||||||
from twisted.internet import defer
|
from twisted.internet import defer
|
||||||
|
|
||||||
import collections
|
from synapse.api.constants import EventTypes, Membership
|
||||||
import logging
|
from synapse.push.clientformat import format_push_rules_for_user
|
||||||
import itertools
|
from synapse.types import RoomStreamToken
|
||||||
|
from synapse.util.async import concurrently_execute
|
||||||
from six import itervalues, iteritems
|
from synapse.util.caches.response_cache import ResponseCache
|
||||||
|
from synapse.util.logcontext import LoggingContext
|
||||||
|
from synapse.util.metrics import Measure, measure_func
|
||||||
|
from synapse.visibility import filter_events_for_client
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
@ -13,17 +13,16 @@
|
|||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
|
|
||||||
|
import logging
|
||||||
|
from collections import namedtuple
|
||||||
|
|
||||||
from twisted.internet import defer
|
from twisted.internet import defer
|
||||||
|
|
||||||
from synapse.api.errors import SynapseError, AuthError
|
from synapse.api.errors import AuthError, SynapseError
|
||||||
|
from synapse.types import UserID, get_domain_from_id
|
||||||
from synapse.util.logcontext import run_in_background
|
from synapse.util.logcontext import run_in_background
|
||||||
from synapse.util.metrics import Measure
|
from synapse.util.metrics import Measure
|
||||||
from synapse.util.wheel_timer import WheelTimer
|
from synapse.util.wheel_timer import WheelTimer
|
||||||
from synapse.types import UserID, get_domain_from_id
|
|
||||||
|
|
||||||
import logging
|
|
||||||
|
|
||||||
from collections import namedtuple
|
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
@ -14,14 +14,15 @@
|
|||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
|
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
|
from six import iteritems
|
||||||
|
|
||||||
from twisted.internet import defer
|
from twisted.internet import defer
|
||||||
|
|
||||||
from synapse.api.constants import EventTypes, JoinRules, Membership
|
from synapse.api.constants import EventTypes, JoinRules, Membership
|
||||||
from synapse.storage.roommember import ProfileInfo
|
from synapse.storage.roommember import ProfileInfo
|
||||||
from synapse.util.metrics import Measure
|
|
||||||
from synapse.types import get_localpart_from_id
|
from synapse.types import get_localpart_from_id
|
||||||
|
from synapse.util.metrics import Measure
|
||||||
from six import iteritems
|
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
@ -13,10 +13,11 @@
|
|||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
|
|
||||||
from synapse.http.server import wrap_json_request_handler
|
|
||||||
from twisted.web.resource import Resource
|
from twisted.web.resource import Resource
|
||||||
from twisted.web.server import NOT_DONE_YET
|
from twisted.web.server import NOT_DONE_YET
|
||||||
|
|
||||||
|
from synapse.http.server import wrap_json_request_handler
|
||||||
|
|
||||||
|
|
||||||
class AdditionalResource(Resource):
|
class AdditionalResource(Resource):
|
||||||
"""Resource wrapper for additional_resources
|
"""Resource wrapper for additional_resources
|
||||||
|
@ -13,39 +13,41 @@
|
|||||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
from OpenSSL import SSL
|
|
||||||
from OpenSSL.SSL import VERIFY_NONE
|
|
||||||
|
|
||||||
from synapse.api.errors import (
|
|
||||||
CodeMessageException, MatrixCodeMessageException, SynapseError, Codes,
|
|
||||||
)
|
|
||||||
from synapse.http import cancelled_to_request_timed_out_error, redact_uri
|
|
||||||
from synapse.util.async import add_timeout_to_deferred
|
|
||||||
from synapse.util.caches import CACHE_SIZE_FACTOR
|
|
||||||
from synapse.util.logcontext import make_deferred_yieldable
|
|
||||||
from synapse.http.endpoint import SpiderEndpoint
|
|
||||||
|
|
||||||
from canonicaljson import encode_canonical_json
|
|
||||||
|
|
||||||
from twisted.internet import defer, reactor, ssl, protocol, task
|
|
||||||
from twisted.internet.endpoints import HostnameEndpoint, wrapClientTLS
|
|
||||||
from twisted.web.client import (
|
|
||||||
BrowserLikeRedirectAgent, ContentDecoderAgent, GzipDecoder, Agent,
|
|
||||||
readBody, PartialDownloadError,
|
|
||||||
HTTPConnectionPool,
|
|
||||||
)
|
|
||||||
from twisted.web.client import FileBodyProducer as TwistedFileBodyProducer
|
|
||||||
from twisted.web.http import PotentialDataLoss
|
|
||||||
from twisted.web.http_headers import Headers
|
|
||||||
from twisted.web._newclient import ResponseDone
|
|
||||||
|
|
||||||
from six import StringIO
|
|
||||||
|
|
||||||
from prometheus_client import Counter
|
|
||||||
from canonicaljson import json
|
|
||||||
import logging
|
import logging
|
||||||
import urllib
|
import urllib
|
||||||
|
|
||||||
|
from six import StringIO
|
||||||
|
|
||||||
|
from canonicaljson import encode_canonical_json, json
|
||||||
|
from prometheus_client import Counter
|
||||||
|
|
||||||
|
from OpenSSL import SSL
|
||||||
|
from OpenSSL.SSL import VERIFY_NONE
|
||||||
|
from twisted.internet import defer, protocol, reactor, ssl, task
|
||||||
|
from twisted.internet.endpoints import HostnameEndpoint, wrapClientTLS
|
||||||
|
from twisted.web._newclient import ResponseDone
|
||||||
|
from twisted.web.client import Agent, BrowserLikeRedirectAgent, ContentDecoderAgent
|
||||||
|
from twisted.web.client import FileBodyProducer as TwistedFileBodyProducer
|
||||||
|
from twisted.web.client import (
|
||||||
|
GzipDecoder,
|
||||||
|
HTTPConnectionPool,
|
||||||
|
PartialDownloadError,
|
||||||
|
readBody,
|
||||||
|
)
|
||||||
|
from twisted.web.http import PotentialDataLoss
|
||||||
|
from twisted.web.http_headers import Headers
|
||||||
|
|
||||||
|
from synapse.api.errors import (
|
||||||
|
CodeMessageException,
|
||||||
|
Codes,
|
||||||
|
MatrixCodeMessageException,
|
||||||
|
SynapseError,
|
||||||
|
)
|
||||||
|
from synapse.http import cancelled_to_request_timed_out_error, redact_uri
|
||||||
|
from synapse.http.endpoint import SpiderEndpoint
|
||||||
|
from synapse.util.async import add_timeout_to_deferred
|
||||||
|
from synapse.util.caches import CACHE_SIZE_FACTOR
|
||||||
|
from synapse.util.logcontext import make_deferred_yieldable
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
@ -12,19 +12,17 @@
|
|||||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
import re
|
|
||||||
|
|
||||||
from twisted.internet.endpoints import HostnameEndpoint, wrapClientTLS
|
|
||||||
from twisted.internet import defer
|
|
||||||
from twisted.internet.error import ConnectError
|
|
||||||
from twisted.names import client, dns
|
|
||||||
from twisted.names.error import DNSNameError, DomainError
|
|
||||||
|
|
||||||
import collections
|
import collections
|
||||||
import logging
|
import logging
|
||||||
import random
|
import random
|
||||||
|
import re
|
||||||
import time
|
import time
|
||||||
|
|
||||||
|
from twisted.internet import defer
|
||||||
|
from twisted.internet.endpoints import HostnameEndpoint, wrapClientTLS
|
||||||
|
from twisted.internet.error import ConnectError
|
||||||
|
from twisted.names import client, dns
|
||||||
|
from twisted.names.error import DNSNameError, DomainError
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
@ -13,38 +13,38 @@
|
|||||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
from twisted.internet import defer, reactor, protocol
|
|
||||||
from twisted.internet.error import DNSLookupError
|
|
||||||
from twisted.web.client import readBody, HTTPConnectionPool, Agent
|
|
||||||
from twisted.web.http_headers import Headers
|
|
||||||
from twisted.web._newclient import ResponseDone
|
|
||||||
|
|
||||||
from synapse.http import cancelled_to_request_timed_out_error
|
|
||||||
from synapse.http.endpoint import matrix_federation_endpoint
|
|
||||||
import synapse.metrics
|
|
||||||
from synapse.util.async import add_timeout_to_deferred
|
|
||||||
from synapse.util import logcontext
|
|
||||||
from synapse.util.logcontext import make_deferred_yieldable
|
|
||||||
import synapse.util.retryutils
|
|
||||||
|
|
||||||
from canonicaljson import encode_canonical_json, json
|
|
||||||
|
|
||||||
from synapse.api.errors import (
|
|
||||||
SynapseError, Codes, HttpResponseException, FederationDeniedError,
|
|
||||||
)
|
|
||||||
|
|
||||||
from signedjson.sign import sign_json
|
|
||||||
|
|
||||||
import cgi
|
import cgi
|
||||||
import logging
|
import logging
|
||||||
import random
|
import random
|
||||||
import sys
|
import sys
|
||||||
import urllib
|
import urllib
|
||||||
from six.moves.urllib import parse as urlparse
|
|
||||||
from six import string_types
|
from six import string_types
|
||||||
|
from six.moves.urllib import parse as urlparse
|
||||||
|
|
||||||
|
from canonicaljson import encode_canonical_json, json
|
||||||
from prometheus_client import Counter
|
from prometheus_client import Counter
|
||||||
|
from signedjson.sign import sign_json
|
||||||
|
|
||||||
|
from twisted.internet import defer, protocol, reactor
|
||||||
|
from twisted.internet.error import DNSLookupError
|
||||||
|
from twisted.web._newclient import ResponseDone
|
||||||
|
from twisted.web.client import Agent, HTTPConnectionPool, readBody
|
||||||
|
from twisted.web.http_headers import Headers
|
||||||
|
|
||||||
|
import synapse.metrics
|
||||||
|
import synapse.util.retryutils
|
||||||
|
from synapse.api.errors import (
|
||||||
|
Codes,
|
||||||
|
FederationDeniedError,
|
||||||
|
HttpResponseException,
|
||||||
|
SynapseError,
|
||||||
|
)
|
||||||
|
from synapse.http import cancelled_to_request_timed_out_error
|
||||||
|
from synapse.http.endpoint import matrix_federation_endpoint
|
||||||
|
from synapse.util import logcontext
|
||||||
|
from synapse.util.async import add_timeout_to_deferred
|
||||||
|
from synapse.util.logcontext import make_deferred_yieldable
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
outbound_logger = logging.getLogger("synapse.http.outbound")
|
outbound_logger = logging.getLogger("synapse.http.outbound")
|
||||||
|
@ -17,8 +17,8 @@
|
|||||||
import logging
|
import logging
|
||||||
|
|
||||||
from prometheus_client.core import Counter, Histogram
|
from prometheus_client.core import Counter, Histogram
|
||||||
from synapse.metrics import LaterGauge
|
|
||||||
|
|
||||||
|
from synapse.metrics import LaterGauge
|
||||||
from synapse.util.logcontext import LoggingContext
|
from synapse.util.logcontext import LoggingContext
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
@ -14,34 +14,34 @@
|
|||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
import cgi
|
import cgi
|
||||||
from six.moves import http_client
|
|
||||||
|
|
||||||
from synapse.api.errors import (
|
|
||||||
cs_exception, SynapseError, CodeMessageException, UnrecognizedRequestError, Codes
|
|
||||||
)
|
|
||||||
from synapse.http.request_metrics import (
|
|
||||||
requests_counter,
|
|
||||||
)
|
|
||||||
from synapse.util.logcontext import LoggingContext, PreserveLoggingContext
|
|
||||||
from synapse.util.caches import intern_dict
|
|
||||||
from synapse.util.metrics import Measure
|
|
||||||
import synapse.metrics
|
|
||||||
import synapse.events
|
|
||||||
|
|
||||||
from canonicaljson import (
|
|
||||||
encode_canonical_json, encode_pretty_printed_json, json
|
|
||||||
)
|
|
||||||
|
|
||||||
from twisted.internet import defer
|
|
||||||
from twisted.python import failure
|
|
||||||
from twisted.web import server, resource
|
|
||||||
from twisted.web.server import NOT_DONE_YET
|
|
||||||
from twisted.web.util import redirectTo
|
|
||||||
|
|
||||||
import collections
|
import collections
|
||||||
import logging
|
import logging
|
||||||
import urllib
|
import urllib
|
||||||
|
|
||||||
|
from six.moves import http_client
|
||||||
|
|
||||||
|
from canonicaljson import encode_canonical_json, encode_pretty_printed_json, json
|
||||||
|
|
||||||
|
from twisted.internet import defer
|
||||||
|
from twisted.python import failure
|
||||||
|
from twisted.web import resource, server
|
||||||
|
from twisted.web.server import NOT_DONE_YET
|
||||||
|
from twisted.web.util import redirectTo
|
||||||
|
|
||||||
|
import synapse.events
|
||||||
|
import synapse.metrics
|
||||||
|
from synapse.api.errors import (
|
||||||
|
CodeMessageException,
|
||||||
|
Codes,
|
||||||
|
SynapseError,
|
||||||
|
UnrecognizedRequestError,
|
||||||
|
cs_exception,
|
||||||
|
)
|
||||||
|
from synapse.http.request_metrics import requests_counter
|
||||||
|
from synapse.util.caches import intern_dict
|
||||||
|
from synapse.util.logcontext import LoggingContext, PreserveLoggingContext
|
||||||
|
from synapse.util.metrics import Measure
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
HTML_ERROR_TEMPLATE = """<!DOCTYPE html>
|
HTML_ERROR_TEMPLATE = """<!DOCTYPE html>
|
||||||
|
@ -15,12 +15,11 @@
|
|||||||
|
|
||||||
""" This module contains base REST classes for constructing REST servlets. """
|
""" This module contains base REST classes for constructing REST servlets. """
|
||||||
|
|
||||||
from synapse.api.errors import SynapseError, Codes
|
|
||||||
|
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
from canonicaljson import json
|
from canonicaljson import json
|
||||||
|
|
||||||
|
from synapse.api.errors import Codes, SynapseError
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
@ -16,7 +16,7 @@ import contextlib
|
|||||||
import logging
|
import logging
|
||||||
import time
|
import time
|
||||||
|
|
||||||
from twisted.web.server import Site, Request
|
from twisted.web.server import Request, Site
|
||||||
|
|
||||||
from synapse.http import redact_uri
|
from synapse.http import redact_uri
|
||||||
from synapse.http.request_metrics import RequestMetrics
|
from synapse.http.request_metrics import RequestMetrics
|
||||||
|
@ -13,20 +13,19 @@
|
|||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
|
|
||||||
import logging
|
|
||||||
import functools
|
import functools
|
||||||
import time
|
|
||||||
import gc
|
import gc
|
||||||
|
import logging
|
||||||
import os
|
import os
|
||||||
import platform
|
import platform
|
||||||
import attr
|
import time
|
||||||
|
|
||||||
from prometheus_client import Gauge, Histogram, Counter
|
import attr
|
||||||
from prometheus_client.core import GaugeMetricFamily, REGISTRY
|
from prometheus_client import Counter, Gauge, Histogram
|
||||||
|
from prometheus_client.core import REGISTRY, GaugeMetricFamily
|
||||||
|
|
||||||
from twisted.internet import reactor
|
from twisted.internet import reactor
|
||||||
|
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
running_on_pypy = platform.python_implementation() == "PyPy"
|
running_on_pypy = platform.python_implementation() == "PyPy"
|
||||||
|
@ -13,28 +13,27 @@
|
|||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
|
|
||||||
|
import logging
|
||||||
|
from collections import namedtuple
|
||||||
|
|
||||||
|
from prometheus_client import Counter
|
||||||
|
|
||||||
from twisted.internet import defer
|
from twisted.internet import defer
|
||||||
|
|
||||||
from synapse.api.constants import EventTypes, Membership
|
from synapse.api.constants import EventTypes, Membership
|
||||||
from synapse.api.errors import AuthError
|
from synapse.api.errors import AuthError
|
||||||
from synapse.handlers.presence import format_user_presence_state
|
from synapse.handlers.presence import format_user_presence_state
|
||||||
|
from synapse.metrics import LaterGauge
|
||||||
from synapse.util.logutils import log_function
|
from synapse.types import StreamToken
|
||||||
from synapse.util.async import (
|
from synapse.util.async import (
|
||||||
ObservableDeferred, add_timeout_to_deferred,
|
|
||||||
DeferredTimeoutError,
|
DeferredTimeoutError,
|
||||||
|
ObservableDeferred,
|
||||||
|
add_timeout_to_deferred,
|
||||||
)
|
)
|
||||||
from synapse.util.logcontext import PreserveLoggingContext, run_in_background
|
from synapse.util.logcontext import PreserveLoggingContext, run_in_background
|
||||||
|
from synapse.util.logutils import log_function
|
||||||
from synapse.util.metrics import Measure
|
from synapse.util.metrics import Measure
|
||||||
from synapse.types import StreamToken
|
|
||||||
from synapse.visibility import filter_events_for_client
|
from synapse.visibility import filter_events_for_client
|
||||||
from synapse.metrics import LaterGauge
|
|
||||||
|
|
||||||
from collections import namedtuple
|
|
||||||
from prometheus_client import Counter
|
|
||||||
|
|
||||||
import logging
|
|
||||||
|
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
@ -13,13 +13,13 @@
|
|||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
|
|
||||||
from twisted.internet import defer
|
import logging
|
||||||
|
|
||||||
from .bulk_push_rule_evaluator import BulkPushRuleEvaluator
|
from twisted.internet import defer
|
||||||
|
|
||||||
from synapse.util.metrics import Measure
|
from synapse.util.metrics import Measure
|
||||||
|
|
||||||
import logging
|
from .bulk_push_rule_evaluator import BulkPushRuleEvaluator
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
@ -13,9 +13,10 @@
|
|||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
|
|
||||||
from synapse.push.rulekinds import PRIORITY_CLASS_MAP, PRIORITY_CLASS_INVERSE_MAP
|
|
||||||
import copy
|
import copy
|
||||||
|
|
||||||
|
from synapse.push.rulekinds import PRIORITY_CLASS_INVERSE_MAP, PRIORITY_CLASS_MAP
|
||||||
|
|
||||||
|
|
||||||
def list_with_base_rules(rawrules):
|
def list_with_base_rules(rawrules):
|
||||||
"""Combine the list of rules set by the user with the default push rules
|
"""Combine the list of rules set by the user with the default push rules
|
||||||
|
@ -15,21 +15,22 @@
|
|||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
|
|
||||||
import logging
|
import logging
|
||||||
|
from collections import namedtuple
|
||||||
|
|
||||||
|
from six import iteritems, itervalues
|
||||||
|
|
||||||
|
from prometheus_client import Counter
|
||||||
|
|
||||||
from twisted.internet import defer
|
from twisted.internet import defer
|
||||||
|
|
||||||
from .push_rule_evaluator import PushRuleEvaluatorForEvent
|
|
||||||
|
|
||||||
from synapse.event_auth import get_user_power_level
|
|
||||||
from synapse.api.constants import EventTypes, Membership
|
from synapse.api.constants import EventTypes, Membership
|
||||||
|
from synapse.event_auth import get_user_power_level
|
||||||
|
from synapse.state import POWER_KEY
|
||||||
|
from synapse.util.async import Linearizer
|
||||||
from synapse.util.caches import register_cache
|
from synapse.util.caches import register_cache
|
||||||
from synapse.util.caches.descriptors import cached
|
from synapse.util.caches.descriptors import cached
|
||||||
from synapse.util.async import Linearizer
|
|
||||||
from synapse.state import POWER_KEY
|
|
||||||
|
|
||||||
from collections import namedtuple
|
from .push_rule_evaluator import PushRuleEvaluatorForEvent
|
||||||
from prometheus_client import Counter
|
|
||||||
from six import itervalues, iteritems
|
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
@ -13,12 +13,10 @@
|
|||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
|
|
||||||
from synapse.push.rulekinds import (
|
|
||||||
PRIORITY_CLASS_MAP, PRIORITY_CLASS_INVERSE_MAP
|
|
||||||
)
|
|
||||||
|
|
||||||
import copy
|
import copy
|
||||||
|
|
||||||
|
from synapse.push.rulekinds import PRIORITY_CLASS_INVERSE_MAP, PRIORITY_CLASS_MAP
|
||||||
|
|
||||||
|
|
||||||
def format_push_rules_for_user(user, ruleslist):
|
def format_push_rules_for_user(user, ruleslist):
|
||||||
"""Converts a list of rawrules and a enabled map into nested dictionaries
|
"""Converts a list of rawrules and a enabled map into nested dictionaries
|
||||||
|
@ -13,14 +13,13 @@
|
|||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
|
|
||||||
|
import logging
|
||||||
|
|
||||||
from twisted.internet import defer
|
from twisted.internet import defer
|
||||||
from twisted.internet.error import AlreadyCalled, AlreadyCancelled
|
from twisted.internet.error import AlreadyCalled, AlreadyCancelled
|
||||||
|
|
||||||
import logging
|
|
||||||
|
|
||||||
from synapse.util.metrics import Measure
|
|
||||||
from synapse.util.logcontext import LoggingContext
|
from synapse.util.logcontext import LoggingContext
|
||||||
|
from synapse.util.metrics import Measure
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user