Add basic application_services SQL, and hook up parts of the appservice store to read from it.

This commit is contained in:
Kegan Dougal 2015-01-28 11:59:38 +00:00
parent b46fa8603e
commit 42876969b9
5 changed files with 117 additions and 16 deletions

View file

@ -16,7 +16,7 @@
from twisted.internet import defer
from ._base import BaseHandler
from synapse.api.errors import StoreError, SynapseError
from synapse.api.errors import Codes, StoreError, SynapseError
import logging
@ -36,11 +36,12 @@ class ApplicationServicesHandler(BaseHandler):
try:
stored_service = yield self.store.get_app_service(app_service.token)
if not stored_service:
raise StoreError(404, "Not found")
raise StoreError(404, "Application Service Not found")
except StoreError:
raise SynapseError(
403, "Unrecognised application services token. "
"Consult the home server admin."
"Consult the home server admin.",
errcode=Codes.FORBIDDEN
)
# TODO store this AS