forked from indymedia/epicyon
Crypto API placeholder
parent
a6e3731fa8
commit
a1b09a23bf
22
daemon.py
22
daemon.py
|
@ -5775,6 +5775,23 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
postBytes, boundary)
|
postBytes, boundary)
|
||||||
return pageNumber
|
return pageNumber
|
||||||
|
|
||||||
|
def _cryptoAPI(self, path: str, authorized: bool) -> None:
|
||||||
|
# TODO
|
||||||
|
if 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'):
|
||||||
|
self._200()
|
||||||
|
elif path.startswith('/api/v1/crypto/encrypted_messages/clear'):
|
||||||
|
self._200()
|
||||||
|
elif path.startswith('/api/v1/crypto/encrypted_messages'):
|
||||||
|
self._200()
|
||||||
|
else:
|
||||||
|
self._400()
|
||||||
|
|
||||||
def do_POST(self):
|
def do_POST(self):
|
||||||
POSTstartTime = time.time()
|
POSTstartTime = time.time()
|
||||||
POSTtimings = []
|
POSTtimings = []
|
||||||
|
@ -5848,6 +5865,11 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
print('POST Not authorized')
|
print('POST Not authorized')
|
||||||
print(str(self.headers))
|
print(str(self.headers))
|
||||||
|
|
||||||
|
if self.path.startswith('/api/v1/crypto/'):
|
||||||
|
self._cryptoAPI(self.path, authorized)
|
||||||
|
self.server.POSTbusy = False
|
||||||
|
return
|
||||||
|
|
||||||
# if this is a POST to the outbox then check authentication
|
# if this is a POST to the outbox then check authentication
|
||||||
self.outboxAuthenticated = False
|
self.outboxAuthenticated = False
|
||||||
self.postToNickname = None
|
self.postToNickname = None
|
||||||
|
|
Loading…
Reference in New Issue