AtlasNuc 1.0.26
dotnet add package AtlasNuc --version 1.0.26
NuGet\Install-Package AtlasNuc -Version 1.0.26
<PackageReference Include="AtlasNuc" Version="1.0.26" />
<PackageVersion Include="AtlasNuc" Version="1.0.26" />
<PackageReference Include="AtlasNuc" />
paket add AtlasNuc --version 1.0.26
#r "nuget: AtlasNuc, 1.0.26"
#:package AtlasNuc@1.0.26
#addin nuget:?package=AtlasNuc&version=1.0.26
#tool nuget:?package=AtlasNuc&version=1.0.26
AtlasCore
Shared contracts for Atlas platform services.
Purpose
AtlasCore provides reusable, service-agnostic audit contracts so all services can publish and query audit events in a consistent format.
Install the current package:
<PackageReference Include="AtlasNuc" Version="1.0.20" />
Current shared contracts live under Audit/Contracts:
AuditEventDto(includesActorNameandEventTimeUtcfor actor identity and timestamp)AuditContextAuditQueryRequestUserType,ResultStatusAuditActionCodes(baseline/common examples)
Shared approval-service integration lives under Approval (every source service
integrates with the central Atlas Approval Service through these):
Contracts/ApprovalRequestDto— the service-to-approval request contract (processCode, sourceService, sourceEntityId, requestReference, payloadSnapshot, renderSchema, callbackUrl/eventTopic, correlationId)Contracts/ApprovalRequirementResult,ApprovalRequestSnapshot,ApprovalDecisionCallbackContracts/RenderSchema+RenderFieldTypes— dynamic approval rendering metadataValidation/ProcessCodeValidator—Atlas.{Service}.{Module}.{Action}naming (allows nested modules, e.g.Atlas.Customer.Profile.Email.Update)Idempotency/ApprovalReferenceGenerator— requestReference/correlationId helpersBuilders/ApprovalRequestBuilder— fluent, validated request constructionClient/IApprovalClient+AddAtlasApprovalClient(configuration)— typed client for requirement checks, idempotent request creation and status queries (config sectionAtlasApproval:BaseUrl,ApiKey,ForwardBearerToken,Timeout)Integration/IApprovalGate— one-call integration pattern: check requirement → execute immediately when disabled → otherwise submit and short-circuit pending (fail-closed when the requirement check is unavailable)Callbacks/IApprovalCallbackVerifier+AddAtlasApprovalCallbackVerifier(configuration)— verifies HMAC-SHA256 signed decision callbacks (X-Approval-Signature,X-Approval-Timestamp, replay window) and surfaces theDecisionIdfor inbox dedup (config sectionAtlasApprovalCallback:SigningKey,ReplayWindowMinutes)Callbacks/AddAtlasApprovalCallback()(onAuthenticationBuilder) — registers theApprovalCallbackauthentication scheme so the callback endpoint carries a normal[Authorize(AuthenticationSchemes = ApprovalCallbackAuthenticationDefaults.Scheme)]instead of[AllowAnonymous]. The handler runs the HMAC check in the auth pipeline and stashes the verified callback onHttpContext.Items[…CallbackItemKey]so the action reads it without re-parsing or re-verifying. Chain it onto your existingAddAuthentication().AddJwtBearer(...); the default user-JWT scheme is untouched.builder.Services.AddAtlasApprovalCallbackVerifier(builder.Configuration); builder.Services.AddAuthentication(/* default JWT */) .AddJwtBearer(/* ... */) .AddAtlasApprovalCallback(); // using AtlasCore.Approval.Callbacks;
Shared configuration helpers live under Configuration:
AtlasKeyVaultExtensions.AddAtlasKeyVault()— layers Azure Key Vault over the host configuration whenKeyVault:Uriis set (no-op otherwise). One line per service:var builder = WebApplication.CreateBuilder(args); builder.AddAtlasKeyVault(); // using AtlasCore.Configuration;Vault secret names map nested keys with
--(e.g.JwtSettings--Key,ConnectionStrings--MySQLConnection) and override appsettings. Auth usesDefaultAzureCredential(service-principal env vars on a server,az loginon a dev box).
Shared authorization artifacts live under Authorization:
Contracts/IUserCategoryAccessorContracts/ApiErrorResponseFilters/AdminUserFilterPermissions/IPermissionLookupPermissions/HasPermissionAttributePermissions/PermissionAuthorizationRequirementPermissions/PermissionAuthorizationPolicyProviderPermissions/PermissionAuthorizationHandlerPermissions/PermissionCodePackerPermissions/PermissionClaimConstantsPermissions/ICurrentUserPermissionProviderPermissions/RemoteCurrentUserPermissionProviderPermissions/PermissionClaimConstants.PlatformAccessAllPermissionCodeIp/BypassIpRestrictionAttributeIp/AuthorizedIpAddressMiddlewareEncryption/EncryptedBypassIpRestrictionAttributeEncryption/EncryptedRequestBodyFilterEncryption/EncryptedResponseBodyFilterEncryption/IEncryptedBodyServiceEncryption/IApiResultStatusCodeResolver
Atlas.Platform.AccessAll.Configure is the only platform-wide super-admin permission code. When it is present in the authenticated user's PermissionCodes claim, permission authorization succeeds for every [HasPermission(...)] requirement. Legacy packed permissions authorize exact permissions only and no longer provide an AccessAll bypass. Assignment and removal of the platform permission must be tightly controlled and audited.
Shared API controller artifacts live under Api/Controllers:
AtlasBaseControllerIAtlasModelStateErrorFactoryIAtlasResponseProtectorIAtlasResponseStatusCodeResolverReflectionAtlasResponseStatusCodeResolverAddAtlasBaseControllerSupport
Action Code Strategy (Generic + Reusable)
Do not rely on a single global enum/list for every service action.
Use this model:
AtlasCorekeeps only common baseline action codes.- Each service defines its own local action catalog.
- All action codes follow one naming convention.
Naming Convention
Use:
<Domain>.<Subdomain>.<Action>
Examples:
Customer.Transfer.InitiatedAdmin.User.DisabledSystem.Integration.CallLoan.Application.Approved
Rules:
- PascalCase segments
- Dot-separated hierarchy
- Stable codes (append new, avoid renaming old)
Example: Service-Owned Action Catalog
namespace AtlasDigitalBank.Service.Audit;
public static class DigitalBankAuditActions
{
public const string CustomerTransferInitiated = "Customer.Transfer.Initiated";
public const string CustomerTransferCompleted = "Customer.Transfer.Completed";
public const string AdminFeatureToggled = "Admin.Feature.Toggled";
public const string LoanApplicationApproved = "Loan.Application.Approved";
}
Example: Publishing an Audit Event
using AtlasCore.Audit.Contracts;
var evt = new AuditEventDto
{
UserType = UserType.Customer,
UserId = customerId,
ServiceName = "AtlasDigitalBank",
ActionCode = DigitalBankAuditActions.CustomerTransferInitiated,
ResultStatus = ResultStatus.Success,
TargetType = "Wallet",
TargetId = walletId,
Context = new AuditContext
{
Channel = "API",
CorrelationId = correlationId,
AppVersion = appVersion
}
};
Example: Querying with ATLAS Pagination Style
AuditQueryRequest follows the ATLAS request pattern:
PageNumberPageSize
var query = new AuditQueryRequest
{
UserType = UserType.Admin,
ServiceName = "AtlasDigitalBank",
FromUtc = DateTime.UtcNow.AddDays(-7),
ToUtc = DateTime.UtcNow,
PageNumber = 1,
PageSize = 50
};
API Response Pattern
For consistency with existing ATLAS API style, list endpoints should return:
- list payload in
Result - total records in top-level
Count
This avoids embedding custom paged wrapper objects in shared contracts.
Shared Admin Authorization Filter
AdminUserFilter is now reusable from AtlasCore.Authorization.Filters and checks that the current user category is AdminUser.
To use it in a service:
using AtlasCore.Authorization.Contracts;
using AtlasCore.Authorization.Filters;
public sealed class AuthUserCategoryAccessor : IUserCategoryAccessor
{
private readonly IAuthUser _authUser;
public AuthUserCategoryAccessor(IAuthUser authUser)
{
_authUser = authUser;
}
public string? UserCategory => _authUser.UserCategory;
}
services.AddScoped<IUserCategoryAccessor, AuthUserCategoryAccessor>();
services.AddScoped<AdminUserFilter>();
Shared Permission Authorization
AtlasCore centralizes the permission enforcement pipeline, but it does not own each service's permission catalog.
Use this split:
AtlasCoreowns the policy provider, authorization handler, claim constants, and optional remote permission provider.- Each service owns its atomic permission-code catalog and local legacy lookup.
- Admin assignment is centralized in ATLAS using the same string codes issued in the
PermissionCodesclaim. - Legacy packed permissions authorize exact mapped permissions only. They do not provide an AccessAll bypass.
Atlas.Platform.AccessAll.Configureis the only JWT global permission bypass.
Service-Owned Permission Catalog
Each service should use atomic string constants:
namespace AtlasWallet.Services.Authorization;
public static class WalletPermissionCodes
{
public const string SavingsReportRead = "Atlas.Wallet.SavingsReport.Read";
public const string SavingsReportExport = "Atlas.Wallet.SavingsReport.Export";
}
Legacy Lookup Adapter
The lookup is retained only for exact legacy packed-permission compatibility:
using AtlasCore.Authorization.Permissions;
namespace AtlasWallet.Services.Authorization;
public sealed class AtlasPermissionLookup : IPermissionLookup
{
private static readonly IReadOnlyDictionary<string, short> Codes =
new Dictionary<string, short>(StringComparer.OrdinalIgnoreCase)
{
[WalletPermissionCodes.SavingsReportRead] = 1001,
[WalletPermissionCodes.SavingsReportExport] = 1002
};
public bool TryResolvePermission(string permissionName, out short permissionCode)
{
return Codes.TryGetValue(permissionName, out permissionCode);
}
}
Service Registration
Register the shared authorization pipeline once:
using AtlasCore.Authorization.Permissions;
services.AddAtlasPermissionAuthorization<AtlasPermissionLookup>();
Controller Usage
Services can keep a local wrapper attribute:
using AtlasCore.Authorization.Permissions;
namespace AtlasWallet.Services.Authorization;
[AttributeUsage(AttributeTargets.Method | AttributeTargets.Class, Inherited = false)]
public sealed class HasPermissionAttribute : AtlasCore.Authorization.Permissions.HasPermissionAttribute
{
public HasPermissionAttribute(string permissionCode)
: base(permissionCode)
{
}
}
Then controller usage stays unchanged:
[HasPermission(WalletPermissionCodes.SavingsReportExport)]
public IActionResult ExportSavingsReport()
{
// ...
}
JWT Permission Claims
Issue atomic permission codes in the shared PermissionCodes claim:
new Claim(
PermissionClaimConstants.PermissionCodesClaimType,
string.Join(PermissionClaimConstants.PermissionCodesSeparator, permissionCodes))
For Super Admin, issue:
new Claim(
PermissionClaimConstants.PermissionCodesClaimType,
PermissionClaimConstants.PlatformAccessAllPermissionCode)
Legacy packed claims remain supported for exact permissions only:
var packedPermissions = PermissionCodePacker.PackPermissionsIntoString(legacyPermissionCodes);
new Claim(PermissionClaimConstants.PackedPermissionClaimType, packedPermissions);
Optional Remote Permission Validation
Services that require current centralized permissions rather than JWT-only authorization can register the remote provider:
services.AddAtlasPermissionAuthorization<AtlasPermissionLookup>();
services.AddAtlasRemotePermissionProvider(configuration);
Configuration:
{
"AtlasPermissions": {
"BaseUrl": "https://atlas-api.example.com/",
"SnapshotPath": "api/Permission/me",
"Timeout": "00:00:03"
}
}
Shared IP Restriction + Encrypted Request/Response Filters
AtlasCore also centralizes the common API authorization pattern used by services that need:
- IP safelist enforcement
- per-action IP bypass metadata
- encrypted request-body decryption
- encrypted response-body wrapping
Service Adapter
Each service owns its encryption implementation and adapts it to IEncryptedBodyService:
using AtlasCore.Authorization.Encryption;
public sealed class ServiceEncryptedBodyService : IEncryptedBodyService
{
private readonly EncryptionBodyHelper _encryptionBodyHelper;
public ServiceEncryptedBodyService(EncryptionBodyHelper encryptionBodyHelper)
{
_encryptionBodyHelper = encryptionBodyHelper;
}
public string DecryptString(string encryptedText)
{
return _encryptionBodyHelper.DecryptString(encryptedText);
}
public string EncryptResponseData(object response)
{
return _encryptionBodyHelper.EncryptResponseData(response);
}
}
Shared Base Controller
Use AtlasBaseController to standardize model-state errors, success/error HTTP status handling, and optional response protection without coupling AtlasNuc to a service-specific ApiResult type.
Register the shared controller support:
using AtlasCore.Api.Controllers;
services.AddAtlasBaseControllerSupport<ServiceModelStateErrorFactory>();
For encrypted/protected responses:
services.AddAtlasBaseControllerSupport<
ServiceModelStateErrorFactory,
ServiceResponseProtector>();
Controller usage:
public sealed class SavingsController(
IAtlasModelStateErrorFactory modelStateErrorFactory,
IAtlasResponseProtector responseProtector,
IAtlasResponseStatusCodeResolver statusCodeResolver)
: AtlasBaseController(modelStateErrorFactory, responseProtector, statusCodeResolver)
{
[HttpGet]
public IActionResult Get()
{
return Response(service.Get());
}
}
Service Registration
using AtlasCore.Authorization.Encryption;
services.AddAtlasEncryptedAuthorization<ServiceEncryptedBodyService, DefaultApiResultStatusCodeResolver>(options =>
{
options.DecryptRequests = true;
options.EncryptResponses = true;
});
EncryptResponses is configurable so services can keep environment-specific behavior, for example encrypt only in release builds.
Middleware
using AtlasCore.Authorization.Ip;
var allowedIpAddress = app.Configuration["AllowedIPAddress"];
var allowedRequestPaths = app.Configuration["AllowedApiRequest"] ?? string.Empty;
app.UseMiddleware<AuthorizedIpAddressMiddleware>(allowedIpAddress, allowedRequestPaths);
Controller Usage
Use one attribute instead of stacking IP bypass, decrypt, and encrypt filters:
using AtlasCore.Authorization.Encryption;
[HttpPost("admin/terminate")]
[EncryptedBypassIpRestriction]
public Task<IActionResult> AdminTerminate([FromBody] BreakSavingsDto model)
{
// ...
}
To allow only specific IPs for a bypassed endpoint:
[EncryptedBypassIpRestriction("10.0.0.5", "10.0.1.0/24")]
RabbitMQ Ingress Contract (Shared)
Use the shared messaging contracts under AtlasCore.Audit.Messaging to standardize producer and consumer behavior across services.
Shared types:
AuditIngressEnvelopeAuditIngressHeadersAuditIngressOptionsAuditIngressValidationCodeAuditIngressValidationResult
Producer Example
using System.Text;
using System.Text.Json;
using AtlasCore.Audit.Contracts;
using AtlasCore.Audit.Messaging;
var evt = new AuditEventDto
{
EventId = Guid.NewGuid().ToString("N"),
EventTimeUtc = DateTime.UtcNow,
UserType = UserType.Customer,
UserId = "cus-001",
ServiceName = "ATLAS",
ActionCode = "Transfer.Initiated",
ResultStatus = ResultStatus.Success
};
var envelope = new AuditIngressEnvelope
{
SchemaVersion = "1.0",
Event = evt
};
var body = Encoding.UTF8.GetBytes(JsonSerializer.Serialize(envelope));
var props = channel.CreateBasicProperties();
props.Persistent = true;
props.MessageId = evt.EventId;
props.Headers = new Dictionary<string, object>
{
[AuditIngressHeaders.EventType] = Encoding.UTF8.GetBytes(AuditIngressHeaders.DefaultEventType),
[AuditIngressHeaders.ServiceName] = Encoding.UTF8.GetBytes(evt.ServiceName),
[AuditIngressHeaders.SchemaVersion] = Encoding.UTF8.GetBytes(envelope.SchemaVersion)
};
channel.BasicPublish("atlas_audit_exchange", "atlas.customer.transfer", props, body);
Consumer Behavior
Consumers should validate:
- Payload can be deserialized to
AuditIngressEnvelope schemaVersionmatches expected version- Required headers are present and valid
- Required
AuditEventDtofields are present
When validation fails, reject-route with deterministic code using AuditIngressValidationCode (for example: reject.payload-invalid-json).
Rollout Guidance
- Add
AtlasNuc1.0.20in producer and consumer services. - Start with
AllowLegacyPayload=trueonly during migration. - Disable legacy mode after all producers publish
AuditIngressEnvelopewith required headers.
| Product | Versions 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. |
-
net9.0
- Azure.Extensions.AspNetCore.Configuration.Secrets (>= 1.4.0)
- Azure.Identity (>= 1.13.2)
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.26 | 93 | 6/18/2026 |
| 1.0.25 | 122 | 6/18/2026 |
| 1.0.24 | 174 | 6/14/2026 |
| 1.0.23 | 167 | 6/14/2026 |
| 1.0.22 | 171 | 6/14/2026 |
| 1.0.21 | 172 | 6/14/2026 |
| 1.0.20 | 167 | 6/13/2026 |
| 1.0.19 | 162 | 6/12/2026 |
| 1.0.18 | 176 | 6/12/2026 |
| 1.0.17 | 165 | 6/12/2026 |
| 1.0.16 | 210 | 6/12/2026 |
| 1.0.14 | 230 | 6/1/2026 |
| 1.0.13 | 176 | 6/1/2026 |
| 1.0.12 | 182 | 6/1/2026 |
| 1.0.11 | 166 | 6/1/2026 |
| 1.0.10 | 198 | 4/28/2026 |
| 1.0.9 | 269 | 4/22/2026 |
| 1.0.7 | 183 | 4/18/2026 |
| 1.0.6 | 174 | 4/18/2026 |
| 1.0.5 | 210 | 4/15/2026 |