Soenneker.Cloudflare.Attributes.Require
11.0.485
Prefix Reserved
dotnet add package Soenneker.Cloudflare.Attributes.Require --version 11.0.485
NuGet\Install-Package Soenneker.Cloudflare.Attributes.Require -Version 11.0.485
<PackageReference Include="Soenneker.Cloudflare.Attributes.Require" Version="11.0.485" />
<PackageVersion Include="Soenneker.Cloudflare.Attributes.Require" Version="11.0.485" />
<PackageReference Include="Soenneker.Cloudflare.Attributes.Require" />
paket add Soenneker.Cloudflare.Attributes.Require --version 11.0.485
#r "nuget: Soenneker.Cloudflare.Attributes.Require, 11.0.485"
#:package Soenneker.Cloudflare.Attributes.Require@11.0.485
#addin nuget:?package=Soenneker.Cloudflare.Attributes.Require&version=11.0.485
#tool nuget:?package=Soenneker.Cloudflare.Attributes.Require&version=11.0.485
Soenneker.Cloudflare.Attributes.Require
An ASP.NET Core authorization attribute that requires a client certificate chained to Cloudflare's Authenticated Origin Pull CA.
Installation
dotnet add package Soenneker.Cloudflare.Attributes.Require
Setup
Register the request validator:
using Soenneker.Cloudflare.Validators.Request.Registrars;
services.AddCloudflareRequestValidatorAsSingleton();
Apply the attribute to a controller or action:
using Microsoft.AspNetCore.Mvc;
using Soenneker.Cloudflare.Attributes.Require;
[ApiController]
[Route("api/orders")]
[RequireCloudflare]
public sealed class OrdersController : ControllerBase
{
[HttpGet]
public IActionResult Get() => Ok();
}
Requests without a valid Cloudflare Authenticated Origin Pull client-certificate chain receive 403 Forbidden.
Environment behavior
The filter is bypassed when the Environment configuration value is exactly Local or Test. It remains enforced for values such as Development, Staging, and Production. Treat that setting as security-sensitive configuration.
Deployment requirements
Enable Authenticated Origin Pulls for the Cloudflare zone and configure the origin web server or reverse proxy to request and forward the client certificate to ASP.NET Core. If TLS terminates before the application, verify that the proxy-to-application path is trusted and cannot accept spoofed certificate metadata.
This attribute is an application-layer check, not a replacement for restricting direct origin access with firewall rules, Cloudflare Tunnel, or equivalent network controls.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net11.0 is compatible. |
-
net11.0
- Soenneker.Cloudflare.Validators.Request (>= 11.0.471)
- Soenneker.Enums.DeployEnvironment (>= 11.0.267)
- Soenneker.Extensions.Configuration (>= 11.0.919)
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 |
|---|---|---|
| 11.0.485 | 126 | 11/19/2026 |
| 11.0.483 | 55 | 11/18/2026 |
| 11.0.482 | 51 | 11/18/2026 |
| 11.0.481 | 54 | 11/18/2026 |
| 11.0.479 | 57 | 11/18/2026 |
| 11.0.478 | 49 | 11/18/2026 |
| 11.0.477 | 121 | 11/15/2026 |
| 11.0.476 | 88 | 11/15/2026 |
| 11.0.475 | 94 | 11/14/2026 |
| 11.0.474 | 160 | 11/11/2026 |
| 11.0.473 | 98 | 11/11/2026 |
| 11.0.472 | 96 | 11/11/2026 |
| 11.0.471 | 93 | 11/11/2026 |
| 11.0.470 | 102 | 11/11/2026 |
| 11.0.469 | 88 | 11/11/2026 |
| 11.0.468 | 91 | 11/11/2026 |
| 11.0.467 | 90 | 11/11/2026 |
| 11.0.466 | 98 | 11/11/2026 |
| 11.0.465 | 101 | 11/11/2026 |
| 11.0.464 | 272 | 11/3/2026 |
Updated Soenneker.Cloudflare.Validators.Request to 11.0.471