Add Matrix register/login API and full Matrix API proxy

(ref #19, #15)
This commit is contained in:
Tulir Asokan 2018-12-08 01:13:40 +02:00
parent 5337d4d98e
commit 332ad5ea52
13 changed files with 238 additions and 36 deletions

View file

@ -75,6 +75,13 @@ class _Response:
"errcode": "pid_mismatch",
}, status=HTTPStatus.BAD_REQUEST)
@property
def username_or_password_missing(self) -> web.Response:
return web.json_response({
"error": "Username or password missing",
"errcode": "username_or_password_missing",
}, status=HTTPStatus.BAD_REQUEST)
@property
def bad_auth(self) -> web.Response:
return web.json_response({
@ -138,6 +145,13 @@ class _Response:
"errcode": "resource_not_found",
}, status=HTTPStatus.NOT_FOUND)
@property
def server_not_found(self) -> web.Response:
return web.json_response({
"error": "Registration target server not found",
"errcode": "server_not_found",
}, status=HTTPStatus.NOT_FOUND)
@property
def method_not_allowed(self) -> web.Response:
return web.json_response({
@ -196,6 +210,13 @@ class _Response:
"errcode": "internal_server_error",
}, status=HTTPStatus.INTERNAL_SERVER_ERROR)
@property
def invalid_server(self) -> web.Response:
return web.json_response({
"error": "Invalid registration server object in maubot configuration",
"errcode": "invalid_server",
}, status=HTTPStatus.INTERNAL_SERVER_ERROR)
@property
def unsupported_plugin_loader(self) -> web.Response:
return web.json_response({