NoGrind.SDK 1.1.3

dotnet add package NoGrind.SDK --version 1.1.3
                    
NuGet\Install-Package NoGrind.SDK -Version 1.1.3
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="NoGrind.SDK" Version="1.1.3" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="NoGrind.SDK" Version="1.1.3" />
                    
Directory.Packages.props
<PackageReference Include="NoGrind.SDK" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add NoGrind.SDK --version 1.1.3
                    
#r "nuget: NoGrind.SDK, 1.1.3"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package NoGrind.SDK@1.1.3
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=NoGrind.SDK&version=1.1.3
                    
Install as a Cake Addin
#tool nuget:?package=NoGrind.SDK&version=1.1.3
                    
Install as a Cake Tool

NoGrind SDK

NoGrind is a modern authentication and authorization SDK for .NET applications, built with clean architecture principles. It provides plug-and-play authentication capabilities with extensive configuration options and follows industry best practices.

Features (v1.1.1)

  • πŸ” Complete authentication and authorization management
  • πŸ”Œ Pluggable authentication provider system
    • JWT authentication (v1)
    • Future: OAuth2, Session-based auth, and more
  • πŸ‘₯ User management - Full CRUD operations with role management
  • πŸ›‘οΈ Role-based access control (RBAC) - Fine-grained permission management
  • πŸ—„οΈ SQL script-based database initialization - Provider-specific scripts for PostgreSQL, SQL Server, and SQLite
  • πŸ”§ Custom schema and table prefix support - Automated customization tools for multi-tenant and legacy integration
  • βš™οΈ Highly configurable - JSON configuration or programmatic setup
  • πŸš€ Zero-downtime deployments - Automated database setup with MigrationHostedService
  • πŸ“¦ Database agnostic - Works with PostgreSQL, SQL Server, SQLite, and more
  • πŸ“š Extensive documentation and examples - Complete guides and working example projects

Project Structure

The solution follows clean architecture principles with the following projects:

  • NoGrind.Core - Contains domain entities and business logic
  • NoGrind.Infrastructure - Implements interfaces defined in Core
  • NoGrind.Application - Contains application logic
  • NoGrind.SDK - Main entry point for consumers
  • Example Projects - Usage examples
  • Test Projects - Unit, integration, and functional tests

Getting Started

Quick Setup

  1. Install NoGrind SDK

    dotnet add package NoGrind.SDK
    
  2. Add NoGrind to your application

    // Program.cs
    builder.Services.AddNoGrind(options =>
    {
        options.Authentication.Provider = AuthenticationProviderType.JWT;
        options.Authentication.JWT.Secret = "your-super-secret-key-that-is-at-least-32-characters-long";
        options.Authentication.JWT.Issuer = "YourApp";
        options.Authentication.JWT.Audience = "YourApp";
    
        options.Database.IntegrationType = DatabaseIntegrationType.ConnectionString;
        options.Database.Provider = DatabaseProvider.PostgreSQL;
        options.Database.ConnectionString = "your-connection-string";
    });
    
    // Add middleware
    app.UseNoGrindMiddleware();
    
  3. For [Authorize] attributes and RequireAuthorization() - Add ASP.NET Core Authentication

    dotnet add package Microsoft.AspNetCore.Authentication.JwtBearer
    
    // Program.cs - Add AFTER AddNoGrind()
    builder.Services.AddAuthentication("Bearer")
        .AddJwtBearer("Bearer", options =>
        {
            options.TokenValidationParameters = new Microsoft.IdentityModel.Tokens.TokenValidationParameters
            {
                ValidateIssuer = true,
                ValidateAudience = true,
                ValidateLifetime = true,
                ValidateIssuerSigningKey = true,
                ValidIssuer = "YourApp",  // Match your NoGrind JWT settings
                ValidAudience = "YourApp",
                IssuerSigningKey = new Microsoft.IdentityModel.Tokens.SymmetricSecurityKey(
                    System.Text.Encoding.UTF8.GetBytes("your-super-secret-key-that-is-at-least-32-characters-long")),
                ClockSkew = TimeSpan.FromMinutes(1)
            };
        });
    
    builder.Services.AddAuthorization();
    
  4. Use in your controllers

    [ApiController]
    [Route("api/[controller]")]
    public class UsersController : ControllerBase
    {
        private readonly IUserManager _userManager;
    
        public UsersController(IUserManager userManager)
        {
            _userManager = userManager;
        }
    
        [HttpGet]
        [Authorize] // Now works with NoGrind authentication
        public async Task<IActionResult> GetUsers()
        {
            var users = await _userManager.GetAllUsersAsync();
            return Ok(users);
        }
    }
    

Documentation

Getting Started

Database Setup

Examples

For complete documentation and examples, see the docs/ folder and examples/ projects.

What's New in v1.1.1

Schema and Table Prefix Customization

NoGrind now supports custom schema names and table prefixes for maximum flexibility:

  • Automated Customization Tools - PowerShell and Bash scripts for easy customization
  • Multi-tenant Support - Use different prefixes for tenant isolation
  • Legacy Integration - Match your existing database naming conventions
  • CI/CD Ready - Integrate customization into deployment pipelines

See the Schema Customization Guide for details.

Example Usage

# Windows (PowerShell)
.\customize-scripts.ps1 -SchemaName "mycompany" -TablePrefix "APP_" -Provider postgres

# Unix/Linux/macOS (Bash)
./customize-scripts.sh -s mycompany -p APP_ -d postgres

Version History

  • v1.1.1 - Schema and table prefix customization support with automated tools
  • v1.1.0 - SQL script-based database initialization with provider-specific scripts
  • v1.0.x - Initial release with JWT authentication and EF Core migrations

Publish to NuGet (maintainers)

You can publish the SDK to NuGet.org via a tagged release or manually from your machine.

Prerequisites:

  • A repository secret named NUGET_API_KEY (preferred) or NOGRIND_API_KEY containing a NuGet.org API key with push permissions for NoGrind.SDK.

Steps:

  1. Ensure main is green (build/tests passing), then create and push a tag matching the version you want to publish:
    git tag v1.1.2
    git push origin v1.1.2
    
  2. GitHub Actions workflow .github/workflows/nuget-publish.yml will:
    • Restore, build, pack the SDK
    • Use the tag (without the leading v) as the package version
    • Push the package to NuGet.org

Verification:

  • Check Actions β†’ β€œPublish NoGrind.SDK to NuGet” to confirm success.
  • Once completed, verify on NuGet:

Notes:

  • The workflow prefers NUGET_API_KEY but falls back to NOGRIND_API_KEY if present.
  • To re-publish a failed version, either push a new tag (e.g., v1.1.3) or re-run the failed Action run after fixing secrets.

Manual publish (local)

If you need to pack/publish locally:

# From repository root
dotnet build NoGrind.sln -c Release
dotnet pack src/NoGrind.SDK/NoGrind.SDK.csproj -c Release \
    -p:PackageVersion=1.1.2 \
    -p:ContinuousIntegrationBuild=true \
    -o dist

# Publish to NuGet.org
dotnet nuget push dist/NoGrind.SDK.1.1.2.nupkg \
    --api-key "$NUGET_API_KEY" \
    --source https://api.nuget.org/v3/index.json

Tips:

  • Keep the tag version and package version aligned (CI derives version from tag).
  • The SDK includes XML docs and SourceLink for a better developer experience.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.1.3 344 10/7/2025
1.1.2 140 10/4/2025
1.1.1 137 10/4/2025
1.1.0 140 10/4/2025
1.0.5 216 9/30/2025
1.0.4 147 9/27/2025
1.0.3 293 9/15/2025
1.0.1 183 9/14/2025