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'
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] ')
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] ")
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)