Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/nuget-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,10 @@ jobs:
csproj-paths: |
protocols\dotnet\Devolutions.NowClient\Devolutions.NowClient.csproj
protocols\dotnet\Devolutions.NowProto\Devolutions.NowProto.csproj
- library: BrokerPolicy
libpath: ./policies/dotnet/Devolutions.Broker.Policy
- library: NowPolicy
libpath: ./policies/dotnet/Devolutions.NowPolicy
csproj-paths: |
policies\dotnet\Devolutions.Broker.Policy\Devolutions.Broker.Policy.csproj
policies\dotnet\Devolutions.NowPolicy\Devolutions.NowPolicy.csproj

steps:
- name: Check out ${{ github.repository }}
Expand Down
28 changes: 14 additions & 14 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ Shared libraries for Devolutions NOW components.
## Libraries

- [protocols](./protocols/) contains the NOW protocol specifications, Rust crates, .NET libraries, and protocol test tools.
- [policies](./policies/) is reserved for the UniGetUI/PEDM policy engine libraries.
- [policies](./policies/) contains Devolutions Agent NOW policy libraries.

## Repository Layout

- Root-level tooling and CI are shared across library families.
- Protocol-specific documentation and source code live under `protocols/`.
- Policy-specific documentation and source code will live under `policies/`.
- Policy-specific documentation and source code live under `policies/`.
4 changes: 2 additions & 2 deletions policies/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Policies
========

This directory is reserved for Devolutions broker policy engine libraries.
This directory contains Devolutions Agent NOW policy libraries.

The future policy engine NuGet package and Rust crate will live here.
The .NET package is published as `Devolutions.NowPolicy`, and the Rust crate is published as `now-policy`.
4 changes: 0 additions & 4 deletions policies/dotnet/Devolutions.Broker.Policy.slnx

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<LangVersion>latest</LangVersion>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<IsPackable>false</IsPackable>
<RootNamespace>Devolutions.Broker.Policy.Tests</RootNamespace>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.11.1" />
<PackageReference Include="xunit" Version="2.9.2" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.8.2" />
<PackageReference Include="NJsonSchema" Version="11.1.0" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="../Devolutions.Broker.Policy/Devolutions.Broker.Policy.csproj" />
</ItemGroup>
</Project>
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<LangVersion>latest</LangVersion>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<IsPackable>false</IsPackable>
<RootNamespace>Devolutions.NowPolicy.Tests</RootNamespace>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.11.1" />
<PackageReference Include="xunit" Version="2.9.2" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.8.2" />
<PackageReference Include="NJsonSchema" Version="11.1.0" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="../Devolutions.NowPolicy/Devolutions.NowPolicy.csproj" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@

using Xunit;

namespace Devolutions.Broker.Policy.Tests;
namespace Devolutions.NowPolicy.Tests;

public class PolicyTests
{
private static string PolicyCrateRoot { get; } = ResolvePolicyCrateRoot();

private static string SamplesDir => Path.Combine(PolicyCrateRoot, "assets", "samples");

private static string PolicySchema => Path.Combine(PolicyCrateRoot, "schema", "devolutions.broker-policy.schema.json");
private static string PolicySchema => Path.Combine(PolicyCrateRoot, "schema", "devolutions.now-policy.schema.json");

public static IEnumerable<object[]> PolicySamples() =>
Directory.GetFiles(SamplesDir, "*.policy.*").Select(f => new object[] { f });
Expand Down Expand Up @@ -130,14 +130,14 @@ private static PolicyDocument ParsePolicy(string path)
private static string ResolvePolicyCrateRoot([CallerFilePath] string thisFile = "")
{
var testsDir = Path.GetDirectoryName(thisFile)!;
return Path.GetFullPath(Path.Combine(testsDir, "..", "..", "rust", "devolutions-broker-policy"));
return Path.GetFullPath(Path.Combine(testsDir, "..", "..", "rust", "now-policy"));
}

private static string MinimalPolicyJson(string revision, string rules)
{
return $$"""
{
"$schema": "https://devolutions.net/schemas/broker-policy.schema.1.0.json",
"$schema": "https://devolutions.net/schemas/now-policy.schema.1.0.json",
"PolicyVersion": "1.0.0",
"PolicyType": "PackageBrokerPolicy",
"Metadata": {
Expand Down
4 changes: 4 additions & 0 deletions policies/dotnet/Devolutions.NowPolicy.slnx
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<Solution>
<Project Path="Devolutions.NowPolicy.Tests/Devolutions.NowPolicy.Tests.csproj"/>
<Project Path="Devolutions.NowPolicy/Devolutions.NowPolicy.csproj"/>
</Solution>
Original file line number Diff line number Diff line change
@@ -1,36 +1,36 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<LangVersion>latest</LangVersion>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<RootNamespace>Devolutions.Broker.Policy</RootNamespace>
<AssemblyName>Devolutions.Broker.Policy</AssemblyName>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
</PropertyGroup>
<PropertyGroup>
<PackageId>Devolutions.Broker.Policy</PackageId>
<Version>0.0.0.0</Version>
<AssemblyTitle>Devolutions broker policy model</AssemblyTitle>
<Description>Policy creation and parsing APIs for Devolutions broker policies.</Description>
<Authors>Devolutions Inc.</Authors>
<Copyright>© Devolutions Inc. All rights reserved.</Copyright>
<PackageLicenseExpression>MIT OR Apache-2.0</PackageLicenseExpression>
<RepositoryUrl>https://github.com/Devolutions/now-libraries.git</RepositoryUrl>
<RepositoryType>git</RepositoryType>
<IncludeSymbols>true</IncludeSymbols>
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
<GenerateDocumentationFile>false</GenerateDocumentationFile>
<PackageReadmeFile>README.md</PackageReadmeFile>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="YamlDotNet" Version="16.2.0" />
</ItemGroup>
<ItemGroup>
<None Include="..\README.md" Pack="true" PackagePath="\" />
</ItemGroup>
</Project>
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<LangVersion>latest</LangVersion>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<RootNamespace>Devolutions.NowPolicy</RootNamespace>
<AssemblyName>Devolutions.NowPolicy</AssemblyName>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
</PropertyGroup>

<PropertyGroup>
<PackageId>Devolutions.NowPolicy</PackageId>
<Version>0.0.0.0</Version>
<AssemblyTitle>Devolutions NOW policy model</AssemblyTitle>
<Description>Policy creation and parsing APIs for Devolutions Agent NOW policy documents.</Description>
<Authors>Devolutions Inc.</Authors>
<Copyright>© Devolutions Inc. All rights reserved.</Copyright>
<PackageLicenseExpression>MIT OR Apache-2.0</PackageLicenseExpression>
<RepositoryUrl>https://github.com/Devolutions/now-libraries.git</RepositoryUrl>
<RepositoryType>git</RepositoryType>
<IncludeSymbols>true</IncludeSymbols>
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
<GenerateDocumentationFile>false</GenerateDocumentationFile>
<PackageReadmeFile>README.md</PackageReadmeFile>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="YamlDotNet" Version="16.2.0" />
</ItemGroup>

<ItemGroup>
<None Include="..\README.md" Pack="true" PackagePath="\" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using System.Text.Json.Serialization;

namespace Devolutions.Broker.Policy;
namespace Devolutions.NowPolicy;

/// <summary>Package operation type.</summary>
[JsonConverter(typeof(JsonStringEnumConverter<Operation>))]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using System.Text.Json;
using System.Text.Json.Serialization;

namespace Devolutions.Broker.Policy;
namespace Devolutions.NowPolicy;

public static class PolicyJson
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@
using YamlDotNet.Core;
using YamlDotNet.RepresentationModel;

namespace Devolutions.Broker.Policy;
namespace Devolutions.NowPolicy;

public static class SchemaUris
{
public const string Policy = "https://devolutions.net/schemas/broker-policy.schema.1.0.json";
public const string Policy = "https://devolutions.net/schemas/now-policy.schema.1.0.json";
}

/// <summary>A policy document governing which package operations are allowed or denied.</summary>
Expand Down
8 changes: 4 additions & 4 deletions policies/dotnet/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Devolutions broker policy
=========================
This package provides .NET types and JSON/YAML parsing helpers for the Devolutions broker policy format.
Devolutions NOW policy
======================

This package provides .NET types and JSON/YAML parsing helpers for Devolutions Agent NOW policy documents.
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
[package]
name = "devolutions-broker-policy"
name = "now-policy"
version = "0.1.0"
edition = "2024"
license.workspace = true
homepage.workspace = true
repository.workspace = true
authors.workspace = true
readme = "README.md"
description = "Devolutions broker policy model and schema"
description = "Devolutions NOW policy model and schema"
publish = true

[lints]
Expand All @@ -24,5 +24,5 @@ thiserror = "2"
url = "2"

[[bin]]
name = "generate-devolutions-broker-policy-schema"
name = "generate-now-policy-schema"
path = "tools/generate_schema.rs"
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Devolutions broker policy model
===============================
This crate provides the Rust policy model and JSON Schema helpers for the Devolutions broker policy format.
It contains only admin-authored policy types and schema generation utilities.
Broker request, response, server, transport, and execution types are intentionally out of scope.
Devolutions NOW policy model
============================

This crate provides the Rust policy model and JSON Schema helpers for Devolutions Agent NOW policy documents.

It contains only admin-authored policy types and schema generation utilities.
Broker request, response, server, transport, and execution types are intentionally out of scope.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$schema": "https://devolutions.net/schemas/broker-policy.schema.1.0.json",
"$schema": "https://devolutions.net/schemas/now-policy.schema.1.0.json",
"PolicyVersion": "1.0.0",
"PolicyType": "PackageBrokerPolicy",
"Metadata": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"$schema": https://devolutions.net/schemas/broker-policy.schema.1.0.json
"$schema": https://devolutions.net/schemas/now-policy.schema.1.0.json
PolicyVersion: 1.0.0
PolicyType: PackageBrokerPolicy
Metadata:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$schema": "https://devolutions.net/schemas/broker-policy.schema.1.0.json",
"$schema": "https://devolutions.net/schemas/now-policy.schema.1.0.json",
"PolicyVersion": "1.0.0",
"PolicyType": "PackageBrokerPolicy",
"Metadata": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$schema": "https://devolutions.net/schemas/broker-policy.schema.1.0.json",
"$schema": "https://devolutions.net/schemas/now-policy.schema.1.0.json",
"PolicyVersion": "1.0.0",
"PolicyType": "PackageBrokerPolicy",
"Metadata": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$schema": "https://devolutions.net/schemas/broker-policy.schema.1.0.json",
"$schema": "https://devolutions.net/schemas/now-policy.schema.1.0.json",
"PolicyVersion": "1.0.0",
"PolicyType": "PackageBrokerPolicy",
"Metadata": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$schema": "https://devolutions.net/schemas/broker-policy.schema.1.0.json",
"$schema": "https://devolutions.net/schemas/now-policy.schema.1.0.json",
"PolicyVersion": "1.0.0",
"PolicyType": "PackageBrokerPolicy",
"Metadata": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$schema": "https://devolutions.net/schemas/broker-policy.schema.1.0.json",
"$schema": "https://devolutions.net/schemas/now-policy.schema.1.0.json",
"PolicyVersion": "1.0.0",
"PolicyType": "PackageBrokerPolicy",
"Metadata": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$id": "https://devolutions.net/schemas/broker-policy.schema.1.0.json",
"$id": "https://devolutions.net/schemas/now-policy.schema.1.0.json",
"$schema": "http://json-schema.org/draft-07/schema#",
"additionalProperties": false,
"definitions": {
Expand Down Expand Up @@ -489,7 +489,7 @@
},
"PolicySchemaUri": {
"enum": [
"https://devolutions.net/schemas/broker-policy.schema.1.0.json"
"https://devolutions.net/schemas/now-policy.schema.1.0.json"
],
"type": "string"
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//! Devolutions broker policy model and schema helpers.
//! Devolutions NOW policy model and schema helpers.

#![allow(clippy::std_instead_of_core, unused_qualifications)]

Expand Down
Loading
Loading