Skip to content

knameless27/Safe-vault-secure-api

Repository files navigation

SafeVaultSecureAPI

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:

  1. dotnet restore
  2. dotnet run --project SafeVaultSecureAPI
  3. Use Swagger at https://localhost:5001/swagger to 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.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages