private RaygunRequestMessage BuildRequestMessage()
        {
            var message = _currentWebRequest.Value != null?RaygunWebApiRequestMessageBuilder.Build(_currentWebRequest.Value, _requestMessageOptions) : null;

            _currentWebRequest.Value = null;
            return(message);
        }
Example #2
0
        public void DataContainsReturnsFalseWhenCaseDoesNotMatch()
        {
            var rawData = "{\"UserName\":\"Raygun\",\"Password\":\"123456\"}";

            var containsSensitiveData = RaygunWebApiRequestMessageBuilder.DataContains(rawData, new List <string>()
            {
                "password"
            });

            Assert.AreEqual(containsSensitiveData, false);
        }
Example #3
0
        public void DataContainsReturnsTrueWhenMatchingOnExactCase()
        {
            var rawData = "{\"UserName\":\"Raygun\",\"Password\":\"123456\"}";

            var containsSensitiveData = RaygunWebApiRequestMessageBuilder.DataContains(rawData, new List <string>()
            {
                "Password"
            });

            Assert.AreEqual(containsSensitiveData, true);
        }
Example #4
0
        public void RawDataRemainsUnchangedWhenParsingFails()
        {
            var rawData = "I am unchanged!";

            var options = new RaygunRequestMessageOptions();

            options.AddSensitiveFieldNames("password");

            Assert.AreEqual(rawData.Length, 15);

            var filteredData = RaygunWebApiRequestMessageBuilder.StripSensitiveValues(rawData, options);

            Assert.NotNull(filteredData);
            Assert.AreEqual(filteredData.Length, 15);
            Assert.AreEqual(filteredData, "I am unchanged!");
        }
Example #5
0
 public IRaygunMessageBuilder SetHttpDetails(HttpRequestMessage request, RaygunRequestMessageOptions options)
 {
     return(SetHttpDetails(RaygunWebApiRequestMessageBuilder.Build(request, options)));
 }