Example #1
0
        public async Task<Response> SendAsync(Request request)
        {
            request.SetAccessKeyId(AccessKeyId);
            request.SetSignture(AccessKeySecret);
            var response = new Response(request, await CallWebClientProviderAsync(request));
            response.ValidateSignature(AccessKeySecret);

            if (!response.IsValidSignature)
            {
                throw new RavenInvalidSignatureException(
                    $"Invalid Signature; Response: {response.Get("Signature")} Calculated: {response.CalculatedSignature}");
            }
            return response;
        }
 public void TestRequestSignature_MissingKey_Exception(string operation, NameValueCollection dataCollection, string missingKeys)
 {
     var req = new Request(operation, dataCollection);
     req.SetAccessKeyId(AccessKeyId);
     var rex = Assert.Throws<RavenException>(() => req.SetSignture(AccessKeySecret));
     Assert.That(rex.Message,Contains.Substring(missingKeys));
 }
        public string TestRequestSignatrureCreation(string operation, NameValueCollection dataCollection)
        {
            var req = new Request(operation,dataCollection);
            req.SetAccessKeyId(AccessKeyId);
            req.SetSignture(AccessKeySecret);

            return req.Get("signature");
        }