Anarchy.Toolkit.Runtime.Web 1.0.0

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

Anarchy.Toolkit.Runtime.Web

Part of Anarchy I/O Toolkit, a .NET developer platform · Pillar: Infrastructure · Layer: Runtime · Package catalog

Shared ASP.NET Core REST API pipeline and presentation helpers.

dotnet add package Anarchy.Toolkit.Runtime.Web
  • Build an API using RestApiWebAppStartupBase and the web entry-point bases for native or container hosting; AWS Lambda hosting lives in Anarchy.Toolkit.Runtime.Web.Aws.
  • Compose the supplied middleware, JWT bearer authentication with scope policies (RequireScope, no IdentityServer dependency), JSON converters and validation attributes around your application's endpoints.
  • A health controller exposes the shared health-report model. Application-specific scopes and endpoints remain in the consumer.
  • Swagger is opt-in: add Anarchy.Toolkit.Runtime.Web.Swagger and call AddToolkitSwagger(ApiName, AppSettings, Environment) from the startup. Without it, this package references neither Swashbuckle nor Microsoft.OpenApi.

When to use it

Use this package to host a toolkit-based REST API on ASP.NET Core (natively or in a container; AWS Lambda through Runtime.Web.Aws) while sharing startup, authentication, health and error-handling conventions. It supplies infrastructure around your endpoints; it does not define your application's API contracts or business logic.

How to use it

  1. Define application settings and a settings module, then derive a startup from RestApiWebAppStartupBase<TAppSettingsDiModule, TAppSettings>. Register your services and configure authorization scopes in its service-configuration hook.
  2. Implement controllers with explicit request/response types and call application services rather than database repositories directly. Keep transport DTOs separate from domain entities.
  3. Supply the IReadOnlyCollection<IHealthCheck> consumed by the health controller, using an empty collection if there are no checks or registering the relevant provider reports.
  4. Use WebAppEntryPoint.RunWebHost<Startup>(args) for a native host and an AwsWebAppEntryPointBase implementation (from Anarchy.Toolkit.Runtime.Web.Aws) for Lambda. Configure real authentication, secrets and environment-specific settings before deployment.

The sample API startup, native entry point and Lambda entry point show the complete structure. Test the HTTP pipeline with Testing.Runtime.Web (and the Lambda pipeline with Testing.Runtime.Web.Aws).

See the endpoint guide, API sample and toolkit overview.

Third-party dependencies

This package brings these libraries, which its name does not announce:

Library Why In the public API?
Newtonsoft.Json (through Microsoft.AspNetCore.Mvc.NewtonsoftJson) Controllers serialize JSON with Newtonsoft; the exception middleware maps its errors No: configured by the startup
Microsoft.IdentityModel.JsonWebTokens and System.IdentityModel.Tokens.Jwt Validate JWT bearer tokens and read their scopes No

Releases

See the release notes for the complete release history.

Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  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 (4)

Showing the top 4 NuGet packages that depend on Anarchy.Toolkit.Runtime.Web:

Package Downloads
Anarchy.Toolkit.Runtime.Web.Aws

Opt-in AWS Lambda hosting for toolkit REST APIs: AwsWebAppEntryPointBase behind API Gateway, the X-Amzn-Trace-Id middleware (UseAmazonTraceId) and Lambda path helpers.

Anarchy.Toolkit.Runtime.Web.Ui

Blazor UI pipeline: cookie-session OAuth login, environment catalog, downstream API client base, and reusable components (notifications, modals, JSON viewer, pagination).

Anarchy.Toolkit.Testing.Runtime.Web

Web end-to-end test base (RestApiTestCaseBase exercising the native Kestrel pipeline) and HTTP request helpers; the AWS Lambda pipeline is tested with Anarchy.Toolkit.Testing.Runtime.Web.Aws.

Anarchy.Toolkit.Runtime.Web.Swagger

Opt-in Swagger/OpenAPI for toolkit REST APIs: the OpenAPI document (OAuth2 scheme, authorization and Accept-Encoding filters, runtime description) and the themed Swagger UI (AddToolkitSwagger).

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.0 71 11/27/2026

## Releases

### 1.0.0

- Renamed from `Anarchy.Toolkit.Web`, whose last release was 2.1.0; the releases below were published under that name.
- **Breaking:** extension classes take the `Extensions` suffix under `Extensions/<extended namespace>/`, helpers live in `Helpers/<Subject>/`, and their namespaces follow those folders: update `using` directives.
- Lambda hosting moves to the opt-in `Anarchy.Toolkit.Runtime.Web.Aws` (with `UseAmazonTraceId()`), and Swagger to `Anarchy.Toolkit.Runtime.Web.Swagger` (`AddToolkitSwagger`).
- REST APIs no longer require `IAuthServiceAppSettings`: authentication and the OAuth2 scheme turn on when the settings implement it, and scopes are checked by the toolkit's own `RequireScope` (accepting `scope` and `scp` claims) instead of IdentityServer4.

### 2.1.0

- Update the persistence-abstractions dependency.

### 2.0.1

- fix(Web): Support Windows paths and host architecture
- chore(build): Format package release notes property

### 2.0.0

- feat(automation): establish onboarding and layering conventions
- feat(telemetry)!: introduce provider-neutral application telemetry
- refactor(packages)!: restructure persistence and automation packages
- refactor(infrastructure.correlationid)!: decouple correlation scopes from Serilog
- refactor(core)!: reshape telemetry, event and health contracts
- fix(persistence)!: preserve unit-of-work transaction ownership
- refactor(telemetry)!: remove legacy APIs and simplify namespaces
- feat(automation)!: configure layering and bridge build telemetry
- refactor(telemetry)!: update consumers and samples
- docs(onboarding): align package guidance, skills, and architecture

### 1.2.1

- docs(packages): identify each package's pillar and layer
- build(packages): attribute the copyright to Leandro Melão Medeiros
- build: relicense under Apache-2.0 and update the package metadata

### 1.2.0

- build(deps): upgrade Swashbuckle.AspNetCore to 11.0.1 and Microsoft.OpenApi to 3.11.1
- feat(Web): serve OpenAPI 3.2 and theme Swagger UI with a light and dark Anarchy theme

### 1.0.8

- docs: expand XML docblocks across all projects for the DocFX API reference

### 1.0.7

- `Microsoft.OpenApi` updated to 2.13.0 and `System.Security.Cryptography.*` aligned with the .NET 10 LTS (10.0.15, down from 11.0.0).

### 1.0.6

- refactor(src): clean up code style across library packages
- chore(deps): update AWS SDK, Lambda ASP.NET Core server and MySqlConnector packages

### 1.0.5

- chore(deps): update AWS SDK packages

### 1.0.3

- build: migrate local automation to build tooling

### 1.0.2

- docs: expand package guides and release histories
- chore(deps): update AWS, Polly, and xUnit packages

### 1.0.1

- Added a package-specific NuGet README.

### 1.0.0

- Introduced API hosting, controller and middleware infrastructure, authentication, Swagger and Lambda hosting helpers.