EAC.Infrastructure.Security 0.1.0-rc.2

This is a prerelease version of EAC.Infrastructure.Security.
There is a newer prerelease version of this package available.
See the version list below for details.
dotnet add package EAC.Infrastructure.Security --version 0.1.0-rc.2
                    
NuGet\Install-Package EAC.Infrastructure.Security -Version 0.1.0-rc.2
                    
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="EAC.Infrastructure.Security" Version="0.1.0-rc.2" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="EAC.Infrastructure.Security" Version="0.1.0-rc.2" />
                    
Directory.Packages.props
<PackageReference Include="EAC.Infrastructure.Security" />
                    
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 EAC.Infrastructure.Security --version 0.1.0-rc.2
                    
#r "nuget: EAC.Infrastructure.Security, 0.1.0-rc.2"
                    
#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 EAC.Infrastructure.Security@0.1.0-rc.2
                    
#: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=EAC.Infrastructure.Security&version=0.1.0-rc.2&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=EAC.Infrastructure.Security&version=0.1.0-rc.2&prerelease
                    
Install as a Cake Tool

EAC.Infrastructure.Security

Repositorio propietario del NuGet EAC.Infrastructure.Security.

Estado actual: alcance hasta RC completado con 0.1.0-rc.1 publicado en NuGet.org. La promoción estable permanece aplazada hasta autorización explícita.

Instalación y configuración

<PackageReference Include="EAC.Infrastructure.Security" Version="0.1.0-rc.1" />

El registro básico no exige configuración ambiental ni activa un handler de autenticación. El host conserva el control explícito sobre JWT Bearer, OIDC u otro handler oficial:

services.AddEacSecurity(
    claims => claims.MapSubject("sub").MapClientId("client_id"),
    capabilities => capabilities.Add("sample.order.read"));

Cuando existe configuración EAC de seguridad, se enlaza y valida al inicio:

services.AddEacSecurity(
    builder.Configuration,
    claims => claims.MapSubject("sub").MapClientId("client_id"),
    capabilities => capabilities.Add("sample.order.read"));

Configuración completa con valores seguros predeterminados:

{
  "Eac": {
    "Security": {
      "DefaultScheme": "Bearer",
      "Authority": "https://identity.example",
      "Audience": "orders-api",
      "Issuer": "https://identity.example",
      "ValidateIssuer": true,
      "ValidateAudience": true,
      "ValidateLifetime": true,
      "ValidateSignature": true,
      "RequireHttpsMetadata": true
    }
  }
}

Equivalencia mediante variables de entorno:

Eac__Security__DefaultScheme=Bearer
Eac__Security__Authority=https://identity.example
Eac__Security__Audience=orders-api
Eac__Security__Issuer=https://identity.example
Eac__Security__ValidateIssuer=true
Eac__Security__ValidateAudience=true
Eac__Security__ValidateLifetime=true
Eac__Security__ValidateSignature=true
Eac__Security__RequireHttpsMetadata=true
Opción Predeterminado Obligatoria al configurar Regla
DefaultScheme Bearer no no vacío
Authority — sí URI absoluta; HTTPS cuando RequireHttpsMetadata=true
Audience — sí no vacío
Issuer — sí no vacío
ValidateIssuer true sí no admite desactivación
ValidateAudience true sí no admite desactivación
ValidateLifetime true sí no admite desactivación
ValidateSignature true sí no admite desactivación
RequireHttpsMetadata true no solo puede desactivarse en pruebas locales controladas

Una sección incompleta o insegura impide el startup. Los cambios requieren reiniciar el proceso. Una configuración programática proporcionada al final del registro tiene precedencia sobre appsettings y variables de entorno:

services.AddEacSecurity(
    builder.Configuration,
    ConfigureClaims,
    ConfigureCapabilities,
    options => options.Audience = "orders-api-v2");

Authority, Audience e Issuer no son secretos. Tokens, claves privadas, client secrets y credenciales pertenecen al handler/proveedor oficial y deben obtenerse desde un almacén externo; este paquete nunca los recibe ni almacena. Las capacidades, claims admitidas y políticas son contratos tipados y permanecen en código.

Los roles de proveedor solo se traducen a capacidades cuando la fuente declara explícitamente claim type, issuer, audience y client/resource esperados:

services.AddEacSecurity(
    claims => claims
        .MapSubject("sub")
        .MapClientId("client_id", "azp")
        .MapRoles("roles")
        .AcceptRoleSource("https://identity.example", "orders-api", "orders-client")
        .FromRole("order-operator", "sample.order.read"),
    capabilities => capabilities.Add("sample.order.read"));
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

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
0.1.0-rc.4 68 10/23/2026
0.1.0-rc.3 87 8/21/2026
0.1.0-rc.2 83 8/21/2026
0.1.0-rc.1 85 8/19/2026
0.1.0-beta.1 81 8/19/2026
0.1.0-alpha.3 73 8/19/2026
0.1.0-alpha.2 83 8/19/2026