import socket import yaml import json import logging import jwt from argparse import ArgumentParser from resolvers import find_server_action from protocol import validate_request, make_404, make_500, \ config_request, config_rewrite config = config_request() parser = ArgumentParser() # header = { "alg": "HS256", "typ": "JWT"} # payload = {'userId': 'b08f86af-35da-48f2-8fab-cef3904660bd'} # encoded = jwt.encode(payload, 'secret', algorithm='HS256') # # print(encoded) # print(jwt.decode(encoded, 'secret', algorithms=['HS256'])) parser.add_argument('-c', '--config', type=str, required=False, help='Sets config path') parser.add_argument('-ht', '--host', type=str, required=False, help='Sets config host')
def test_port_config_request(): response = config_request() if response.get('port') not in PORT: assert False