Secure ASP.NET Core sample API demonstrating:
- Input validation (DataAnnotations + ModelState)
- SQL Injection prevention using parameterized queries (Dapper)
- Authentication (JWT) and Role-Based Access Control (RBAC)
- Basic middleware (request logging)
- Unit tests (xUnit) to validate security behavior
Requirements:
- .NET SDK 8 (or 6/7 with minor changes)
- dotnet tooling
How to run:
dotnet restoredotnet run --project SafeVaultSecureAPI- Use Swagger at
https://localhost:5001/swaggerto test or call endpoints with a JWT.
Notes:
- For demo purposes, users are seeded in-memory in Program.cs with roles "Admin" and "User".
- The vault data is stored in a local SQLite database created at startup.