From 63712d6dca38b6539afdfbe69099237706db093c Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Thu, 6 Aug 2020 19:56:14 +0100 Subject: [PATCH] Some crypto endpoints need authorization --- daemon.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/daemon.py b/daemon.py index 3477029e..b477a833 100644 --- a/daemon.py +++ b/daemon.py @@ -5777,15 +5777,16 @@ class PubServer(BaseHTTPRequestHandler): def _cryptoAPI(self, path: str, authorized: bool) -> None: # TODO - if path.startswith('/api/v1/crypto/keys/upload'): + if authorized and path.startswith('/api/v1/crypto/keys/upload'): self._200() elif path.startswith('/api/v1/crypto/keys/query'): self._200() elif path.startswith('/api/v1/crypto/keys/claim'): self._200() - elif path.startswith('/api/v1/crypto/delivery'): + elif authorized and path.startswith('/api/v1/crypto/delivery'): self._200() - elif path.startswith('/api/v1/crypto/encrypted_messages/clear'): + elif (authorized and + path.startswith('/api/v1/crypto/encrypted_messages/clear')): self._200() elif path.startswith('/api/v1/crypto/encrypted_messages'): self._200()