-
-
Notifications
You must be signed in to change notification settings - Fork 142
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'timdeschryver-http-auditing'
- Loading branch information
Showing
39 changed files
with
1,183 additions
and
117 deletions.
There are no files selected for viewing
25 changes: 25 additions & 0 deletions
25
src/Http/Wolverine.Http.Tests/endpoint_adds_requesttype_audit_tags_to_activity.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
using JasperFx.CodeGeneration; | ||
using JasperFx.Core; | ||
using JasperFx.Core.Reflection; | ||
using Microsoft.AspNetCore.Http; | ||
using Shouldly; | ||
using WolverineWebApi; | ||
|
||
namespace Wolverine.Http.Tests; | ||
|
||
public class endpoint_adds_requesttype_audit_tags_to_activity : IntegrationContext | ||
{ | ||
public endpoint_adds_requesttype_audit_tags_to_activity(AppFixture fixture) : base(fixture) | ||
{ | ||
} | ||
|
||
[Fact] | ||
public void finds_audit_members_from_attributes() | ||
{ | ||
var chain = HttpChains.ChainFor("POST", "/auditable/empty"); | ||
|
||
chain.AuditedMembers.Single() | ||
.MemberName.ShouldBe(nameof(AuditablePostBody.Id)); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
using Wolverine.Attributes; | ||
using Wolverine.Http; | ||
|
||
namespace WolverineWebApi; | ||
|
||
public class AuditableEndpoint | ||
{ | ||
|
||
[WolverinePost("/auditable/post"), EmptyResponse] | ||
public string Post(AuditablePostBody body) | ||
{ | ||
return "Hello"; | ||
} | ||
|
||
[WolverinePost("/auditable/empty"), EmptyResponse] | ||
public void EmptyPost(AuditablePostBody command) | ||
{ | ||
} | ||
} | ||
|
||
public class AuditablePostBody | ||
{ | ||
[Audit] | ||
public Guid Id { get; set; } | ||
} |
Oops, something went wrong.