Skip to content
Permalink
Browse files

Merge with origin

  • Loading branch information
jgauffin committed Nov 16, 2019
2 parents f8c2390 + fc97f72 commit 9318dfc8d66ca5b43750da351d83546e5309f7a3
Showing with 4,920 additions and 328 deletions.
  1. +0 −1 .gitignore
  2. +9 −9 src/Server/Coderr.Server.Api.Client/Coderr.Server.Api.Client.csproj
  3. +13 −13 src/Server/Coderr.Server.Api/Coderr.Server.Api.csproj
  4. +24 −0 src/Server/Coderr.Server.Api/Modules/Whitelists/Commands/AddEntry.cs
  5. +25 −0 src/Server/Coderr.Server.Api/Modules/Whitelists/Commands/EditEntry.cs
  6. +2 −1 ...portAnalyzer.Abstractions/Inbound → Coderr.Server.Api/Modules}/Whitelists/Commands/RemoveEntry.cs
  7. +2 −6 ...lyzer.Abstractions/Inbound → Coderr.Server.Api/Modules}/Whitelists/Queries/GetWhitelistEntries.cs
  8. +1 −1 ...Abstractions/Inbound → Coderr.Server.Api/Modules}/Whitelists/Queries/GetWhitelistEntriesResult.cs
  9. +3 −2 ...ractions/Inbound → Coderr.Server.Api/Modules}/Whitelists/Queries/GetWhitelistEntriesResultItem.cs
  10. +8 −0 src/Server/Coderr.Server.Api/Modules/Whitelists/Queries/GetWhitelistEntriesResultItemApp.cs
  11. +11 −0 src/Server/Coderr.Server.Api/Modules/Whitelists/Queries/GetWhitelistEntriesResultItemIp.cs
  12. +23 −0 src/Server/Coderr.Server.Api/Modules/Whitelists/Queries/ResultItemIpType.cs
  13. +3 −2 src/Server/Coderr.Server.App/Coderr.Server.App.csproj
  14. +1 −1 src/Server/Coderr.Server.App/Core/Incidents/Commands/CloseIncidentHandler.cs
  15. +17 −0 src/Server/Coderr.Server.App/Modules/Whitelists/IWhitelistRepository.cs
  16. +27 −0 src/Server/Coderr.Server.App/Modules/Whitelists/IWhitelistService.cs
  17. +23 −0 src/Server/Coderr.Server.App/Modules/Whitelists/IpType.cs
  18. +28 −0 src/Server/Coderr.Server.App/Modules/Whitelists/Whitelist.cs
  19. +118 −0 src/Server/Coderr.Server.App/Modules/Whitelists/WhitelistService.cs
  20. +36 −0 src/Server/Coderr.Server.App/Modules/Whitelists/WhitelistedDomainIp.cs
  21. +8 −1 src/Server/Coderr.Server.Domain/Core/Incidents/Incident.cs
  22. +1 −1 src/Server/Coderr.Server.Infrastructure/Coderr.Server.Infrastructure.csproj
  23. +0 −23 src/Server/Coderr.Server.ReportAnalyzer.Abstractions/Inbound/Whitelists/Commands/AddDomain.cs
  24. +2 −2 src/Server/Coderr.Server.ReportAnalyzer/Coderr.Server.ReportAnalyzer.csproj
  25. +2 −2 src/Server/Coderr.Server.ReportAnalyzer/Feedback/Handlers/StoreFeedbackFromNewReports.cs
  26. +0 −1 src/Server/Coderr.Server.ReportAnalyzer/Inbound/Handlers/ProcessFeedbackHandler.cs
  27. +8 −9 src/Server/Coderr.Server.ReportAnalyzer/Inbound/Handlers/Reports/ReportAnalyzer.cs
  28. +1 −0 src/Server/Coderr.Server.ReportAnalyzer/Inbound/SaveReportHandler.cs
  29. +0 −26 src/Server/Coderr.Server.ReportAnalyzer/Inbound/Whitelist/AddDomainHandler.cs
  30. +0 −40 src/Server/Coderr.Server.ReportAnalyzer/Inbound/Whitelist/GetWhitelistEntriesHandler.cs
  31. +0 −16 src/Server/Coderr.Server.ReportAnalyzer/Inbound/Whitelist/WhitelistedDomain.cs
  32. +0 −17 src/Server/Coderr.Server.ReportAnalyzer/Inbound/Whitelist/WhitelistedDomainMapper.cs
  33. +6 −5 src/Server/Coderr.Server.ReportAnalyzer/Incidents/IncidentBeingAnalyzed.cs
  34. +3 −4 src/Server/Coderr.Server.ReportAnalyzer/Similarities/Handlers/UpdateSimilaritiesFromNewReport.cs
  35. +1 −1 src/Server/Coderr.Server.SqlServer.Tests/Coderr.Server.SqlServer.Tests.csproj
  36. +6 −1 src/Server/Coderr.Server.SqlServer/Coderr.Server.SqlServer.csproj
  37. +24 −1 src/Server/Coderr.Server.SqlServer/Core/Environments/ResetEnvironmentHandler.cs
  38. +8 −0 src/Server/Coderr.Server.SqlServer/Core/Feedback/SubmitFeedbackHandler.cs
  39. +3 −1 src/Server/Coderr.Server.SqlServer/Core/Incidents/IncidentRepository.cs
  40. +42 −28 src/Server/Coderr.Server.SqlServer/Core/Incidents/Queries/FindIncidentsHandler.cs
  41. +2 −5 src/Server/Coderr.Server.SqlServer/Core/Reports/ReportMappingMapper.cs
  42. +84 −0 src/Server/Coderr.Server.SqlServer/Modules/Whitelists/AddEntryHandler.cs
  43. +160 −0 src/Server/Coderr.Server.SqlServer/Modules/Whitelists/EditEntryHandler.cs
  44. +142 −0 src/Server/Coderr.Server.SqlServer/Modules/Whitelists/GetWhitelistEntriesHandler.cs
  45. +6 −3 ...rtAnalyzer/Inbound/Whitelist → Coderr.Server.SqlServer/Modules/Whitelists}/RemoveDomainHandler.cs
  46. +83 −0 src/Server/Coderr.Server.SqlServer/Modules/Whitelists/WhitelistRepository.cs
  47. +10 −0 src/Server/Coderr.Server.SqlServer/Modules/Whitelists/WhitelistedDomainApplication.cs
  48. +11 −0 src/Server/Coderr.Server.SqlServer/Modules/Whitelists/WhitelistedDomainApplicationMapper.cs
  49. +19 −0 src/Server/Coderr.Server.SqlServer/Modules/Whitelists/WhitelistedDomainIpMapper.cs
  50. +17 −0 src/Server/Coderr.Server.SqlServer/Modules/Whitelists/WhitelistedDomainMapper.cs
  51. +2 −1 src/Server/Coderr.Server.SqlServer/ReportAnalyzer/AnalyticsRepository.cs
  52. +21 −0 src/Server/Coderr.Server.SqlServer/Schema/Coderr.v21.sql
  53. +4 −0 src/Server/Coderr.Server.SqlServer/Web/Feedback/Queries/GetIncidentFeedbackItemsHandler.cs
  54. +1 −1 src/Server/Coderr.Server.Web/Boot/Modules/BackgroundJobs.cs
  55. +13 −3 src/Server/Coderr.Server.Web/ClientApp/boot.ts
  56. +16 −7 src/Server/Coderr.Server.Web/ClientApp/components/discover/incidents/search.ts
  57. +8 −2 src/Server/Coderr.Server.Web/ClientApp/components/home/navmenu/navmenu.ts
  58. +2 −2 src/Server/Coderr.Server.Web/ClientApp/components/manage/application/environments/environments.ts
  59. +8 −0 src/Server/Coderr.Server.Web/ClientApp/components/manage/application/settings/settings.ts
  60. +5 −2 src/Server/Coderr.Server.Web/ClientApp/components/manage/application/settings/settings.vue.html
  61. +4 −4 src/Server/Coderr.Server.Web/ClientApp/components/manage/system/menu.vue.html
  62. +99 −0 src/Server/Coderr.Server.Web/ClientApp/components/manage/system/whitelist/add.ts
  63. +68 −0 src/Server/Coderr.Server.Web/ClientApp/components/manage/system/whitelist/add.vue.html
  64. +144 −0 src/Server/Coderr.Server.Web/ClientApp/components/manage/system/whitelist/edit.ts
  65. +72 −0 src/Server/Coderr.Server.Web/ClientApp/components/manage/system/whitelist/edit.vue.html
  66. +95 −6 src/Server/Coderr.Server.Web/ClientApp/components/manage/system/whitelist/home.ts
  67. +25 −18 src/Server/Coderr.Server.Web/ClientApp/components/manage/system/whitelist/home.vue.html
  68. +1 −0 src/Server/Coderr.Server.Web/ClientApp/dto/Core/Incidents.ts
  69. +40 −14 src/Server/Coderr.Server.Web/ClientApp/dto/Core/Whitelist.ts
  70. +10 −1 src/Server/Coderr.Server.Web/ClientApp/services/applications/ApplicationService.ts
  71. +2 −2 src/Server/Coderr.Server.Web/Coderr.Server.Web.csproj
  72. +7 −2 src/Server/Coderr.Server.Web/Controllers/CqsController.cs
  73. +6 −6 src/Server/Coderr.Server.Web/Controllers/FeedbackReceiverController.cs
  74. +15 −25 src/Server/Coderr.Server.Web/Controllers/ReportReceiverController.cs
  75. +1 −0 src/Server/Coderr.Server.Web/Program.cs
  76. +1 −1 src/Server/Coderr.Server.Web/Startup.cs
  77. +4 −3 src/Server/Coderr.Server.Web/appsettings.Publish.json
  78. +2 −2 src/Server/Coderr.Server.Web/appsettings.json
  79. +2 −1 src/Server/Coderr.Server.Web/npm-shrinkwrap.json
  80. +2 −2 src/Server/Coderr.Server.Web/tsconfig.json
  81. +2 −0 src/Server/copy local nuget.cmd
  82. +49 −0 src/Tools/Coderr.IntegrationTests/Coderr.IntegrationTests.sln
  83. +24 −0 src/Tools/Coderr.IntegrationTests/Coderr.IntegrationTests/ActionExtensions.cs
  84. +24 −0 src/Tools/Coderr.IntegrationTests/Coderr.IntegrationTests/Coderr.IntegrationTests.Core.csproj
  85. +42 −0 src/Tools/Coderr.IntegrationTests/Coderr.IntegrationTests/CoderrFixture.cs
  86. +174 −0 src/Tools/Coderr.IntegrationTests/Coderr.IntegrationTests/Entities/IncidentWrapper.cs
  87. +44 −0 src/Tools/Coderr.IntegrationTests/Coderr.IntegrationTests/TestCases/EnvironmentTests.cs
  88. +55 −0 src/Tools/Coderr.IntegrationTests/Coderr.IntegrationTests/TestCases/IncidentLifecycle.cs
  89. +114 −0 src/Tools/Coderr.IntegrationTests/Coderr.IntegrationTests/TestCases/UserReportTests.cs
  90. +251 −0 src/Tools/Coderr.IntegrationTests/Coderr.IntegrationTests/TestCases/WhitelistTests.cs
  91. +75 −0 src/Tools/Coderr.IntegrationTests/Coderr.IntegrationTests/Tools/ApplicationClient.cs
  92. +138 −0 src/Tools/Coderr.IntegrationTests/Coderr.IntegrationTests/Tools/Reporter.cs
  93. +222 −0 src/Tools/Coderr.IntegrationTests/Coderr.IntegrationTests/Tools/ReportingApiClient.cs
  94. +54 −0 src/Tools/Coderr.IntegrationTests/Coderr.IntegrationTests/Tools/SqlTools.cs
  95. +32 −0 src/Tools/Coderr.IntegrationTests/Coderr.IntegrationTests/Tools/TestExtensions.cs
  96. +15 −0 src/Tools/Coderr.IntegrationTests/Coderr.Tests.Runner.Resharper/AssemblyRegistration.cs
  97. +60 −0 src/Tools/Coderr.IntegrationTests/Coderr.Tests.Runner.Resharper/Class1.cs
  98. +14 −0 src/Tools/Coderr.IntegrationTests/Coderr.Tests.Runner.Resharper/Coderr.Tests.Runner.Resharper.csproj
  99. +28 −0 src/Tools/Coderr.IntegrationTests/Coderr.Tests.Runner.Resharper/DeclaredElementProvider.cs
  100. +4 −0 ...ols/Coderr.IntegrationTests/Coderr.Tests.VisualStudio.TestAdapter/Coderr.Tests.TestAdapter.csproj
  101. +42 −0 ...tegrationTests/Coderr.Tests.VisualStudio.TestAdapter/Coderr.Tests.VisualStudio.TestAdapter.csproj
  102. +21 −0 src/Tools/Coderr.IntegrationTests/Coderr.Tests.VisualStudio.TestAdapter/Constants.cs
  103. +61 −0 src/Tools/Coderr.IntegrationTests/Coderr.Tests.VisualStudio.TestAdapter/Discoverer.cs
  104. +174 −0 src/Tools/Coderr.IntegrationTests/Coderr.Tests.VisualStudio.TestAdapter/Executor.cs
  105. +22 −0 src/Tools/Coderr.IntegrationTests/Coderr.Tests.VisualStudio.TestAdapter/TestData.cs
  106. +68 −0 src/Tools/Coderr.IntegrationTests/Coderr.Tests.VisualStudio.TestAdapter/TestResultProxy.cs
  107. +24 −0 src/Tools/Coderr.IntegrationTests/Coderr.Tests/ActionExtensions.cs
  108. +9 −0 src/Tools/Coderr.IntegrationTests/Coderr.Tests/Attributes/RunOnlyThisOneAttribute.cs
  109. +9 −0 src/Tools/Coderr.IntegrationTests/Coderr.Tests/Attributes/TestAttribute.cs
  110. +9 −0 src/Tools/Coderr.IntegrationTests/Coderr.Tests/Attributes/TestInit.cs
  111. +37 −0 src/Tools/Coderr.IntegrationTests/Coderr.Tests/Coderr.Tests.csproj
  112. +22 −0 src/Tools/Coderr.IntegrationTests/Coderr.Tests/DependencyInjection/ContainerServiceAttribute.cs
  113. +16 −0 src/Tools/Coderr.IntegrationTests/Coderr.Tests/DependencyInjection/IAssemblyFixture.cs
  114. +107 −0 src/Tools/Coderr.IntegrationTests/Coderr.Tests/Domain/TestClass.cs
  115. +60 −0 src/Tools/Coderr.IntegrationTests/Coderr.Tests/Domain/TestMethod.cs
  116. +53 −0 src/Tools/Coderr.IntegrationTests/Coderr.Tests/Domain/TestResult.cs
  117. +20 −0 src/Tools/Coderr.IntegrationTests/Coderr.Tests/Events/AggregateEventReceiver.cs
  118. +7 −0 src/Tools/Coderr.IntegrationTests/Coderr.Tests/Events/IEventReceiver.cs
  119. +14 −0 src/Tools/Coderr.IntegrationTests/Coderr.Tests/Events/TestClassFinished.cs
  120. +17 −0 src/Tools/Coderr.IntegrationTests/Coderr.Tests/Events/TestClassStarted.cs
  121. +30 −0 src/Tools/Coderr.IntegrationTests/Coderr.Tests/Events/TestMethodFinished.cs
  122. +24 −0 src/Tools/Coderr.IntegrationTests/Coderr.Tests/Events/TestMethodStarted.cs
  123. +14 −0 src/Tools/Coderr.IntegrationTests/Coderr.Tests/ITestDiscoverer.cs
  124. +44 −0 src/Tools/Coderr.IntegrationTests/Coderr.Tests/Logging/ConsoleLogger.cs
  125. +99 −0 src/Tools/Coderr.IntegrationTests/Coderr.Tests/Runners/AppDomain/AssemblyLoaderProxy.cs
  126. +21 −0 src/Tools/Coderr.IntegrationTests/Coderr.Tests/Runners/AppDomain/DTO/RunTests.cs
  127. +17 −0 src/Tools/Coderr.IntegrationTests/Coderr.Tests/Runners/AppDomain/DTO/TestCaseToRun.cs
  128. +13 −0 src/Tools/Coderr.IntegrationTests/Coderr.Tests/Runners/AppDomain/DTO/TestOutcome.cs
  129. +20 −0 src/Tools/Coderr.IntegrationTests/Coderr.Tests/Runners/AppDomain/DTO/TestResult.cs
  130. +13 −0 src/Tools/Coderr.IntegrationTests/Coderr.Tests/Runners/AppDomain/ITestResultReceiver.cs
  131. +30 −0 src/Tools/Coderr.IntegrationTests/Coderr.Tests/Runners/AppDomain/TestResultReporter.cs
  132. +72 −0 src/Tools/Coderr.IntegrationTests/Coderr.Tests/Runners/AppDomain/TestRunnerProxy.cs
  133. +63 −0 src/Tools/Coderr.IntegrationTests/Coderr.Tests/Runners/AppDomainRunner.cs
  134. +193 −0 src/Tools/Coderr.IntegrationTests/Coderr.Tests/Runners/TestRunner.cs
  135. +133 −0 src/Tools/Coderr.IntegrationTests/Coderr.Tests/TestDiscoverer.cs
  136. +15 −0 src/Tools/Coderr.IntegrationTests/Coderr.Tests/TestFailedException.cs
  137. +6 −0 src/Tools/Coderr.IntegrationTests/ConsoleApp1/App.config
  138. +68 −0 src/Tools/Coderr.IntegrationTests/ConsoleApp1/ConsoleApp1.csproj
  139. +24 −0 src/Tools/Coderr.IntegrationTests/ConsoleApp1/ConsoleReceiver.cs
  140. +38 −0 src/Tools/Coderr.IntegrationTests/ConsoleApp1/Program.cs
  141. +36 −0 src/Tools/Coderr.IntegrationTests/ConsoleApp1/Properties/AssemblyInfo.cs
  142. +2 −0 src/Tools/Coderr.IntegrationTests/copy local nuget.cmd
  143. +14 −0 src/Tools/Coderr.IntegrationTests/test/UnitTest1.cs
  144. +15 −0 src/Tools/Coderr.IntegrationTests/test/test.csproj
@@ -26,7 +26,6 @@ Thumbs.db
obj/
[Rr]elease*/
_ReSharper*/
[Tt]est[Rr]esult*
*/packages/*/
**/.vs/*
**/packages/*/
@@ -1,28 +1,28 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>netstandard2.0</TargetFrameworks>
<Version>1.1.0</Version>
<Version>2.1.3</Version>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<DocumentationFile>bin\$(Configuration)\$(TargetFramework)\Coderr.Server.Api.Client.xml</DocumentationFile>
<RootNamespace>Coderr.Server.Api.Client</RootNamespace>
<AssemblyName>Coderr.Server.Api.Client</AssemblyName>
</PropertyGroup>
<PropertyGroup>
<PackageId>Coderr.Server.Api.Client</PackageId>
<Authors>1TCompany AB</Authors>
<Description>API client for codeRR Server.</Description>
<Description>API client for Coderr Server.</Description>
<PackageRequireLicenseAcceptance>true</PackageRequireLicenseAcceptance>
<PackageReleaseNotes>Converted to vstudio 2017 csproj format</PackageReleaseNotes>
<Copyright>Copyright 2017 © 1TCompany AB. All rights reserved.</Copyright>
<PackageTags>logger exceptions analysis .net-core netstandard</PackageTags>
<PackageIconUrl>http://coderrapp.com/images/nuget_icon.png</PackageIconUrl>
<RepositoryUrl>https://github.com/coderr/coderr.server</RepositoryUrl>
<PackageIconUrl>https://coderr.io/images/nuget_icon.png</PackageIconUrl>
<RepositoryUrl>https://github.com/coderrio/coderr.server</RepositoryUrl>
<RepositoryType>git</RepositoryType>
<PackageLicenseUrl>https://raw.githubusercontent.com/coderr/codeRR.Server/master/LICENSE</PackageLicenseUrl>
<PackageProjectUrl>https://coderrapp.com</PackageProjectUrl>
<RootNamespace>Coderr.Server.Api.Client</RootNamespace>
<AssemblyName>Coderr.Server.Api.Client</AssemblyName>
<PackageLicenseExpression>Apache-2.0</PackageLicenseExpression>
<PackageProjectUrl>https://coderr.io</PackageProjectUrl>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="DotNetCqs" Version="2.0.14" />
<PackageReference Include="DotNetCqs" Version="2.0.15" />
<PackageReference Include="System.ComponentModel.Annotations" Version="4.6.0" />
</ItemGroup>
<ItemGroup>
@@ -1,31 +1,31 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<Version>1.1.0</Version>
<Version>2.1.4</Version>
<DocumentationFile>bin\$(Configuration)\$(TargetFramework)\Coderr.Server.Api.xml</DocumentationFile>
<PackageReleaseNotes>Added the whitelist API</PackageReleaseNotes>
</PropertyGroup>
<PropertyGroup>
<RootNamespace>Coderr.Server.Api</RootNamespace>
<AssemblyName>Coderr.Server.Api</AssemblyName>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<DocumentationFile>bin\$(Configuration)\$(TargetFramework)\codeRR.Server.Api.xml</DocumentationFile>
</PropertyGroup>
<PropertyGroup>
<PackageId>codeRR.Server.Api</PackageId>
<PackageId>Coderr.Server.Api</PackageId>
<Authors>1TCompany AB</Authors>
<Description>CQRS API definition for codeRR Server.</Description>
<Description>API object definitions for Coderr Server, use the ApiClient package to communicate with the Coderr Server.</Description>
<PackageRequireLicenseAcceptance>true</PackageRequireLicenseAcceptance>
<PackageReleaseNotes>First release</PackageReleaseNotes>
<Copyright>Copyright 2017 © 1TCompany AB. All rights reserved.</Copyright>
<Copyright>Copyright 2019 © 1TCompany AB. All rights reserved.</Copyright>
<PackageTags>logger exceptions analysis .net-core netstandard</PackageTags>
<PackageIconUrl>http://coderrapp.com/images/nuget_icon.png</PackageIconUrl>
<RepositoryUrl>https://github.com/coderr/coderr.server</RepositoryUrl>
<PackageIconUrl>https://coderr.io/images/nuget_icon.png</PackageIconUrl>
<RepositoryUrl>https://github.com/coderrio/coderr.server</RepositoryUrl>
<RepositoryType>git</RepositoryType>
<PackageLicenseUrl>https://raw.githubusercontent.com/coderr/codeRR.Server/master/LICENSE</PackageLicenseUrl>
<PackageProjectUrl>https://coderrapp.com</PackageProjectUrl>
<PackageLicenseExpression>Apache-2.0</PackageLicenseExpression>
<PackageProjectUrl>https://coderr.io</PackageProjectUrl>
</PropertyGroup>
<PropertyGroup>
<NoWarn>1701;1702;1705;1591</NoWarn>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="DotNetCqs" Version="2.0.14" />
<PackageReference Include="DotNetCqs" Version="2.0.15" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'net452'">
<Reference Include="System.Net.Http" />
@@ -0,0 +1,24 @@
namespace Coderr.Server.Api.Modules.Whitelists.Commands
{
/// <summary>
/// Add a domain that may post error reports without using a shared secret (javascript applications)
/// </summary>
[Command]
public class AddEntry
{
/// <summary>
/// Applications that the domain is allowed for.
/// </summary>
public int[] ApplicationIds { get; set; } = new int[0];

/// <summary>
/// For instance <c>yourdomain.com</c>.
/// </summary>
public string DomainName { get; set; }

/// <summary>
/// To manually specify which IP addresses the domain matches.
/// </summary>
public string[] IpAddresses { get; set; } = new string[0];
}
}
@@ -0,0 +1,25 @@
namespace Coderr.Server.Api.Modules.Whitelists.Commands
{
/// <summary>
/// Edit a domain that may post error reports without using a shared secret (javascript applications)
/// </summary>
[Command]
public class EditEntry
{
/// <summary>
/// PK for the entry being edited.
/// </summary>
public int Id { get; set; }

/// <summary>
/// Applications that the domain is allowed for.
/// </summary>
public int[] ApplicationIds { get; set; } = new int[0];


/// <summary>
/// Only manually specified ip addresses.
/// </summary>
public string[] IpAddresses { get; set; } = new string[0];
}
}
@@ -1,8 +1,9 @@
namespace Coderr.Server.ReportAnalyzer.Abstractions.Inbound.Whitelists.Commands
namespace Coderr.Server.Api.Modules.Whitelists.Commands
{
/// <summary>
/// Remove a previously added white list entry
/// </summary>
[Command]
public class RemoveEntry
{
/// <summary>
@@ -1,10 +1,6 @@
using System;
using System.Collections.Generic;
using System.Text;
using Coderr.Server.Api;
using DotNetCqs;
using DotNetCqs;

namespace Coderr.Server.ReportAnalyzer.Abstractions.Inbound.Whitelists.Queries
namespace Coderr.Server.Api.Modules.Whitelists.Queries
{
/// <summary>
/// Get whitelist either by application id or DomainName
@@ -1,4 +1,4 @@
namespace Coderr.Server.ReportAnalyzer.Abstractions.Inbound.Whitelists.Queries
namespace Coderr.Server.Api.Modules.Whitelists.Queries
{
/// <summary>
/// Result for <see cref="GetWhitelistEntries"/>.
@@ -1,12 +1,13 @@
namespace Coderr.Server.ReportAnalyzer.Abstractions.Inbound.Whitelists.Queries
namespace Coderr.Server.Api.Modules.Whitelists.Queries
{
/// <summary>
/// Entry for <see cref="GetWhitelistEntriesResult"/>
/// </summary>
public class GetWhitelistEntriesResultItem
{
public int Id { get; set; }
public int? ApplicationId { get; set; }
public GetWhitelistEntriesResultItemIp[] IpAddresses { get; set; }
public GetWhitelistEntriesResultItemApp[] Applications { get; set; }
public string DomainName { get; set; }
}
}
@@ -0,0 +1,8 @@
namespace Coderr.Server.Api.Modules.Whitelists.Queries
{
public class GetWhitelistEntriesResultItemApp
{
public int ApplicationId { get; set; }
public string Name { get; set; }
}
}
@@ -0,0 +1,11 @@
using System;

namespace Coderr.Server.Api.Modules.Whitelists.Queries
{
public class GetWhitelistEntriesResultItemIp
{
public string Address { get; set; }
public DateTime UpdatedAtUtc { get; set; }
public ResultItemIpType Type { get; set; }
}
}
@@ -0,0 +1,23 @@
namespace Coderr.Server.Api.Modules.Whitelists.Queries
{
/// <summary>
/// Typ of stored IP record.
/// </summary>
public enum ResultItemIpType
{
/// <summary>
/// Added when doing a lookup for the domain
/// </summary>
Lookup = 0,

/// <summary>
/// Manually specified by the user
/// </summary>
Manual = 1,

/// <summary>
/// We got a request from this IP and a lookup didn't match it.
/// </summary>
Denied = 2
}
}
@@ -21,10 +21,11 @@
<PackageReference Include="ColorCode" Version="1.0.1">
<NoWarn>NU1701</NoWarn>
</PackageReference>
<PackageReference Include="DotNetCqs" Version="2.0.14" />
<PackageReference Include="DnsClient" Version="1.2.0" />
<PackageReference Include="DotNetCqs" Version="2.0.15" />
<PackageReference Include="Griffin.Framework" Version="2.1.1" />
<PackageReference Include="log4net" Version="2.0.8" />
<PackageReference Include="Markdig" Version="0.17.1" />
<PackageReference Include="Markdig" Version="0.18.0" />
<PackageReference Include="Newtonsoft.Json" Version="12.0.2" />
<PackageReference Include="System.Net.Http" Version="4.3.4" />
<PackageReference Include="UAParser" Version="3.1.43" />
@@ -42,7 +42,7 @@ public async Task HandleAsync(IMessageContext context, CloseIncident command)
if (command == null) throw new ArgumentNullException("command");

var incident = await _repository.GetAsync(command.IncidentId);
incident.Close(command.UserId, command.Solution);
incident.Close(command.UserId, command.Solution, command.ApplicationVersion);
if (command.ShareSolution)
incident.ShareSolution();

@@ -0,0 +1,17 @@
using System.Collections.Generic;
using System.Net;
using System.Threading.Tasks;

namespace Coderr.Server.App.Modules.Whitelists
{
/// <summary>
/// Whitelists is used for reports that don't use a shared secret
/// </summary>
public interface IWhitelistRepository
{
Task<WhitelistedDomainIp> FindIp(int applicationId, IPAddress address);
Task<IReadOnlyList<Whitelist>> FindWhitelists(int applicationId);

Task SaveIp(WhitelistedDomainIp entry);
}
}
@@ -0,0 +1,27 @@
using System.Net;
using System.Threading.Tasks;

namespace Coderr.Server.App.Modules.Whitelists
{
/// <summary>
/// Used to validate origin of inbound requests when a shared secret is not used.
/// </summary>
public interface IWhitelistService
{
/// <summary>
/// Is domain white listed?
/// </summary>
/// <param name="appKey">AppKey used when receiving error reports.</param>
/// <param name="remoteAddress">IP address of the client reporting the error.</param>
/// <returns></returns>
Task<bool> Validate(string appKey, IPAddress remoteAddress);

/// <summary>
/// Is domain white listed?
/// </summary>
/// <param name="applicationId">Application that the error is reported for.</param>
/// <param name="remoteAddress">IP address of the client reporting the error.</param>
/// <returns></returns>
Task<bool> Validate(int applicationId, IPAddress remoteAddress);
}
}
@@ -0,0 +1,23 @@
namespace Coderr.Server.App.Modules.Whitelists
{
/// <summary>
/// Typ of stored IP record.
/// </summary>
public enum IpType
{
/// <summary>
/// Added when doing a lookup for the domain
/// </summary>
Lookup = 0,

/// <summary>
/// Manually specified by the user
/// </summary>
Manual = 1,

/// <summary>
/// We got a request from this IP and a lookup didn't match it.
/// </summary>
Denied = 2
}
}
@@ -0,0 +1,28 @@
namespace Coderr.Server.App.Modules.Whitelists
{
/// <summary>
/// Domain that is allowed to report errors without
/// </summary>
public class Whitelist
{
/// <summary>
/// Domain name, must be an exact match. Can also be an IP address
/// </summary>
public string DomainName { get; set; }

/// <summary>
/// PK
/// </summary>
public int Id { get; set; }

/// <summary>
/// Addresses that have been stored for this domain
/// </summary>
public WhitelistedDomainIp[] IpAddresses { get; set; }

/// <summary>
/// Applications that this whitelist is allowed for
/// </summary>
public int[] ApplicationIds { get; set; }
}
}

0 comments on commit 9318dfc

Please sign in to comment.
You can’t perform that action at this time.