Devolutions.Now.Policy.Model
2026.9.3
Prefix Reserved
dotnet add package Devolutions.Now.Policy.Model --version 2026.9.3
NuGet\Install-Package Devolutions.Now.Policy.Model -Version 2026.9.3
<PackageReference Include="Devolutions.Now.Policy.Model" Version="2026.9.3" />
<PackageVersion Include="Devolutions.Now.Policy.Model" Version="2026.9.3" />
<PackageReference Include="Devolutions.Now.Policy.Model" />
paket add Devolutions.Now.Policy.Model --version 2026.9.3
#r "nuget: Devolutions.Now.Policy.Model, 2026.9.3"
#:package Devolutions.Now.Policy.Model@2026.9.3
#addin nuget:?package=Devolutions.Now.Policy.Model&version=2026.9.3
#tool nuget:?package=Devolutions.Now.Policy.Model&version=2026.9.3
Devolutions NOW policy model for .NET
Devolutions.Now.Policy.Model contains the .NET policy document model for Devolutions NOW package broker policies. It is the .NET counterpart to the Rust now-policy crate and represents the policy files used to decide whether package operations are allowed or denied.
Purpose
This package is focused on policy documents, not broker transport. It is used by .NET code that needs to create, parse, inspect, or serialize Devolutions NOW policy files.
The model is used to:
- represent package broker policy documents in C#;
- parse strict JSON policy documents;
- represent editable drafts separately from committed policy documents;
- serialize policy documents with the canonical JSON shape;
- share policy enums and document types with the package broker API compatibility layer.
Architecture
PolicyModels.csdefines committedPolicyDocument, editablePolicyDraftDocument, their metadata, explicit conversions, enforcement, rules, match criteria, constraints, and version range types.Enums.csdefines policy-level enums such as operation, manager, scope, architecture, elevation, decision, and rule precedence.PolicySerializer.csdefines sharedJsonSerializerOptions, including strict parsing that rejects unknown JSON members and JSON null for non-nullable policy members or collection elements.
PolicyDocument.Create constructs a committed policy and PolicyDraftDocument.Create constructs an editable draft. PolicyDocument.ToDraft removes server-managed Revision and PublishedAt; PolicyDraftDocument.ToPolicyDocument requires those values when committing. ParseJson is the only policy parsing entry point.
Breaking change
Policy documents are JSON-only. PolicyDocument.ParseYaml, which was public in Devolutions.Now.Policy.Model 2026.8.13, has been removed intentionally. Consumers must migrate stored policies to JSON before upgrading; OpenAPI YAML and unrelated YAML documents are unaffected.
Validation
Run the Rust policy schema/tests as well when changing shared policy semantics.
| 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 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. |
-
net10.0
- No dependencies.
-
net9.0
- No dependencies.
NuGet packages (1)
Showing the top 1 NuGet packages that depend on Devolutions.Now.Policy.Model:
| Package | Downloads |
|---|---|
|
Devolutions.Now.Policy.Api
Request and response DTOs for the Devolutions NOW package broker API. |
GitHub repositories
This package is not used by any popular GitHub repositories.