def test_flow(): _flow = Flow(BASE_PATH, None) tl = _flow.matches_profile(PROFILE[0]) assert len(tl) == 56 tl = _flow.matches_profile(PROFILE[1]) assert len(tl) == 62 tl = _flow.matches_profile(PROFILE[2]) assert len(tl) == 63 tl = _flow.matches_profile(PROFILE[3]) assert len(tl) == 64 tl = _flow.matches_profile(PROFILE[4]) assert len(tl) == 93 tl = _flow.matches_profile(PROFILE[5]) assert len(tl) == 41 tl = _flow.matches_profile(PROFILE[6]) assert len(tl) == 41 tl = _flow.matches_profile(PROFILE[7]) assert len(tl) == 55
redirect_uris=rp.redirect_uris) print(res) print(rp.federation) # -------------------- parser = argparse.ArgumentParser() parser.add_argument('-f', dest='flowsdir', required=True) parser.add_argument('-k', dest='insecure', action='store_true') parser.add_argument('-t', dest='test_id') # parser.add_argument(dest="config") args = parser.parse_args() _flows = Flow(args.flowsdir, profile_handler=None) tests = _flows.keys() # Get the necessary information about the JWKS bundle info = {} for path in ['bundle', 'bundle/signer', 'bundle/sigkey']: _url = "{}/{}".format(tool_url, path) resp = requests.request('GET', _url, verify=False) info[path] = resp.text # Create a KeyJar instance that contains the key that the bundle was signed with kj = KeyJar() kj.import_jwks(json.loads(info['bundle/sigkey']), info['bundle/signer']) # Create a JWKSBundle instance and load it with the keys in the bundle # I got from the tool
sig_keys, 'fo_jwks', key_conv={ 'to': quote_plus, 'from': unquote_plus }) signers = create_signers(keybundle, 'ms_path', fed_conf.SMS_DEF, fed_conf.FO.values()) # signer, keybundle = test_utils.setup(fed_conf.KEY_DEFS, fed_conf.TOOL_ISS, # liss, fed_conf.SMS_DEF, fed_conf.OA, # 'ms_dir') folder = os.path.abspath(os.curdir) _flows = Flow(args.flowsdir, profile_handler=SimpleProfileHandler) op_handler = FedOPHandler(provider.Provider, _op_arg, _com_args, _flows, folder, key_defs=fed_conf.KEY_DEFS, signers=signers) cherrypy.tools.dumplog = cherrypy.Tool('before_finalize', dump_log) cherrypy.config.update({ 'environment': 'production', 'log.error_file': 'site.log', 'tools.trailing_slash.on': False, 'server.socket_host': '0.0.0.0',