Skip to content

Commit d1fbd08

Browse files
Release v0.8.0 (#70)
Signed-off-by: Philip Conrad <philip@chariot-chaser.net>
1 parent b748b6b commit d1fbd08

File tree

2 files changed

+40
-1
lines changed

2 files changed

+40
-1
lines changed

CHANGELOG.md

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,45 @@
33
All notable changes to this project will be documented in this file. This
44
project adheres to [Semantic Versioning](http://semver.org/).
55

6+
## 0.8.0
7+
8+
This release adds initial support for [GUID](https://learn.microsoft.com/en-us/dotnet/api/system.guid) types in data filter queries. It also includes several small dependency bumps, and documentation improvements.
9+
10+
### GUID Support
11+
12+
GUIDs are now supported in for `eq`, `ne`, `in`, and `nin` operators in UCAST.
13+
This is helpful when dealing with database model classes that have a GUID primary key, among other use cases.
14+
15+
Support is implemented by having the LINQ `Expression` tree builder functions detect cases where GUID-typed properties in the base LINQ object are being compared against strings in the UCAST expression tree, and then converting those strings to appropriate GUID values before attempting comparisons.
16+
17+
#### GUID Support Example
18+
19+
Assuming we have a model class with a `Guid` property/field named `Uuid`, the following sequence is roughly how a Rego expression to match a particular GUID would be translated down into LINQ `Expression`s.
20+
21+
Rego expression:
22+
```rego
23+
item.uuid == "123e4567-e89b-12d3-a456-426614174000"
24+
```
25+
26+
Translated to UCAST:
27+
```json
28+
{
29+
"type": "field",
30+
"operator": "eq",
31+
"field": "item.uuid",
32+
"value": "123e4567-e89b-12d3-a456-426614174000"
33+
}
34+
```
35+
36+
Translated to LINQ `Expressions`:
37+
```csharp
38+
Expression.Equal(
39+
Expression.Property(/* <ParameterExpression> */, "Uuid"), // Property lookup
40+
Expression.Constant(new GUID("123e4567-e89b-12d3-a456-426614174000")) // The constant from the policy
41+
)
42+
```
43+
44+
645
## 0.7.0, 0.7.1
746

847
These releases contain release engineering improvements, and no significant code or dependency changes.

src/OpenPolicyAgent.Ucast.Linq/OpenPolicyAgent.Ucast.Linq.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<PropertyGroup>
33
<IsPackable>true</IsPackable>
44
<PackageId>OpenPolicyAgent.Ucast.Linq</PackageId>
5-
<Version>0.7.1</Version>
5+
<Version>0.8.0</Version>
66
<Authors>The OPA Authors</Authors>
77
<TargetFramework>net8.0</TargetFramework>
88
<Nullable>enable</Nullable>

0 commit comments

Comments
 (0)