Skip to content
Open
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
105 changes: 53 additions & 52 deletions Cargo.lock

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

63 changes: 63 additions & 0 deletions policies/rust/now-policy-api/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,69 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).


## [[0.4.0](https://github.com/Devolutions/now-libraries/compare/now-policy-api-v0.3.1...now-policy-api-v0.4.0)] - 2026-08-28

### <!-- 1 -->Features

- Add active package policy inspection contract ([#93](https://github.com/Devolutions/now-libraries/issues/93)) ([cd5a6e9f8e](https://github.com/Devolutions/now-libraries/commit/cd5a6e9f8eeb3c70cc9ef9003ffeb46716ceced6))

- add canonical `GET /v1/policy` support across the Rust server
contract, generated OpenAPI, C# DTOs, and
`BrokerClient.GetPolicy(CancellationToken)`
- return the existing canonical `PolicyDocument` inside a versioned
`PolicyResponse`, with structured `404 NotFound` behavior when no active
policy is configured
- make policy inspection unconditional: remove `policy-compat` and its
cross-model conversion impls, and keep runtime mapping ownership in
broker implementations
- name the required Rust server accessor `active_policy`, leaving clear
room for a future explicit `replace_policy` operation backed by a
separate policy-store abstraction
- harden C# successful-response validation for required/null fields,
collection elements, unknown members, and canonical enum casing
- preserve existing OpenAPI component names by namespacing colliding
embedded policy components as `PolicyModel…`
- run workspace Rust tests and Clippy with all features through the
standard xtask commands

## API changes

### Rust

- `now-policy-api` adds public `PolicyResponse` and
`PolicyResponseKind`; `now-policy` is now a normal dependency because
`PolicyDocument` is part of the permanent wire contract
- `PackageBrokerServer` adds the required method:

```rust
async fn active_policy(&self) -> Result<PolicyResponse, ErrorResponse>;
```

- `now-policy-server-template` registers the route unconditionally and
extends its mock with policy response/error builders
- `policy-compat` and its `From`/`TryFrom` conversions are removed

### C#

- `Devolutions.Now.Policy.Api` adds `PolicyResponse`, embedding
`Devolutions.Now.Policy.Model.PolicyDocument`
- `Devolutions.Now.Policy.Client` adds `GetPolicy(CancellationToken)`
with strict validation of successful response bodies
- policy-model deserialization now enforces required members, non-null
collection elements, and canonical enum casing

### HTTP

- adds read-only `GET /v1/policy`
- `200`: `PolicyResponse`
- `404`: structured `ErrorResponse` when no active policy is configured
- other failures use the existing `ErrorResponse` contract
- no policy mutation endpoint is introduced

---------



## [[0.3.1](https://github.com/Devolutions/now-libraries/compare/now-policy-api-v0.3.0...now-policy-api-v0.3.1)] - 2026-08-13

### <!-- 4 -->Bug Fixes
Expand Down
2 changes: 1 addition & 1 deletion policies/rust/now-policy-api/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "now-policy-api"
version = "0.3.1"
version = "0.4.0"
edition = "2024"
license.workspace = true
homepage.workspace = true
Expand Down
Loading