Skip to content
This repository was archived by the owner on Oct 2, 2024. It is now read-only.

Commit 1197ef4

Browse files
committed
Marked authentication filter class as internal. Marked HttpActionContext extension method as internal. Removed authorization content from README.md. #12
1 parent 3b6592d commit 1197ef4

File tree

3 files changed

+2
-14
lines changed

3 files changed

+2
-14
lines changed

README.md

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -36,15 +36,3 @@ var log = new LoggerConfiguration()
3636
.Enrich.With(new WebApiRouteTemplateEnricher("RouteTemplate")
3737
.CreateLogger();
3838
```
39-
40-
## Authorization
41-
In Web Api, authorization filters execute before action filters. If a request is unauthorized, the action filters are not processed.
42-
An authorize filter attribute is available which adds enricher support in the event that the request is unauthorized. You can use this directly:
43-
```csharp
44-
[SerilogWeb.Classic.WebApi.StoreWebApInfoInHttpContextAuthorizeFilter]
45-
public void Get()
46-
{
47-
}
48-
```
49-
50-
Alternatively, you can create your own Authorize filter attribute which inherits from ```SerilogWeb.Classic.WebApi.StoreWebApInfoInHttpContextAuthorizeFilter```, and use that instead.

src/SerilogWeb.Classic.WebApi/Classic/WebApi/HttpActionContextExtensions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ namespace SerilogWeb.Classic.WebApi
1010
{
1111
internal static class HttpActionContextExtensions
1212
{
13-
public static void StoreWebApInfoInHttpContext(this HttpActionContext actionContext)
13+
internal static void StoreWebApInfoInHttpContext(this HttpActionContext actionContext)
1414
{
1515
var currentHttpContext = HttpContext.Current;
1616
if (currentHttpContext == null)

src/SerilogWeb.Classic.WebApi/Classic/WebApi/StoreWebApInfoInHttpContextAuthenticationFilter.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
namespace SerilogWeb.Classic.WebApi
1010
{
11-
public class StoreWebApInfoInHttpContextAuthenticationFilter : IAuthenticationFilter
11+
internal class StoreWebApInfoInHttpContextAuthenticationFilter : IAuthenticationFilter
1212
{
1313
public bool AllowMultiple => false;
1414

0 commit comments

Comments
 (0)