Пример #1
0
def test_1():
    rest = REST('http://localhost')
    cnf = create_model('C.T.T.T')

    cnf['tool']['issuer'] = 'http://example.com/op'
    cnf['tool']['sig'] = True

    qiss = quote_plus(cnf['tool']['issuer'])
    qtag = cnf['tool']['tag']
    rest.write(qiss, qtag, cnf)

    _ecnf = rest.construct_config(qiss, qtag)

    assert set(_ecnf.keys()) == {'client', 'keys', 'tool'}
    assert set(_ecnf['client'].keys()) == {'behaviour', 'client_prefs',
                                           'registration_info'}
Пример #2
0
def test_1():
    rest = REST('http://localhost')
    cnf = create_model('C.T.T.T')

    cnf['tool']['issuer'] = 'http://example.com/op'
    cnf['tool']['sig'] = True

    qiss = quote_plus(cnf['tool']['issuer'])
    qtag = cnf['tool']['tag']
    rest.write(qiss, qtag, cnf)

    _ecnf = rest.construct_config(qiss, qtag)

    assert set(_ecnf.keys()) == {'client', 'keys', 'tool'}
    assert set(_ecnf['client'].keys()) == {
        'behaviour', 'client_prefs', 'registration_info'
    }
Пример #3
0
        'session.auto': True,
        'session.timeout': 900
    }

    sys.path.insert(0, ".")
    CONF = importlib.import_module(args.config)

    rest = REST(None, CONF.ENT_PATH, CONF.ENT_INFO)
    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')

    display_order = [
        "Discovery", "Registration", "Authorization request", "AccessToken"
    ]

    _path, app_args = construct_app_args(args,
                                         CONF,
Пример #4
0
        'session.auto': True,
        'session.timeout': 900
    }

    sys.path.insert(0, ".")
    CONF = importlib.import_module(args.config)

    rest = REST(None, CONF.ENT_PATH, CONF.ENT_INFO)
    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, CONF, request, func, profiles,
                                         ent_conf)

    app_args.update(
        {"msg_factory": message_factory,
         'check_factory': check.factory, 'profile_handler': ProfileHandler,