Some crypto endpoints need authorization

main
Bob Mottram 2020-08-06 19:56:14 +01:00
parent a1b09a23bf
commit 63712d6dca
1 changed files with 4 additions and 3 deletions

View File

@ -5777,15 +5777,16 @@ class PubServer(BaseHTTPRequestHandler):
def _cryptoAPI(self, path: str, authorized: bool) -> None: def _cryptoAPI(self, path: str, authorized: bool) -> None:
# TODO # TODO
if path.startswith('/api/v1/crypto/keys/upload'): if authorized and path.startswith('/api/v1/crypto/keys/upload'):
self._200() self._200()
elif path.startswith('/api/v1/crypto/keys/query'): elif path.startswith('/api/v1/crypto/keys/query'):
self._200() self._200()
elif path.startswith('/api/v1/crypto/keys/claim'): elif path.startswith('/api/v1/crypto/keys/claim'):
self._200() self._200()
elif path.startswith('/api/v1/crypto/delivery'): elif authorized and path.startswith('/api/v1/crypto/delivery'):
self._200() self._200()
elif path.startswith('/api/v1/crypto/encrypted_messages/clear'): elif (authorized and
path.startswith('/api/v1/crypto/encrypted_messages/clear')):
self._200() self._200()
elif path.startswith('/api/v1/crypto/encrypted_messages'): elif path.startswith('/api/v1/crypto/encrypted_messages'):
self._200() self._200()