Nera.Lib.Gateway 1.0.0

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

Nera.Lib.Gateway

Kong API Gateway integration library for Nextera Systems microservices, providing service registration, routing, authentication, rate limiting, and other gateway features.

Features

  • Kong Gateway Integration: Complete Kong Admin API client with service and route management
  • Auto Service Registration: Middleware for automatic service registration with Kong
  • Configuration Management: Flexible configuration options for Kong integration
  • JWT Authentication: Support for JWT Bearer authentication via Kong plugins
  • Service Discovery: Integration with Nera service discovery library

Project Structure

  • Kong/ - Kong Gateway integration services and models
    • IKongAdminClient.cs - Refit interface for Kong Admin API
    • IKongGatewayService.cs - Service interface for Kong operations
    • KongGatewayService.cs - Implementation of Kong service operations
    • Models/KongModels.cs - Kong API data models
  • Middleware/ - ASP.NET Core middleware components
    • KongGatewayRegistrationMiddleware.cs - Auto-registration middleware
  • Authentication/ - Authentication components (placeholder)
  • RateLimiting/ - Rate limiting components (placeholder)
  • Routing/ - Custom routing components (placeholder)
  • KongGatewayExtensions.cs - DI extension methods

Getting Started

Installation

Add the package reference to your project:

<PackageReference Include="Nera.Lib.Gateway" Version="1.0.0" />

Configuration

Add Kong configuration to your appsettings.json:

{
  "Kong": {
    "AdminApiUrl": "http://localhost:8001",
    "AdminApiKey": "your-api-key-if-enabled",
    "ProxyUrl": "http://localhost:8000",
    "ServiceNamePrefix": "nera-",
    "DefaultTags": ["nera", "microservice"]
  }
}

Basic Usage

  1. Register Kong Services in DI Container
public void ConfigureServices(IServiceCollection services)
{
    services.AddKongGateway(Configuration);
}
  1. Use Kong Gateway Service
public class MyController : ControllerBase
{
    private readonly IKongGatewayService _kongService;
    
    public MyController(IKongGatewayService kongService)
    {
        _kongService = kongService;
    }
    
    public async Task RegisterService()
    {
        var service = await _kongService.RegisterServiceAsync(
            "my-service",
            "localhost",
            5000,
            "/api/v1");
            
        var route = await _kongService.CreateRouteAsync(
            "my-service",
            "my-route",
            new[] { "/my-service" });
    }
}
  1. Auto Registration Middleware (Advanced)
public void Configure(IApplicationBuilder app)
{
    app.UseKongGatewayRegistration(options =>
    {
        options.ServiceName = "my-service";
        options.ServicePath = "/api/v1";
    });
}

Development

  • Target Framework: .NET 9.0
  • Key Dependencies:
    • Microsoft.AspNetCore.App
    • Microsoft.AspNetCore.Authentication.JwtBearer
    • Refit (HTTP client generation)
    • Nera.Lib.Core
    • Nera.Lib.ServiceDiscovery

Building

dotnet build

Testing

dotnet test

Contributing

Contributions are welcome! Please open issues or submit pull requests for improvements or bug fixes.

License

MIT License - © 2025 Nextera Systems. All rights reserved.

Product Compatible and additional computed target framework versions.
.NET net9.0 is compatible.  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.0.0 97 7/27/2025