summary refs log tree commit diff
path: root/synapse/handlers/acme.py
diff options
context:
space:
mode:
authorPatrick Cloke <clokep@users.noreply.github.com>2021-01-26 10:50:21 -0500
committerGitHub <noreply@github.com>2021-01-26 10:50:21 -0500
commit1baab2035265cf2543fe3c0ef5412c1ac0740c7e (patch)
treecb1b9911d3ad794be081378031cfcdc72939f73f /synapse/handlers/acme.py
parentDo not require the CAS service URL setting (use public_baseurl instead). (#9199) (diff)
downloadsynapse-1baab2035265cf2543fe3c0ef5412c1ac0740c7e.tar.xz
Add type hints to various handlers. (#9223)
With this change all handlers except the e2e_* ones have
type hints enabled.
Diffstat (limited to 'synapse/handlers/acme.py')
-rw-r--r--synapse/handlers/acme.py12
1 files changed, 7 insertions, 5 deletions
diff --git a/synapse/handlers/acme.py b/synapse/handlers/acme.py
index 8476256a59..5ecb2da1ac 100644
--- a/synapse/handlers/acme.py
+++ b/synapse/handlers/acme.py
@@ -14,6 +14,7 @@
 # limitations under the License.
 
 import logging
+from typing import TYPE_CHECKING
 
 import twisted
 import twisted.internet.error
@@ -22,6 +23,9 @@ from twisted.web.resource import Resource
 
 from synapse.app import check_bind_error
 
+if TYPE_CHECKING:
+    from synapse.app.homeserver import HomeServer
+
 logger = logging.getLogger(__name__)
 
 ACME_REGISTER_FAIL_ERROR = """
@@ -35,12 +39,12 @@ solutions, please read https://github.com/matrix-org/synapse/blob/master/docs/AC
 
 
 class AcmeHandler:
-    def __init__(self, hs):
+    def __init__(self, hs: "HomeServer"):
         self.hs = hs
         self.reactor = hs.get_reactor()
         self._acme_domain = hs.config.acme_domain
 
-    async def start_listening(self):
+    async def start_listening(self) -> None:
         from synapse.handlers import acme_issuing_service
 
         # Configure logging for txacme, if you need to debug
@@ -85,7 +89,7 @@ class AcmeHandler:
             logger.error(ACME_REGISTER_FAIL_ERROR)
             raise
 
-    async def provision_certificate(self):
+    async def provision_certificate(self) -> None:
 
         logger.warning("Reprovisioning %s", self._acme_domain)
 
@@ -110,5 +114,3 @@ class AcmeHandler:
         except Exception:
             logger.exception("Failed saving!")
             raise
-
-        return True