Ejemplo n.º 1
0
        public async Task DataStream_Azure_EventHub_ValidateConnection_Valid()
        {
            var stream           = GetValidStream();
            var validationResult = await DataStreamValidator.ValidateDataStreamAsync(stream, new AdminLogger(new Utils.LogWriter()));

            AssertSuccessful(validationResult);
        }
Ejemplo n.º 2
0
        public async Task DataStream_Azure_EventHub_ValidateConnection_BadCredentials_Invalid()
        {
            var stream = GetValidStream();

            stream.AzureAccessKey = "isnottherightone";
            var validationResult = await DataStreamValidator.ValidateDataStreamAsync(stream, new AdminLogger(new Utils.LogWriter()));

            AssertInvalidError(validationResult, "Put token failed. status-code: 401, status-description: InvalidSignature: The token has an invalid signature..");
        }
        public async Task DataStream_Azure_TableStorage_ValidateConnection_InvalidAccountId_Invalid()
        {
            var stream = GetValidStream();

            stream.AzureStorageAccountName = "isnottherightone";
            var validationResult = await DataStreamValidator.ValidateDataStreamAsync(stream, new AdminLogger(new Utils.LogWriter()));

            AssertInvalidError(validationResult, "No such host is known. (isnottherightone.table.core.windows.net:443)");
        }
        public async Task DataStream_Azure_TableStorage_ValidateConnection_BadCredentials_Invalid()
        {
            var stream = GetValidStream();

            stream.AzureAccessKey = "isnottherightone";
            var validationResult = await DataStreamValidator.ValidateDataStreamAsync(stream, new AdminLogger(new Utils.LogWriter()));

            AssertInvalidError(validationResult, "Server failed to authenticate the request. Make sure the value of Authorization header is formed correctly including the signature.");
        }
Ejemplo n.º 5
0
        public async Task DataStream_SQLServer_ValidateConnection_BadCredentials_Invalid()
        {
            var stream = GetValidStream();

            stream.DbPassword = "******";
            var validationResult = await DataStreamValidator.ValidateDataStreamAsync(stream, new AdminLogger(new Utils.LogWriter()));

            AssertInvalidError(validationResult, "Could not access SQL Server: Login failed for user 'nuviotadmin'.");
        }
        public async Task DataStream_AWS_S3_ValidateConnection_BadCredentials_Invalid()
        {
            var stream = GetValidStream();

            stream.AwsSecretKey = "isnottherightone";
            var validationResult = await DataStreamValidator.ValidateDataStreamAsync(stream, new AdminLogger(new Utils.LogWriter()));

            AssertInvalidError(validationResult, "The remote server returned an error: (403) Forbidden.", "The request signature we calculated does not match the signature you provided. Check your key and signing method.");
        }
Ejemplo n.º 7
0
        public async Task DataStream_AWS_ElasticSearch_ValidateConnection_InvalidURI_Invalid()
        {
            var stream = GetValidStream();

            stream.ElasticSearchDomainName = "https://search-nuviot-test-aaaaabbbbbbccccc.us-east-1.es.amazonaws.com/";
            var validationResult = await DataStreamValidator.ValidateDataStreamAsync(stream, new AdminLogger(new Utils.LogWriter()));

            AssertInvalidError(validationResult, "No such host is known. (search-nuviot-test-aaaaabbbbbbccccc.us-east-1.es.amazonaws.com:443)");
        }
Ejemplo n.º 8
0
        public async Task DataStream_AWS_ElasticSearch_ValidateConnection_BadCredentials_Invalid()
        {
            var stream = GetValidStream();

            stream.AwsSecretKey = "isnottherightone";
            var validationResult = await DataStreamValidator.ValidateDataStreamAsync(stream, new AdminLogger(new Utils.LogWriter()));

            AssertInvalidError(validationResult, "Request failed to execute. Call: Status code 403 from: HEAD /dontcare");
        }
Ejemplo n.º 9
0
        public async Task <InvokeResult> ValidateDataStreamAsync(string id)
        {
            var stream = await _dataStreamManager.LoadFullDataStreamConfigurationAsync(id, OrgEntityHeader, UserEntityHeader);

            if (!stream.Successful)
            {
                return(stream.ToInvokeResult());
            }

            return(await DataStreamValidator.ValidateDataStreamAsync(stream.Result, _adminlogger));
        }
Ejemplo n.º 10
0
 public async Task <InvokeResult> ValidateDataStreamAsync([FromBody] DataStream stream)
 {
     return(await DataStreamValidator.ValidateDataStreamAsync(stream, _adminlogger));
 }