Skip to content

Commit 1f531c9

Browse files
authored
Whitelist (#73)
Added support for reporting without a shared secret. Enables applications without a .NET backend to report errors directly to a Coderr Server. Requires that the reporting applications is on a domain whitelist.
1 parent 63b0129 commit 1f531c9

File tree

140 files changed

+4850
-293
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

140 files changed

+4850
-293
lines changed

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ Thumbs.db
2626
obj/
2727
[Rr]elease*/
2828
_ReSharper*/
29-
[Tt]est[Rr]esult*
3029
*/packages/*/
3130
**/.vs/*
3231
**/packages/*/

src/Server/Coderr.Server.Api.Client/Coderr.Server.Api.Client.csproj

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,28 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
33
<TargetFrameworks>netstandard2.0</TargetFrameworks>
4-
<Version>1.1.0</Version>
4+
<Version>2.1.3</Version>
55
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
66
<DocumentationFile>bin\$(Configuration)\$(TargetFramework)\Coderr.Server.Api.Client.xml</DocumentationFile>
7+
<RootNamespace>Coderr.Server.Api.Client</RootNamespace>
8+
<AssemblyName>Coderr.Server.Api.Client</AssemblyName>
79
</PropertyGroup>
810
<PropertyGroup>
911
<PackageId>Coderr.Server.Api.Client</PackageId>
1012
<Authors>1TCompany AB</Authors>
11-
<Description>API client for codeRR Server.</Description>
13+
<Description>API client for Coderr Server.</Description>
1214
<PackageRequireLicenseAcceptance>true</PackageRequireLicenseAcceptance>
1315
<PackageReleaseNotes>Converted to vstudio 2017 csproj format</PackageReleaseNotes>
1416
<Copyright>Copyright 2017 © 1TCompany AB. All rights reserved.</Copyright>
1517
<PackageTags>logger exceptions analysis .net-core netstandard</PackageTags>
16-
<PackageIconUrl>http://coderrapp.com/images/nuget_icon.png</PackageIconUrl>
17-
<RepositoryUrl>https://github.com/coderr/coderr.server</RepositoryUrl>
18+
<PackageIconUrl>https://coderr.io/images/nuget_icon.png</PackageIconUrl>
19+
<RepositoryUrl>https://github.com/coderrio/coderr.server</RepositoryUrl>
1820
<RepositoryType>git</RepositoryType>
19-
<PackageLicenseUrl>https://raw.githubusercontent.com/coderr/codeRR.Server/master/LICENSE</PackageLicenseUrl>
20-
<PackageProjectUrl>https://coderrapp.com</PackageProjectUrl>
21-
<RootNamespace>Coderr.Server.Api.Client</RootNamespace>
22-
<AssemblyName>Coderr.Server.Api.Client</AssemblyName>
21+
<PackageLicenseExpression>Apache-2.0</PackageLicenseExpression>
22+
<PackageProjectUrl>https://coderr.io</PackageProjectUrl>
2323
</PropertyGroup>
2424
<ItemGroup>
25-
<PackageReference Include="DotNetCqs" Version="2.0.14" />
25+
<PackageReference Include="DotNetCqs" Version="2.0.15" />
2626
<PackageReference Include="System.ComponentModel.Annotations" Version="4.6.0" />
2727
</ItemGroup>
2828
<ItemGroup>

src/Server/Coderr.Server.Api/Coderr.Server.Api.csproj

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,31 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
33
<TargetFramework>netstandard2.0</TargetFramework>
4-
<Version>1.1.0</Version>
4+
<Version>2.1.4</Version>
5+
<DocumentationFile>bin\$(Configuration)\$(TargetFramework)\Coderr.Server.Api.xml</DocumentationFile>
6+
<PackageReleaseNotes>Added the whitelist API</PackageReleaseNotes>
7+
</PropertyGroup>
8+
<PropertyGroup>
59
<RootNamespace>Coderr.Server.Api</RootNamespace>
610
<AssemblyName>Coderr.Server.Api</AssemblyName>
711
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
8-
<DocumentationFile>bin\$(Configuration)\$(TargetFramework)\codeRR.Server.Api.xml</DocumentationFile>
9-
</PropertyGroup>
10-
<PropertyGroup>
11-
<PackageId>codeRR.Server.Api</PackageId>
12+
<PackageId>Coderr.Server.Api</PackageId>
1213
<Authors>1TCompany AB</Authors>
13-
<Description>CQRS API definition for codeRR Server.</Description>
14+
<Description>API object definitions for Coderr Server, use the ApiClient package to communicate with the Coderr Server.</Description>
1415
<PackageRequireLicenseAcceptance>true</PackageRequireLicenseAcceptance>
15-
<PackageReleaseNotes>First release</PackageReleaseNotes>
16-
<Copyright>Copyright 2017 © 1TCompany AB. All rights reserved.</Copyright>
16+
<Copyright>Copyright 2019 © 1TCompany AB. All rights reserved.</Copyright>
1717
<PackageTags>logger exceptions analysis .net-core netstandard</PackageTags>
18-
<PackageIconUrl>http://coderrapp.com/images/nuget_icon.png</PackageIconUrl>
19-
<RepositoryUrl>https://github.com/coderr/coderr.server</RepositoryUrl>
18+
<PackageIconUrl>https://coderr.io/images/nuget_icon.png</PackageIconUrl>
19+
<RepositoryUrl>https://github.com/coderrio/coderr.server</RepositoryUrl>
2020
<RepositoryType>git</RepositoryType>
21-
<PackageLicenseUrl>https://raw.githubusercontent.com/coderr/codeRR.Server/master/LICENSE</PackageLicenseUrl>
22-
<PackageProjectUrl>https://coderrapp.com</PackageProjectUrl>
21+
<PackageLicenseExpression>Apache-2.0</PackageLicenseExpression>
22+
<PackageProjectUrl>https://coderr.io</PackageProjectUrl>
2323
</PropertyGroup>
2424
<PropertyGroup>
2525
<NoWarn>1701;1702;1705;1591</NoWarn>
2626
</PropertyGroup>
2727
<ItemGroup>
28-
<PackageReference Include="DotNetCqs" Version="2.0.14" />
28+
<PackageReference Include="DotNetCqs" Version="2.0.15" />
2929
</ItemGroup>
3030
<ItemGroup Condition="'$(TargetFramework)' == 'net452'">
3131
<Reference Include="System.Net.Http" />
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
namespace Coderr.Server.Api.Modules.Whitelists.Commands
2+
{
3+
/// <summary>
4+
/// Add a domain that may post error reports without using a shared secret (javascript applications)
5+
/// </summary>
6+
[Command]
7+
public class AddEntry
8+
{
9+
/// <summary>
10+
/// Applications that the domain is allowed for.
11+
/// </summary>
12+
public int[] ApplicationIds { get; set; } = new int[0];
13+
14+
/// <summary>
15+
/// For instance <c>yourdomain.com</c>.
16+
/// </summary>
17+
public string DomainName { get; set; }
18+
19+
/// <summary>
20+
/// To manually specify which IP addresses the domain matches.
21+
/// </summary>
22+
public string[] IpAddresses { get; set; } = new string[0];
23+
}
24+
}
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
namespace Coderr.Server.Api.Modules.Whitelists.Commands
2+
{
3+
/// <summary>
4+
/// Edit a domain that may post error reports without using a shared secret (javascript applications)
5+
/// </summary>
6+
[Command]
7+
public class EditEntry
8+
{
9+
/// <summary>
10+
/// PK for the entry being edited.
11+
/// </summary>
12+
public int Id { get; set; }
13+
14+
/// <summary>
15+
/// Applications that the domain is allowed for.
16+
/// </summary>
17+
public int[] ApplicationIds { get; set; } = new int[0];
18+
19+
20+
/// <summary>
21+
/// Only manually specified ip addresses.
22+
/// </summary>
23+
public string[] IpAddresses { get; set; } = new string[0];
24+
}
25+
}
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
namespace Coderr.Server.ReportAnalyzer.Abstractions.Inbound.Whitelists.Commands
1+
namespace Coderr.Server.Api.Modules.Whitelists.Commands
22
{
33
/// <summary>
44
/// Remove a previously added white list entry
55
/// </summary>
6+
[Command]
67
public class RemoveEntry
78
{
89
/// <summary>
Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
1-
using System;
2-
using System.Collections.Generic;
3-
using System.Text;
4-
using Coderr.Server.Api;
5-
using DotNetCqs;
1+
using DotNetCqs;
62

7-
namespace Coderr.Server.ReportAnalyzer.Abstractions.Inbound.Whitelists.Queries
3+
namespace Coderr.Server.Api.Modules.Whitelists.Queries
84
{
95
/// <summary>
106
/// Get whitelist either by application id or DomainName
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
namespace Coderr.Server.ReportAnalyzer.Abstractions.Inbound.Whitelists.Queries
1+
namespace Coderr.Server.Api.Modules.Whitelists.Queries
22
{
33
/// <summary>
44
/// Result for <see cref="GetWhitelistEntries"/>.
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
1-
namespace Coderr.Server.ReportAnalyzer.Abstractions.Inbound.Whitelists.Queries
1+
namespace Coderr.Server.Api.Modules.Whitelists.Queries
22
{
33
/// <summary>
44
/// Entry for <see cref="GetWhitelistEntriesResult"/>
55
/// </summary>
66
public class GetWhitelistEntriesResultItem
77
{
88
public int Id { get; set; }
9-
public int? ApplicationId { get; set; }
9+
public GetWhitelistEntriesResultItemIp[] IpAddresses { get; set; }
10+
public GetWhitelistEntriesResultItemApp[] Applications { get; set; }
1011
public string DomainName { get; set; }
1112
}
1213
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
namespace Coderr.Server.Api.Modules.Whitelists.Queries
2+
{
3+
public class GetWhitelistEntriesResultItemApp
4+
{
5+
public int ApplicationId { get; set; }
6+
public string Name { get; set; }
7+
}
8+
}

0 commit comments

Comments
 (0)