Skip to content

Commit 88bce4d

Browse files
committed
Added a new post for the Required Controller Auth anaylzer
1 parent 63f21c0 commit 88bce4d

File tree

1 file changed

+19
-0
lines changed
  • src/ProgrammerAl.Site.Content/Posts/20250609_RequiredControllerAuthRoslynAnalyzer

1 file changed

+19
-0
lines changed
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
Title: "New Project: Required Controller Auth Analyzer"
2+
Published: 2025/06/09
3+
Tags:
4+
- Project
5+
- C#
6+
- Roslyn Analyzer
7+
---
8+
9+
## New Project: Required Controller Auth Analyzer
10+
11+
A few months ago I created a C# Roslyn Analyzer to scan ASP.NET endpoints and add a compiler warning if an endpoint didn't have auth specified with an attribute ([Authorize] or [AllowAnonymous]) or some other way. [The old post is here](/posts/20250209_RequiredAuthRoslynAnalyzer)
12+
13+
Requiring it on each endpoint is a bit strict. Some people prefer to only require it at the controller level. So now I've created a new Roslyn Analyzer for just that. It will add a compiler warning if there are no Auth attributes at either the Controller level, OR the individual endpoints.
14+
15+
The full details are in the project README at: https://github.com/ProgrammerAL/required-auth.controller.analyzer
16+
17+
## NuGet Package
18+
19+
The NuGet package is hosted on nuget.org. You can get it from: https://www.nuget.org/packages/ProgrammerAL.Analyzers.ControllerRequiredAuthAnalyzer

0 commit comments

Comments
 (0)