base64->hex + Dockerfile
This commit is contained in:
parent
295cb26a9c
commit
dcb4d75247
8
Dockerfile
Normal file
8
Dockerfile
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
# syntax=docker/dockerfile:1
|
||||||
|
FROM python:3.9
|
||||||
|
WORKDIR /v6
|
||||||
|
ENV v6root=/v6data
|
||||||
|
COPY requirements.txt requirements.txt
|
||||||
|
RUN pip install -r requirements.txt
|
||||||
|
COPY v6d0auth v6d0auth
|
||||||
|
CMD ["python3", "-m", "v6d0auth.run-server"]
|
@ -1,6 +1,5 @@
|
|||||||
import asyncio.futures
|
import asyncio.futures
|
||||||
|
|
||||||
from nacl.encoding import URLSafeBase64Encoder
|
|
||||||
from aiohttp import web, http_websocket
|
from aiohttp import web, http_websocket
|
||||||
from nacl.exceptions import BadSignatureError
|
from nacl.exceptions import BadSignatureError
|
||||||
from nacl.signing import VerifyKey
|
from nacl.signing import VerifyKey
|
||||||
@ -11,7 +10,7 @@ __all__ = ('get_app',)
|
|||||||
|
|
||||||
|
|
||||||
def define_routes(routes: web.RouteTableDef, loop: asyncio.AbstractEventLoop):
|
def define_routes(routes: web.RouteTableDef, loop: asyncio.AbstractEventLoop):
|
||||||
print(certs.vkey.encode(URLSafeBase64Encoder).decode())
|
print(certs.vkey.encode().hex())
|
||||||
mycdb = cdb.CDB(loop)
|
mycdb = cdb.CDB(loop)
|
||||||
loop.create_task(mycdb.job())
|
loop.create_task(mycdb.job())
|
||||||
|
|
||||||
|
@ -5,7 +5,6 @@ import time
|
|||||||
import weakref
|
import weakref
|
||||||
from typing import MutableMapping, Optional
|
from typing import MutableMapping, Optional
|
||||||
|
|
||||||
from nacl.encoding import URLSafeBase64Encoder
|
|
||||||
from nacl.signing import VerifyKey
|
from nacl.signing import VerifyKey
|
||||||
from nacl.utils import random
|
from nacl.utils import random
|
||||||
|
|
||||||
@ -74,7 +73,7 @@ class CDB:
|
|||||||
self.requester_mapping[requester] = request
|
self.requester_mapping[requester] = request
|
||||||
heapq.heappush(self.heap, request)
|
heapq.heappush(self.heap, request)
|
||||||
self.handle_mapping[request.handle] = request
|
self.handle_mapping[request.handle] = request
|
||||||
print('requested', request.handle.hex(), requester.encode(URLSafeBase64Encoder).decode())
|
print('requested', request.handle.hex(), requester.encode().hex())
|
||||||
return request
|
return request
|
||||||
|
|
||||||
def _approve(self, handle: bytes) -> bytes:
|
def _approve(self, handle: bytes) -> bytes:
|
||||||
|
Loading…
Reference in New Issue
Block a user