Skip to content

Commit 47241d6

Browse files
author
gauffininteractive
committed
Corrected documentation and removed a small debug line
1 parent 935b5ad commit 47241d6

File tree

7 files changed

+49
-10
lines changed

7 files changed

+49
-10
lines changed

src/Server/OneTrueError.Api.Client.Tests/TryTheClient.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ public async Task Test()
2020
{
2121
result = await client.QueryAsync(new FindAccountByUserName("admin"));
2222
}
23-
catch (WebException ex)
23+
catch (WebException)
2424
{
2525
}
2626

src/Server/OneTrueError.Api/Core/ApiKeys/Events/ApiKeyCreated.cs

Lines changed: 44 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,29 +3,66 @@
33

44
namespace OneTrueError.Api.Core.ApiKeys.Events
55
{
6+
/// <summary>
7+
/// A new API key has been created.
8+
/// </summary>
69
public class ApiKeyCreated : ApplicationEvent
710
{
8-
private readonly int[] _applicationIds;
9-
11+
/// <summary>
12+
/// Creates a new instance of <see cref="ApiKeyCreated" />.
13+
/// </summary>
14+
/// <param name="applicationNameForTheAppUsingTheKey">Name of the application that integrates with OTE</param>
15+
/// <param name="apiKey">Actual key</param>
16+
/// <param name="sharedSecret">Used to authenticate the key</param>
17+
/// <param name="applicationIds">Applications that the key is allowed to access</param>
18+
/// <param name="createdById">User that created this key</param>
1019
public ApiKeyCreated(string applicationNameForTheAppUsingTheKey, string apiKey, string sharedSecret,
1120
int[] applicationIds,
1221
int createdById)
1322
{
1423
if (sharedSecret == null) throw new ArgumentNullException("sharedSecret");
15-
_applicationIds = applicationIds;
24+
ApplicationIds = applicationIds;
1625
ApplicationNameForTheAppUsingTheKey = applicationNameForTheAppUsingTheKey;
1726
ApiKey = apiKey;
1827
SharedSecret = sharedSecret;
1928
CreatedById = createdById;
2029
}
2130

31+
/// <summary>
32+
/// Serialization constructor
33+
/// </summary>
2234
protected ApiKeyCreated()
2335
{
2436
}
2537

26-
public string ApiKey { get; set; }
27-
public string ApplicationNameForTheAppUsingTheKey { get; set; }
28-
public int CreatedById { get; set; }
29-
public string SharedSecret { get; set; }
38+
/// <summary>
39+
/// Actual api key
40+
/// </summary>
41+
public string ApiKey { get; private set; }
42+
43+
/// <summary>
44+
/// Applications that the key is allowed to access
45+
/// </summary>
46+
public int[] ApplicationIds { get; private set; }
47+
48+
/// <summary>
49+
/// Name of the application that integrates with OTE.
50+
/// </summary>
51+
/// <remarks>
52+
/// <para>
53+
/// To allow the user to know which key is used for which integration.
54+
/// </para>
55+
/// </remarks>
56+
public string ApplicationNameForTheAppUsingTheKey { get; private set; }
57+
58+
/// <summary>
59+
/// Account id of the user that created the key.
60+
/// </summary>
61+
public int CreatedById { get; private set; }
62+
63+
/// <summary>
64+
/// Shared secret used to authenticate requests
65+
/// </summary>
66+
public string SharedSecret { get; private set; }
3067
}
3168
}

src/Server/OneTrueError.App/Core/ApiKeys/Events/ApplicationDeletedHandler.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ public ApplicationDeletedHandler(IApiKeyRepository repository)
2626
_repository = repository;
2727
}
2828

29+
/// <inheritdoc />
2930
public async Task HandleAsync(ApplicationDeleted e)
3031
{
3132
var apps = await _repository.GetForApplicationAsync(e.ApplicationId);

src/Server/OneTrueError.App/Core/Applications/CommandHandlers/DeleteApplicationHandler.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ public DeleteApplicationHandler(IApplicationRepository repository, IEventBus eve
2626
_eventBus = eventBus;
2727
}
2828

29+
/// <inheritdoc/>
2930
public async Task ExecuteAsync(DeleteApplication command)
3031
{
3132
var app = await _repository.GetByIdAsync(command.Id);

src/Server/OneTrueError.App/Core/Notifications/EventHandlers/ApplicationDeletedHandler.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ public ApplicationDeletedHandler(IAdoNetUnitOfWork uow)
2424
_uow = uow;
2525
}
2626

27+
/// <inheritdoc />
2728
public Task HandleAsync(ApplicationDeleted e)
2829
{
2930
_uow.ExecuteNonQuery("DELETE FROM UserNotificationSettings WHERE ApplicationId = @id", new { id = e.ApplicationId });

src/Server/OneTrueError.App/Core/Notifications/EventHandlers/CheckForFeedbackNotificationsToSend.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ public CheckForFeedbackNotificationsToSend(INotificationsRepository notification
3737
_queryBus = queryBus;
3838
}
3939

40+
/// <inheritdoc/>
4041
public async Task HandleAsync(FeedbackAttachedToIncident e)
4142
{
4243
var settings = await _notificationsRepository.GetAllAsync(-1);

src/Server/OneTrueError.Web/Areas/Receiver/Controllers/ReportController.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,6 @@ public HttpResponseMessage Index()
4343
[HttpPost, Route("receiver/report/{appKey}")]
4444
public async Task<HttpResponseMessage> Post(string appKey, string sig)
4545
{
46-
return Request.CreateErrorResponse(HttpStatusCode.NotFound, "No fuck!");
47-
4846
if (HttpContext.Current.Request.InputStream.Length > 20000000)
4947
{
5048
return await KillLargeReportAsync(appKey);

0 commit comments

Comments
 (0)