mirror of
https://github.com/aljazceru/python-teos.git
synced 2025-12-18 06:34:19 +01:00
Renamed constants and default file names for Pisa's private and public keys
This commit is contained in:
@@ -11,7 +11,7 @@ CLIENT_LOG_FILE = 'pisa.log'
|
||||
SUPPORTED_HASH_FUNCTIONS = ["SHA256"]
|
||||
SUPPORTED_CIPHERS = ["AES-GCM-128"]
|
||||
|
||||
PUBLIC_KEY_FILE = "signing_key_pub.pem"
|
||||
PISA_PUBLIC_KEY = "pisa_pk.pem"
|
||||
|
||||
# Configure logging
|
||||
logging.basicConfig(format='%(message)s', level=logging.INFO, handlers=[
|
||||
|
||||
@@ -20,13 +20,13 @@ from pisa.appointment import Appointment
|
||||
|
||||
from apps.cli.blob import Blob
|
||||
from apps.cli.help import help_add_appointment, help_get_appointment
|
||||
from apps.cli import DEFAULT_PISA_API_SERVER, DEFAULT_PISA_API_PORT, PUBLIC_KEY_FILE
|
||||
from apps.cli import DEFAULT_PISA_API_SERVER, DEFAULT_PISA_API_PORT, PISA_PUBLIC_KEY
|
||||
|
||||
HTTP_OK = 200
|
||||
|
||||
logger = Logger("Client")
|
||||
|
||||
with open(PUBLIC_KEY_FILE, "r") as key_file:
|
||||
with open(PISA_PUBLIC_KEY, "r") as key_file:
|
||||
pubkey_pem = key_file.read().encode("utf-8")
|
||||
pisa_public_key = load_pem_public_key(pubkey_pem, backend=default_backend())
|
||||
|
||||
@@ -88,8 +88,6 @@ def add_appointment(args):
|
||||
try:
|
||||
r = requests.post(url=add_appointment_endpoint, json=appointment.to_json(), timeout=5)
|
||||
|
||||
print(r.text)
|
||||
|
||||
logger.info("{} (code: {}).".format(r.json(), r.status_code))
|
||||
|
||||
response_json = r.json()
|
||||
|
||||
Reference in New Issue
Block a user