mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-12-15 15:38:47 -05:00
Initial implementation of auth conflict resolution
This commit is contained in:
parent
5a3a15f5c1
commit
78015948a7
8 changed files with 211 additions and 82 deletions
|
|
@ -42,7 +42,7 @@ class TransportLayerServer(object):
|
|||
content = None
|
||||
origin = None
|
||||
|
||||
if request.method == "PUT":
|
||||
if request.method in ["PUT", "POST"]:
|
||||
# TODO: Handle other method types? other content types?
|
||||
try:
|
||||
content_bytes = request.content.read()
|
||||
|
|
@ -234,6 +234,16 @@ class TransportLayerServer(object):
|
|||
)
|
||||
)
|
||||
)
|
||||
self.server.register_path(
|
||||
"POST",
|
||||
re.compile("^" + PREFIX + "/query_auth/([^/]*)/([^/]*)$"),
|
||||
self._with_authentication(
|
||||
lambda origin, content, query, context, event_id:
|
||||
self._on_query_auth_request(
|
||||
origin, content, event_id,
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
@defer.inlineCallbacks
|
||||
@log_function
|
||||
|
|
@ -325,3 +335,12 @@ class TransportLayerServer(object):
|
|||
)
|
||||
|
||||
defer.returnValue((200, content))
|
||||
|
||||
@defer.inlineCallbacks
|
||||
@log_function
|
||||
def _on_query_auth_request(self, origin, content, event_id):
|
||||
new_content = yield self.request_handler.on_query_auth_request(
|
||||
origin, content, event_id
|
||||
)
|
||||
|
||||
defer.returnValue((200, new_content))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue