VOOZH about

URL: https://www.nuget.org/packages/Common.API.Extensions.Lib/

⇱ NuGet Gallery | Common.API.Extensions.Lib 2.5.1




Common.API.Extensions.Lib 2.5.1

dotnet add package Common.API.Extensions.Lib --version 2.5.1
 
 
NuGet\Install-Package Common.API.Extensions.Lib -Version 2.5.1
 
 
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="Common.API.Extensions.Lib" Version="2.5.1" />
 
 
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Common.API.Extensions.Lib" Version="2.5.1" />
 
Directory.Packages.props
<PackageReference Include="Common.API.Extensions.Lib" />
 
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 Common.API.Extensions.Lib --version 2.5.1
 
 
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Common.API.Extensions.Lib, 2.5.1"
 
 
#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 Common.API.Extensions.Lib@2.5.1
 
 
#: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=Common.API.Extensions.Lib&version=2.5.1
 
Install as a Cake Addin
#tool nuget:?package=Common.API.Extensions.Lib&version=2.5.1
 
Install as a Cake Tool
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

Common.API.Extensions for .NET 8

This project provides a set of extensions for .NET 8 applications, covering authentication, logging, security, and validation.

Features

  • Custom Authorization: Implements role-based access control with custom attributes.
  • Logging: Provides Serilog-based logging extensions.
  • Security: Includes middleware for XSS protection.
  • Utilities: Provides reusable token management services.
  • Validation: Implements custom DTO validation attributes.

Project Structure

Common.API.Extensions
├── CustomAuthorization
│ ├── Model
│ │ ├── Menu.cs
│ │ ├── Permission.cs
│ │ ├── SubMenu.cs
│ │ ├── UserAccessDetails.cs
│ ├── CustomAuthorizeAttribute.cs
├── Logging
│ ├── ConfigurationExtensions.cs
│ ├── Constants.cs
│ ├── RequestLoggingMiddleware.cs
├── Sanitation
│ ├── AntiXssMiddleware.cs
│ ├── ErrorResponse.cs
│ ├── XssSettings.cs
├── Utils
│ ├── TokenService.cs
├── Validation
│ ├── CustomDtoValidations
│ │ ├── AccomodationKind
│ │ ├── ContactKind
│ │ ├── EventKind
│ │ ├── RoomType
│ │ ├── DateGreaterThanAttribute.cs
├── LICENSE.txt
├── README.md

Installation

  1. Install required NuGet packages:

    dotnet add package Microsoft.AspNetCore.Authentication.JwtBearer
    dotnet add package Serilog.AspNetCore
    dotnet add package Serilog.Settings.Configuration
    dotnet add package Serilog.Sinks.Console
    

Usage

Logging Configuration

using Microsoft.Extensions.Hosting;
using Serilog;
using Serilog.Events;
using Serilog.Formatting.Json;

public static class LoggingExtensions
{
 public static IHostBuilder UseUniversalLogging(this IHostBuilder hostBuilder)
 {
 hostBuilder.UseSerilog((context, services, loggerConfiguration) =>
 {
 loggerConfiguration
 .ReadFrom.Configuration(context.Configuration)
 .MinimumLevel.Override("Microsoft", LogEventLevel.Information)
 .Enrich.FromLogContext()
 .WriteTo.Console(new JsonFormatter()) // Writes logs to console
 .WriteTo.Console(new JsonFormatter(), standardErrorFromLevel: LogEventLevel.Verbose); // Writes logs to stdout
 });

 return hostBuilder;
 }
}

Authorization

[CustomAuthorize("Admin")]
public class AdminController : ControllerBase
{
 // Controller logic here
}

XSS Protection Middleware

app.UseMiddleware<AntiXssMiddleware>();

Token Validation

services.AddSingleton<ITokenService, TokenService>();

Deployment Notes

  • Ensure your authentication and logging configurations are properly set in appsettings.json.
  • Supports Kubernetes logging with JSON formatting for compatibility with log aggregators like Fluentd and Loki.

Contributing

  1. Fork the repository.
  2. Create a new branch: git checkout -b feature-branch
  3. Commit changes: git commit -m "Added new feature"
  4. Push and create a PR.

Product Versions Compatible and additional computed target framework versions.
.NET net10.0 net10.0 is compatible.  net10.0-android net10.0-android was computed.  net10.0-browser net10.0-browser was computed.  net10.0-ios net10.0-ios was computed.  net10.0-maccatalyst net10.0-maccatalyst was computed.  net10.0-macos net10.0-macos was computed.  net10.0-tvos net10.0-tvos was computed.  net10.0-windows 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 (1)

Showing the top 1 NuGet packages that depend on Common.API.Extensions.Lib:

Package Downloads
Common.Infrastructure.Lib

Package Description

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
2.5.1 164 5/6/2026 2.5.1 is deprecated because it is no longer maintained and has critical bugs.
2.5.0 225 4/1/2026 2.5.0 is deprecated because it is no longer maintained and has critical bugs.
2.4.4 408 3/11/2026 2.4.4 is deprecated because it is no longer maintained and has critical bugs.
2.4.3 299 3/3/2026 2.4.3 is deprecated because it is no longer maintained and has critical bugs.
2.4.2 418 2/20/2026 2.4.2 is deprecated because it is no longer maintained and has critical bugs.
2.4.1 131 2/20/2026 2.4.1 is deprecated because it is no longer maintained and has critical bugs.
2.4.0 125 2/20/2026 2.4.0 is deprecated because it is no longer maintained and has critical bugs.
2.3.0 398 2/11/2026 2.3.0 is deprecated because it is no longer maintained and has critical bugs.
2.2.6 136 2/9/2026 2.2.6 is deprecated because it is no longer maintained and has critical bugs.
2.2.5 211 2/4/2026 2.2.5 is deprecated because it is no longer maintained and has critical bugs.
2.2.4 132 1/28/2026 2.2.4 is deprecated because it is no longer maintained and has critical bugs.
2.2.3 163 1/2/2026 2.2.3 is deprecated because it is no longer maintained and has critical bugs.
2.2.2 534 12/24/2025 2.2.2 is deprecated because it is no longer maintained and has critical bugs.
2.2.1 218 12/24/2025 2.2.1 is deprecated because it is no longer maintained and has critical bugs.
2.2.0 812 11/11/2025 2.2.0 is deprecated because it is no longer maintained and has critical bugs.
1.0.19 302 6/9/2025 1.0.19 is deprecated because it is no longer maintained and has critical bugs.
1.0.18 182 6/3/2025 1.0.18 is deprecated because it is no longer maintained and has critical bugs.
1.0.17 1,827 3/25/2025 1.0.17 is deprecated because it is no longer maintained and has critical bugs.
1.0.16 314 3/10/2025 1.0.16 is deprecated because it is no longer maintained and has critical bugs.
1.0.15 215 3/10/2025 1.0.15 is deprecated because it is no longer maintained and has critical bugs.
Loading failed