0
0
Fork 1
mirror of https://mau.dev/maunium/synapse.git synced 2024-05-23 14:03:45 +02:00

Merge branch 'master' of github.com:matrix-org/synapse into develop

This commit is contained in:
Erik Johnston 2014-10-20 17:53:18 +01:00
commit 4ae0844ee3
8 changed files with 74 additions and 12 deletions

View file

@ -1,13 +1,22 @@
Changes in synapse 0.4.1 (2014-10-17)
=====================================
Webclient:
* Fix bug with display of timestamps.
Changes in synpase 0.4.0 (2014-10-17) Changes in synpase 0.4.0 (2014-10-17)
===================================== =====================================
This server includes changes to the federation protocol that is not backwards This release includes changes to the federation protocol and client-server API
compatible. that is not backwards compatible.
The Matrix specification has been moved to a seperate git repository. The Matrix specification has been moved to a separate git repository:
http://github.com/matrix-org/matrix-doc
You will also need an updated syutil and config. See UPGRADES.rst.
Homeserver: Homeserver:
* Sign federation transactions. * Sign federation transactions to assert strong identity over federation.
* Rename timestamp keys in PDUs. * Rename timestamp keys in PDUs and events from 'ts' and 'hsob_ts' to 'origin_server_ts'.
Changes in synapse 0.3.4 (2014-09-25) Changes in synapse 0.3.4 (2014-09-25)
===================================== =====================================

View file

@ -1,3 +1,16 @@
Upgrading to v0.4.0
===================
This release needs an updated syutil version. Run::
python setup.py develop
You will also need to upgrade your configuration as the signing key format has
changed. Run::
python -m synapse.app.homeserver --config-path <CONFIG> --generate-config
Upgrading to v0.3.0 Upgrading to v0.3.0
=================== ===================

View file

@ -1 +1 @@
0.4.0 0.4.1

View file

@ -41,11 +41,12 @@ setup(
"py-bcrypt", "py-bcrypt",
], ],
dependency_links=[ dependency_links=[
"git+ssh://git@github.com/matrix-org/syutil.git#egg=syutil-0.0.2", "https://github.com/matrix-org/syutil/tarball/v0.0.2#egg=syutil-0.0.2",
], ],
setup_requires=[ setup_requires=[
"setuptools_trial", "setuptools_trial",
"setuptools>=1.0.0", # Needs setuptools that supports git+ssh. It's not obvious when support for this was introduced. "setuptools>=1.0.0", # Needs setuptools that supports git+ssh.
# TODO: Do we need this now? we don't use git+ssh.
"mock" "mock"
], ],
include_package_data=True, include_package_data=True,

View file

@ -16,4 +16,4 @@
""" This is a reference implementation of a synapse home server. """ This is a reference implementation of a synapse home server.
""" """
__version__ = "0.4.0" __version__ = "0.4.1"

View file

@ -94,7 +94,7 @@ class ServerConfig(Config):
with open(args.signing_key_path, "w") as signing_key_file: with open(args.signing_key_path, "w") as signing_key_file:
syutil.crypto.signing_key.write_signing_keys( syutil.crypto.signing_key.write_signing_keys(
signing_key_file, signing_key_file,
(syutil.crypto.SigningKey.generate("auto"),), (syutil.crypto.signing_key.generate_singing_key("auto"),),
) )
else: else:
signing_keys = cls.read_file(args.signing_key_path, "signing_key") signing_keys = cls.read_file(args.signing_key_path, "signing_key")

View file

@ -15,6 +15,7 @@
"""Contains functions for registering clients.""" """Contains functions for registering clients."""
from twisted.internet import defer from twisted.internet import defer
from twisted.python import log
from synapse.types import UserID from synapse.types import UserID
from synapse.api.errors import ( from synapse.api.errors import (
@ -126,7 +127,7 @@ class RegistrationHandler(BaseHandler):
try: try:
threepid = yield self._threepid_from_creds(c) threepid = yield self._threepid_from_creds(c)
except: except:
logger.err() log.err()
raise RegistrationError(400, "Couldn't validate 3pid") raise RegistrationError(400, "Couldn't validate 3pid")
if not threepid: if not threepid:

View file

@ -101,7 +101,9 @@ class BaseHttpClient(object):
while True: while True:
producer = body_callback(method, url_bytes, headers_dict) producer = None
if body_callback:
producer = body_callback(method, url_bytes, headers_dict)
try: try:
response = yield self.agent.request( response = yield self.agent.request(
@ -312,6 +314,42 @@ class IdentityServerHttpClient(BaseHttpClient):
defer.returnValue(json.loads(body)) defer.returnValue(json.loads(body))
@defer.inlineCallbacks
def get_json(self, destination, path, args={}, retry_on_dns_fail=True):
""" Get's some json from the given host homeserver and path
Args:
destination (str): The remote server to send the HTTP request
to.
path (str): The HTTP path.
args (dict): A dictionary used to create query strings, defaults to
None.
**Note**: The value of each key is assumed to be an iterable
and *not* a string.
Returns:
Deferred: Succeeds when we get *any* HTTP response.
The result of the deferred is a tuple of `(code, response)`,
where `response` is a dict representing the decoded JSON body.
"""
logger.debug("get_json args: %s", args)
query_bytes = urllib.urlencode(args, True)
logger.debug("Query bytes: %s Retry DNS: %s", args, retry_on_dns_fail)
response = yield self._create_request(
destination.encode("ascii"),
"GET",
path.encode("ascii"),
query_bytes=query_bytes,
retry_on_dns_fail=retry_on_dns_fail,
body_callback=None
)
body = yield readBody(response)
defer.returnValue(json.loads(body))
class CaptchaServerHttpClient(MatrixHttpClient): class CaptchaServerHttpClient(MatrixHttpClient):
"""Separate HTTP client for talking to google's captcha servers""" """Separate HTTP client for talking to google's captcha servers"""