ci: Lint source
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
"""Example SHS client"""
|
||||
|
||||
import os
|
||||
from asyncio import get_event_loop
|
||||
from base64 import b64decode
|
||||
@@ -7,11 +9,13 @@ from nacl.signing import SigningKey
|
||||
|
||||
from secret_handshake import SHSClient
|
||||
|
||||
with open(os.path.expanduser("~/.ssb/secret")) as f:
|
||||
with open(os.path.expanduser("~/.ssb/secret"), encoding="utf-8") as f:
|
||||
config = yaml.safe_load(f)
|
||||
|
||||
|
||||
async def main():
|
||||
"""Main function to run"""
|
||||
|
||||
server_pub_key = b64decode(config["public"][:-8])
|
||||
client = SHSClient("localhost", 8008, SigningKey.generate(), server_pub_key)
|
||||
await client.open()
|
||||
|
@@ -1,3 +1,5 @@
|
||||
"""Example SHS server"""
|
||||
|
||||
import os
|
||||
from asyncio import get_event_loop
|
||||
from base64 import b64decode
|
||||
@@ -7,7 +9,7 @@ from nacl.signing import SigningKey
|
||||
|
||||
from secret_handshake import SHSServer
|
||||
|
||||
with open(os.path.expanduser("~/.ssb/secret")) as f:
|
||||
with open(os.path.expanduser("~/.ssb/secret"), encoding="utf-8") as f:
|
||||
config = yaml.safe_load(f)
|
||||
|
||||
|
||||
@@ -17,6 +19,8 @@ async def _on_connect(conn):
|
||||
|
||||
|
||||
async def main():
|
||||
"""Main function to run"""
|
||||
|
||||
server_keypair = SigningKey(b64decode(config["private"][:-8])[:32])
|
||||
server = SHSServer("localhost", 8008, server_keypair)
|
||||
server.on_connect(_on_connect)
|
||||
|
Reference in New Issue
Block a user