Exemple #1
0
def make_webenv(config, rest):
    if args.tag:
        qtag = quote_plus(args.tag)
    else:
        qtag = 'default'

    ent_conf = None
    try:
        ent_conf = rest.construct_config(quote_plus(args.issuer), qtag)
    except Exception as err:
        print('iss:{}, tag:{}'.format(quote_plus(args.issuer), qtag))
        for m in traceback.format_exception(*sys.exc_info()):
            print(m)
        exit()

    setup_logging("%s/rp_%s.log" % (SERVER_LOG_FOLDER, args.port), logger)
    logger.info('construct_app_args')

    _path, app_args = construct_app_args(args, config, oper, func, profiles,
                                         ent_conf)

    # Application arguments
    app_args.update({
        "msg_factory": oic_message_factory,
        'profile_map': PROFILEMAP,
        'profile_handler': ProfileHandler,
        'client_factory': Factory(Client)
    })

    if args.insecure:
        app_args['client_info']['verify_ssl'] = False

    return app_args
    _path, app_args = construct_app_args(args,
                                         CONF,
                                         request,
                                         func,
                                         profiles,
                                         ent_conf,
                                         display_order=display_order)

    app_args.update({
        "msg_factory": message_factory,
        'check_factory': check.factory,
        'profile_handler': ProfileHandler,
        'make_entity': make_client,
        'map_prof': PROFILEMAP,
        'client_factory': Factory(Client)
    })

    WA = WebApplication(sessionhandler=SessionHandler,
                        webio=WebIh,
                        webtester=WebTester,
                        check=check,
                        webenv=app_args,
                        pick_grp=pick_grp,
                        path=_path)

    _conf = app_args['conf']

    SRV = wsgiserver.CherryPyWSGIServer(
        ('0.0.0.0', args.port), SessionMiddleware(WA.application,
                                                  session_opts))
Exemple #3
0
    _client_info = CONF.CLIENT
    _client_info.update(
        {
            "base_url": CONF.BASE, "kidd": kidd, "keyjar": keyjar,
            "jwks_uri": jwks_uri,
        })
    if cargs.insecure:
        _client_info['verify_ssl'] = False

    kwargs = {
        "flows": FLOWS['Flows'], "conf": CONF,
        "client_info": _client_info, "order": FLOWS['Order'],
        "desc": FLOWS['Desc'], "profiles": profiles, "operation": oper,
        "msg_factory": oic_message_factory, "check_factory": check.factory,
        "cache": {}, 'profile_handler': SimpleProfileHandler,
        'client_factory': Factory(Client), 'tool_conf': CONF.TOOL
    }

    if cargs.test_id:
        rtypes = []
        try:
            rtypes = get_return_types(FLOWS['Flows'][cargs.test_id]['profile'])
        except KeyError:
            print('No such test ID')
            exit()

        if cargs.profile:
            if cargs.profile not in rtypes:
                print('Profile not among return_types')
                exit()
            else: