Skip to content

Commit 10efe5b

Browse files
author
gauffininteractive
committed
Sorry for the large Commit
* Cleanup using Resharper (code reformat for future pull requests and readability) * Added background jobs to delete old Reports * Migrated to claims based authorization (ASP.NET Identity without EF)
1 parent 7c0102e commit 10efe5b

File tree

579 files changed

+18510
-12376
lines changed

Some content is hidden

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

579 files changed

+18510
-12376
lines changed

src/Server/OneTrueError.Api.Client.Tests/Properties/AssemblyInfo.cs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
using System.Reflection;
2-
using System.Runtime.CompilerServices;
32
using System.Runtime.InteropServices;
43

54
// General Information about an assembly is controlled through the following
65
// set of attributes. Change these attribute values to modify the information
76
// associated with an assembly.
7+
88
[assembly: AssemblyTitle("OneTrueError.Api.Client.Tests")]
99
[assembly: AssemblyDescription("")]
1010
[assembly: AssemblyConfiguration("")]
@@ -17,9 +17,11 @@
1717
// Setting ComVisible to false makes the types in this assembly not visible
1818
// to COM components. If you need to access a type in this assembly from
1919
// COM, set the ComVisible attribute to true on that type.
20+
2021
[assembly: ComVisible(false)]
2122

2223
// The following GUID is for the ID of the typelib if this project is exposed to COM
24+
2325
[assembly: Guid("62989500-31bc-44fa-97ca-84f484c6f1aa")]
2426

2527
// Version information for an assembly consists of the following four values:
@@ -32,5 +34,6 @@
3234
// You can specify all the values or you can default the Build and Revision Numbers
3335
// by using the '*' as shown below:
3436
// [assembly: AssemblyVersion("1.0.*")]
37+
3538
[assembly: AssemblyVersion("1.0.0.0")]
36-
[assembly: AssemblyFileVersion("1.0.0.0")]
39+
[assembly: AssemblyFileVersion("1.0.0.0")]
Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
using System;
2-
using System.Collections.Generic;
3-
using System.Linq;
42
using System.Net;
5-
using System.Text;
63
using System.Threading.Tasks;
74
using FluentAssertions;
85
using OneTrueError.Api.Core.Accounts.Queries;
@@ -16,21 +13,20 @@ public class TryTheClient
1613
[Fact]
1714
public async Task Test()
1815
{
19-
OneTrueApiClient client = new OneTrueApiClient();
16+
var client = new OneTrueApiClient();
2017
client.Open(new Uri("http://localhost/onetrueerror/"), "", "");
2118
FindAccountByUserNameResult result = null;
2219
try
2320
{
2421
result = await client.QueryAsync(new FindAccountByUserName("admin"));
2522
}
26-
catch (WebException ex)
23+
catch (WebException ex)
2724
{
28-
2925
}
3026

3127

3228
result.Should().NotBeNull();
3329
}
3430
}
3531
#endif
36-
}
32+
}

src/Server/OneTrueError.Api.Client.Tests/packages.config

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<?xml version="1.0" encoding="utf-8"?>
2+
23
<packages>
34
<package id="DotNetCqs" version="1.0.0" targetFramework="net452" />
45
<package id="FluentAssertions" version="4.14.0" targetFramework="net452" />

src/Server/OneTrueError.Api.Client/OneTrueClient.cs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,23 +14,23 @@ namespace OneTrueError.Api.Client
1414
/// </summary>
1515
public class OneTrueApiClient : IQueryBus, ICommandBus, IEventBus
1616
{
17-
private string _apiKey;
18-
1917
private readonly JsonSerializerSettings _jsonSerializerSettings = new JsonSerializerSettings
2018
{
2119
ConstructorHandling = ConstructorHandling.AllowNonPublicDefaultConstructor,
2220
Formatting = Formatting.Indented
2321
};
2422

23+
private string _apiKey;
24+
2525
private string _sharedSecret;
2626
private Uri _uri;
2727

2828

2929
/// <summary>
3030
/// Creates a new instance of <see cref="OneTrueApiClient" />.
3131
/// </summary>
32-
public OneTrueApiClient() {
33-
32+
public OneTrueApiClient()
33+
{
3434
_jsonSerializerSettings.ContractResolver = new IncludeNonPublicMembersContractResolver();
3535
}
3636

@@ -111,9 +111,9 @@ private async Task<HttpWebResponse> RequestAsync(string httpMethod, string cqsTy
111111
var json = JsonConvert.SerializeObject(cqsObject, _jsonSerializerSettings);
112112
var buffer = Encoding.UTF8.GetBytes(json);
113113

114-
var hamc = new HMACSHA256(Encoding.UTF8.GetBytes(_sharedSecret.ToLower()));
115-
var hash = hamc.ComputeHash(buffer);
116-
var signature = Convert.ToBase64String(hash);
114+
var hamc = new HMACSHA256(Encoding.UTF8.GetBytes(_sharedSecret.ToLower()));
115+
var hash = hamc.ComputeHash(buffer);
116+
var signature = Convert.ToBase64String(hash);
117117

118118
await stream.WriteAsync(buffer, 0, buffer.Length);
119119

src/Server/OneTrueError.Api.Client/Properties/AssemblyInfo.cs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
using System.Reflection;
2-
using System.Runtime.CompilerServices;
32
using System.Runtime.InteropServices;
43

54
// General Information about an assembly is controlled through the following
65
// set of attributes. Change these attribute values to modify the information
76
// associated with an assembly.
7+
88
[assembly: AssemblyTitle("OneTrueError.Api.Client")]
99
[assembly: AssemblyDescription("")]
1010
[assembly: AssemblyConfiguration("")]
@@ -17,9 +17,11 @@
1717
// Setting ComVisible to false makes the types in this assembly not visible
1818
// to COM components. If you need to access a type in this assembly from
1919
// COM, set the ComVisible attribute to true on that type.
20+
2021
[assembly: ComVisible(false)]
2122

2223
// The following GUID is for the ID of the typelib if this project is exposed to COM
24+
2325
[assembly: Guid("017f8863-3de0-4ad2-9ed3-5acb87bbbcd0")]
2426

2527
// Version information for an assembly consists of the following four values:
@@ -32,5 +34,6 @@
3234
// You can specify all the values or you can default the Build and Revision Numbers
3335
// by using the '*' as shown below:
3436
// [assembly: AssemblyVersion("1.0.*")]
37+
3538
[assembly: AssemblyVersion("1.0.0.0")]
36-
[assembly: AssemblyFileVersion("1.0.0.0")]
39+
[assembly: AssemblyFileVersion("1.0.0.0")]
Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,9 @@
11
using System;
2-
using System.Collections.Generic;
3-
using System.Linq;
42
using System.Text;
5-
using System.Threading.Tasks;
63

7-
namespace OneTrueError.Api.Client.Tests
4+
namespace OneTrueError.Api.Client
85
{
9-
static class StringBuilderExtensions
6+
internal static class StringBuilderExtensions
107
{
118
public static void AppendUrlEncoded(this StringBuilder sb, string name, string value)
129
{
@@ -16,6 +13,5 @@ public static void AppendUrlEncoded(this StringBuilder sb, string name, string v
1613
sb.Append("=");
1714
sb.Append(Uri.EscapeDataString(value));
1815
}
19-
2016
}
21-
}
17+
}

src/Server/OneTrueError.Api.Client/packages.config

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<?xml version="1.0" encoding="utf-8"?>
2+
23
<packages>
34
<package id="DotNetCqs" version="1.0.0" targetFramework="net452" />
45
<package id="Newtonsoft.Json" version="9.0.1" targetFramework="net452" />

src/Server/OneTrueError.Api/Core/Accounts/Commands/RegisterAccount.cs

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@
44
namespace OneTrueError.Api.Core.Accounts.Commands
55
{
66
/// <summary>
7-
/// Register a new account and send out an activation email.
7+
/// Register a new account and send out an activation email.
88
/// </summary>
99
public class RegisterAccount : Command
1010
{
1111
/// <summary>
12-
/// Creates a new instance of <see cref="RegisterAccount"/>
12+
/// Creates a new instance of <see cref="RegisterAccount" />
1313
/// </summary>
1414
/// <param name="userName">User name</param>
1515
/// <param name="password">Password as entered by the user</param>
@@ -25,26 +25,25 @@ public RegisterAccount(string userName, string password, string email)
2525
}
2626

2727
/// <summary>
28-
/// Serialization constructor.
28+
/// Serialization constructor.
2929
/// </summary>
3030
protected RegisterAccount()
3131
{
32-
3332
}
3433

3534
/// <summary>
36-
/// User name
35+
/// Email address.
3736
/// </summary>
38-
public string UserName { get; private set; }
37+
public string Email { get; private set; }
3938

4039
/// <summary>
41-
/// Password as entered by the user.
40+
/// Password as entered by the user.
4241
/// </summary>
4342
public string Password { get; private set; }
4443

4544
/// <summary>
46-
/// Email address.
45+
/// User name
4746
/// </summary>
48-
public string Email { get; private set; }
47+
public string UserName { get; private set; }
4948
}
5049
}

src/Server/OneTrueError.Api/Core/Accounts/Events/AccountRegistered.cs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ namespace OneTrueError.Api.Core.Accounts.Events
99
public class AccountRegistered : ApplicationEvent
1010
{
1111
/// <summary>
12-
/// Create a new instance of <see cref="AccountRegistered"/>-
12+
/// Create a new instance of <see cref="AccountRegistered" />-
1313
/// </summary>
1414
/// <param name="accountId">Account id (primary key).</param>
1515
/// <param name="userName">User name as entered by the user.</param>
@@ -22,20 +22,19 @@ public AccountRegistered(int accountId, string userName)
2222
}
2323

2424
/// <summary>
25-
/// Serialization constructor
25+
/// Serialization constructor
2626
/// </summary>
2727
protected AccountRegistered()
2828
{
29-
3029
}
3130

3231
/// <summary>
33-
/// Account id (primary key).
32+
/// Account id (primary key).
3433
/// </summary>
3534
public int AccountId { get; private set; }
3635

3736
/// <summary>
38-
/// User name as entered by the user.
37+
/// User name as entered by the user.
3938
/// </summary>
4039
public string UserName { get; private set; }
4140
}

src/Server/OneTrueError.Api/Core/Accounts/Events/InvitationAccepted.cs

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ namespace OneTrueError.Api.Core.Accounts.Events
99
public class InvitationAccepted : ApplicationEvent
1010
{
1111
/// <summary>
12-
/// Creates a new instance of <see cref="InvitationAccepted"/>.
12+
/// Creates a new instance of <see cref="InvitationAccepted" />.
1313
/// </summary>
1414
/// <param name="accountId">account that accepted the inviation</param>
1515
/// <param name="invitedByUserName">user that made the invite</param>
@@ -27,12 +27,17 @@ public InvitationAccepted(int accountId, string invitedByUserName, string userNa
2727
}
2828

2929
/// <summary>
30-
/// Serialization constructor.
30+
/// Serialization constructor.
3131
/// </summary>
3232
protected InvitationAccepted()
3333
{
3434
}
3535

36+
/// <summary>
37+
/// The email that the inviation was accepted by.
38+
/// </summary>
39+
public string AcceptedEmailAddress { get; set; }
40+
3641
/// <summary>
3742
/// Id of the user that accepted the invitation
3843
/// </summary>
@@ -49,13 +54,13 @@ protected InvitationAccepted()
4954
public string InvitedByUserName { get; set; }
5055

5156
/// <summary>
52-
/// The user that accepted the invitation
57+
/// Email address that the invitation was sent to.
5358
/// </summary>
54-
public string UserName { get; set; }
59+
public string InvitedEmailAddress { get; set; }
5560

5661
/// <summary>
57-
/// Email address of the user that accepted the invitation
62+
/// The user that accepted the invitation
5863
/// </summary>
59-
public string EmailAddress { get; set; }
64+
public string UserName { get; set; }
6065
}
6166
}

0 commit comments

Comments
 (0)