Esempio n. 1
0
def test_invalid_request():
    output = lambda_handler_host(
        INVALID_TEST_REQUEST,
        context=Context,
        ca_private_key_password=RSA_CA_PRIVATE_KEY_PASSWORD,
        entropy_check=False,
        config_file=os.path.join(os.path.dirname(__file__), 'bless-test.cfg'))
    assert output['errorType'] == 'InputValidationError'
Esempio n. 2
0
def test_basic_local_request_with_multiple_hosts():
    output = lambda_handler_host(
        VALID_TEST_REQUEST_MULTIPLE_HOSTS,
        context=Context,
        ca_private_key_password=RSA_CA_PRIVATE_KEY_PASSWORD,
        entropy_check=False,
        config_file=os.path.join(os.path.dirname(__file__), 'bless-test.cfg'))
    print(output)
    assert output['certificate'].startswith('[email protected] ')
Esempio n. 3
0
def test_basic_local_request():
    output = lambda_handler_host(
        VALID_TEST_REQUEST,
        context=Context,
        ca_private_key_password=RSA_CA_PRIVATE_KEY_PASSWORD,
        entropy_check=False,
        config_file=os.path.join(os.path.dirname(__file__), "bless-test.cfg"),
    )
    print(output)
    assert output["certificate"].startswith("[email protected] ")
Esempio n. 4
0
def lambda_handler(*args, **kwargs):
    """
    Wrapper around lambda_handler_user for backwards compatibility
    """

    event = args[0]
    if event.get('hostnames') is not None:
        return lambda_handler_host(*args, **kwargs)
    else:
        return lambda_handler_user(*args, **kwargs)