ComplianceFactory.Cootje.Middleware 1.0.24

dotnet add package ComplianceFactory.Cootje.Middleware --version 1.0.24
                    
NuGet\Install-Package ComplianceFactory.Cootje.Middleware -Version 1.0.24
                    
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="ComplianceFactory.Cootje.Middleware" Version="1.0.24" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="ComplianceFactory.Cootje.Middleware" Version="1.0.24" />
                    
Directory.Packages.props
<PackageReference Include="ComplianceFactory.Cootje.Middleware" />
                    
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 ComplianceFactory.Cootje.Middleware --version 1.0.24
                    
#r "nuget: ComplianceFactory.Cootje.Middleware, 1.0.24"
                    
#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 ComplianceFactory.Cootje.Middleware@1.0.24
                    
#: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=ComplianceFactory.Cootje.Middleware&version=1.0.24
                    
Install as a Cake Addin
#tool nuget:?package=ComplianceFactory.Cootje.Middleware&version=1.0.24
                    
Install as a Cake Tool

Auth Middleware

Cootje Auth Middleware and RequestExtensions used for easy security integration with connected API's

Installation

Install the package via NuGet package manager:

Install-Package ComplianceFactory.Cootje.Middleware -Version 0.0.1

Usage

1. In program startup register the middleware

This will automatically protect all your controller endpoints by:

  1. Checking for the Authorization header
  2. Communicating with AUTH API for validation and token decryption
  3. Decrypting the token and attaching decrypted user to HttpContext

In Program Startup:

app.UseMiddleware<ComplianceFactory.Cootje.Middleware.ComplianceFactoryAuthMiddleware>("http://AUTH_URI:8080");

2. Read user from request in controller

In order to read the user from a request, an extensionmethod can be used from the package ComplianceFactory.Cootje.Middleware

using ComplianceFactory.Cootje.Middleware;
...
public IActionResult Get() {
   var user = Request.GetUser();
}

3. Protect controllers by Roles

Add the AuthorizeRolesAttribute to the method attribute. Multiple roles can be added, if any is in the user roles, the request is allowed.

using ComplianceFactory.Cootje.Roles;
using ComplianceFactory.Cootje.Middleware.AuthorizationAttributes;
...
[AuthorizeRoles([ComplianceFactoryRoles.EnvironmentOwer, ComplianceFactoryRoles.Professional])]
public IActionResult Get() {
    ...
}
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.
  • net8.0

    • No dependencies.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on ComplianceFactory.Cootje.Middleware:

Package Downloads
ComplianceFactory.Cootje.Logger

Package Description

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.24 236 6/17/2025
1.0.23 201 6/16/2025
1.0.22 500 3/5/2025
1.0.21 413 2/3/2025
1.0.20 478 11/30/2024
1.0.19 285 10/22/2024
1.0.18 413 7/5/2024
1.0.17 195 7/5/2024
1.0.16 178 7/4/2024
1.0.15 209 7/4/2024
1.0.14 221 6/27/2024
1.0.13 178 6/27/2024
1.0.12 181 6/27/2024
1.0.11 193 6/27/2024
1.0.10 186 6/27/2024
1.0.9 184 6/27/2024
1.0.8 178 6/26/2024
1.0.7 187 6/26/2024
1.0.6 176 6/26/2024
1.0.5 319 6/5/2024
Loading failed