Пример #1
0
def check_config_values(config, toolbox):
    """
    Validates the values for provided config in the [radius_server_challenge]
    section

    Args:
        config (ConfigDict): The config object to check the optional config for
        toolbox (ConfigTestToolbox): Toolbox used to execute the tests

    Returns:
        list of ConfigResult
    """
    problems = []
    config_test_resolver = base.get_basic_radius_server_resolver(
        config, toolbox)

    # Add radius server challenge specific keys
    config_test_resolver.update({
        'enroll_challenge':
        toolbox.test_is_bool,
        'prompt_format':
        functools.partial(toolbox.test_valid_enum,
                          enum=RADIUS_CHALLENGE_PROMPT_FORMATS,
                          transform=str.lower),
    })

    problems += base.run_config_value_checks(config, config_test_resolver)
    problems += base.check_for_unexpected_keys(config, toolbox,
                                               config_test_resolver)
    problems += base.check_basic_radius_server_protected_usage(config, toolbox)
    return problems
Пример #2
0
def check_config_values(config, toolbox):
    """
    Validates the values for provided config in the [radius_server_concat]
    section

    Args:
        config (ConfigDict): The config object to check the optional config for
        toolbox (ConfigTestToolbox): Toolbox used to execute the tests

    Returns:
        list of ConfigResult
    """
    problems = []
    config_test_resolver = base.get_basic_radius_server_resolver(
        config, toolbox)

    # Add radius server concat specific keys
    config_test_resolver.update({
        'delimiter':
        toolbox.test_is_string,
        'delimited_password_length':
        toolbox.test_is_positive_int,
    })

    problems += base.run_config_value_checks(config, config_test_resolver)
    problems += base.check_for_unexpected_keys(config, toolbox,
                                               config_test_resolver)
    problems += base.check_basic_radius_server_protected_usage(config, toolbox)
    return problems
Пример #3
0
def check_config_values(config, toolbox):
    """ Validates the values for provided config in the [radius_server_iframe] section

    Args:
        config (ConfigDict): The config object to check the optional config for
        toolbox (ConfigTestToolbox): Toolbox used to execute the tests

    Returns:
        list of ConfigResults
    """

    problems = []
    config_test_resolver = base.get_basic_radius_server_resolver(
        config, toolbox)

    # Add radius server iframe specific keys
    config_test_resolver.update({
        'type':
        functools.partial(toolbox.test_valid_enum,
                          enum=JS_TYPES,
                          transform=str.lower),
        'iframe_script_uri':
        toolbox.test_is_string,
        'script_inject':
        toolbox.test_is_string,
    })

    problems += base.run_config_value_checks(config, config_test_resolver)

    problems += base.check_for_unexpected_keys(config, toolbox,
                                               config_test_resolver)

    problems += base.check_basic_radius_server_protected_usage(config, toolbox)

    return problems
def check_config_values(config, toolbox):
    """ Validates the values for provided config in the [radius_server_auto] section

    Args:
        config (ConfigDict): The config object to check the optional config for
        toolbox (ConfigTestToolbox): Toolbox used to execute the tests

    Returns:
        list of BaseResult
    """

    problems = []
    config_test_resolver = base.get_basic_radius_server_resolver(config, toolbox)

    # Add radius server auto specific keys
    config_test_resolver.update({
        'factors': functools.partial(toolbox.test_valid_permutation,
                                     enum=['auto', 'push', 'phone', 'passcode'], separator=',', repeats=False),
        'delimiter': toolbox.test_is_string,
        'delimited_password_length': toolbox.test_is_positive_int,
        'allow_concat': toolbox.test_is_bool,
    })

    problems += base.run_config_value_checks(config, config_test_resolver)

    problems += base.check_for_unexpected_keys(config, toolbox, config_test_resolver)

    problems += base.check_basic_radius_server_protected_usage(config, toolbox)

    return problems
def check_config_values(config, toolbox):
    """
    Validates the values for provided config in the [radius_server_duo_only]
    section

    Args:
        config (ConfigDict): The config object to check the optional config for
        toolbox (ConfigTestToolbox): Toolbox used to execute the tests

    Returns:
        list of ConfigResult
    """
    problems = []
    config_test_resolver = base.get_basic_radius_server_resolver(
        config, toolbox)

    problems += base.run_config_value_checks(config, config_test_resolver)
    problems += base.check_for_unexpected_keys(config, toolbox,
                                               config_test_resolver)
    problems += base.check_basic_radius_server_protected_usage(config, toolbox)
    return problems