Skip to content

Commit

Permalink
Merge pull request #40 from bmrvilela/master
Browse files Browse the repository at this point in the history
Added resilience to services using polly
  • Loading branch information
portilha authored Jan 10, 2025
2 parents af96679 + a985f58 commit 75ea655
Show file tree
Hide file tree
Showing 18 changed files with 7,470 additions and 7,389 deletions.
4 changes: 2 additions & 2 deletions Checkmarx.API.Tests/ScanTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -155,8 +155,8 @@ public void CompareScanResultsTest()
var previousScanNEResultList = clientV89.GetNotExploitableFromScan(1003127).ToList();
var scanNEResultList = clientV89.GetNotExploitableFromScan(1009757).ToList();

var results = clientV89.GetResultsForScanByStateId(1009757, ResultState.NonExploitable);
var previousResults = clientV89.GetResultsForScanByStateId(1003127, ResultState.NonExploitable);
var results = clientV89.GetResultsForScanByState(1009757, ResultState.NonExploitable);
var previousResults = clientV89.GetResultsForScanByState(1003127, ResultState.NonExploitable);

//// < 9.5
//var results1 = clientV9.GetResultsForScan(1661644).ToList();
Expand Down
1 change: 1 addition & 0 deletions Checkmarx.API/Checkmarx.API.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@
<PackageReference Include="Microsoft.OData.Edm" Version="8.2.2" />
<PackageReference Include="Microsoft.Spatial" Version="8.2.2" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
<PackageReference Include="Polly" Version="8.5.0" />
<PackageReference Include="System.ComponentModel.Annotations" Version="5.0.0" />
<PackageReference Include="System.IdentityModel.Tokens.Jwt" Version="8.2.1" />
<PackageReference Include="System.ServiceModel.Duplex" Version="6.0.0" />
Expand Down
2,473 changes: 1,237 additions & 1,236 deletions Checkmarx.API/Connected Services/CxAuditWebService/CxAuditWebService.cs

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
//------------------------------------------------------------------------------

// Generation date: 10/5/2022 1:06:25 PM
using Checkmarx.API.Models;

namespace Checkmarx.API.SAST.OData
{
/// <summary>
Expand All @@ -24,7 +26,7 @@ public partial class ODataClient95 : global::Microsoft.OData.Client.DataServiceC
public ODataClient95(global::System.Uri serviceRoot) :
this(serviceRoot, global::Microsoft.OData.Client.ODataProtocolVersion.V4)
{

}

/// <summary>
Expand Down Expand Up @@ -102,7 +104,7 @@ protected string ResolveNameFromType(global::System.Type clientType)
{
this._Projects = base.CreateQuery<Checkmarx.API.SAST.OData.Project>("Projects");
}
return this._Projects;
return new RetryableDataServiceQuery<Checkmarx.API.SAST.OData.Project>(this._Projects);
}
}
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "#VersionNumber#")]
Expand All @@ -120,7 +122,7 @@ protected string ResolveNameFromType(global::System.Type clientType)
{
this._Scans = base.CreateQuery<Checkmarx.API.SAST.OData.Scan>("Scans");
}
return this._Scans;
return new RetryableDataServiceQuery<Checkmarx.API.SAST.OData.Scan>(this._Scans);
}
}
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "#VersionNumber#")]
Expand All @@ -136,9 +138,9 @@ protected string ResolveNameFromType(global::System.Type clientType)
{
if ((this._Results == null))
{
this._Results = base.CreateQuery< Checkmarx.API.SAST.OData.Result >("Results");
this._Results = base.CreateQuery<Checkmarx.API.SAST.OData.Result>("Results");
}
return this._Results;
return new RetryableDataServiceQuery<Checkmarx.API.SAST.OData.Result>(this._Results);
}
}
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "#VersionNumber#")]
Expand Down Expand Up @@ -192,13 +194,13 @@ private abstract class GeneratedEdmModel

if (!global::Microsoft.OData.Edm.Csdl.CsdlReader.TryParse(reader, true, out edmModel, out errors))
{
global::System.Text.StringBuilder errorMessages = new global::System.Text.StringBuilder();
foreach (var error in errors)
{
errorMessages.Append(error.ErrorMessage);
errorMessages.Append("; ");
}
throw new global::System.InvalidOperationException(errorMessages.ToString());
global::System.Text.StringBuilder errorMessages = new global::System.Text.StringBuilder();
foreach (var error in errors)
{
errorMessages.Append(error.ErrorMessage);
errorMessages.Append("; ");
}
throw new global::System.InvalidOperationException(errorMessages.ToString());
}

return edmModel;
Expand All @@ -224,7 +226,7 @@ private abstract class GeneratedEdmModel
global::System.IO.Stream stream = assembly.GetManifestResourceStream(resourcePath);
return global::System.Xml.XmlReader.Create(new global::System.IO.StreamReader(stream));
}
catch(global::System.Xml.XmlException e)
catch (global::System.Xml.XmlException e)
{
throw new global::System.Xml.XmlException("Failed to create an XmlReader from the stream. Check if the resource exists.", e);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@

// Generation date: 6/15/2020 2:29:08 PM

using Checkmarx.API.Models;

namespace Default
{
/// <summary>
Expand Down Expand Up @@ -42,7 +44,7 @@ public ODataClient8(global::System.Uri serviceRoot) :
{
this._Projects = base.CreateQuery<global::CxDataRepository.Project>("Projects");
}
return this._Projects;
return new RetryableDataServiceQuery<global::CxDataRepository.Project>(this._Projects);
}
}
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "#VersionNumber#")]
Expand All @@ -59,7 +61,7 @@ public ODataClient8(global::System.Uri serviceRoot) :
{
this._Scans = base.CreateQuery<global::CxDataRepository.Scan>("Scans");
}
return this._Scans;
return new RetryableDataServiceQuery<global::CxDataRepository.Scan>(this._Scans);
}
}
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "#VersionNumber#")]
Expand All @@ -76,7 +78,7 @@ public ODataClient8(global::System.Uri serviceRoot) :
{
this._Results = base.CreateQuery<global::CxDataRepository.Result>("Results");
}
return this._Results;
return new RetryableDataServiceQuery<global::CxDataRepository.Result>(this._Results);
}
}
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "#VersionNumber#")]
Expand Down
Loading

0 comments on commit 75ea655

Please sign in to comment.