From efd5c1123b5c24ad10a8732d309465306e72ffda Mon Sep 17 00:00:00 2001 From: Torin Sandall Date: Fri, 10 Feb 2017 10:55:04 -0800 Subject: [PATCH] Prepare v0.4.2 release --- CHANGELOG.md | 34 ++++++++++++++++++++- Makefile | 2 +- site/examples/docker-authorization/index.md | 2 +- site/get-opa/index.md | 12 ++++---- 4 files changed, 41 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7146f74388..c24aad382a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,7 +3,39 @@ All notable changes to this project will be documented in this file. This project adheres to [Semantic Versioning](http://semver.org/). -## Unreleased +## 0.4.2 + +### Rego + +This release changes the Rego syntax. The two main changes are: + +- Expressions are now separated by semicolons (instead of commas). When writing rules, the semicolons are optional. +- Rules are no longer written in the form: `head :- body`. Instead they are written as `head { body }`. + +Also: + +- Set, array, and object literals now support trailing commas. +- To declare a set literal with one element, you must include a trailing comma, e.g., `{ foo, }`. +- Arithmetic and set operations can now be performed with infix notation, e.g., `x = 2 + 1`. +- Sets can be referred to like objects and arrays now ([#243](https://github.com/open-policy-agent/opa/issues/243)). E.g., `p[_].foo = 1 # check if element in has attr foo equal to 1`. + +### Evaluation + +This release changes the evaluation behaviour for packages. Previously, if a package contained no rules OR all of the rules were undefined when evaluated, a query against the package path would return undefined. As of v0.4.2 the query will return an empty object. + +### REST API + +This release changes the Data API to return an HTTP 200 response if the document is undefined. The message body will contain an object without the `result` property. + +### Fixes + +- Allow sets to be treated like objects/arrays + +### Miscellaneous + +- Added high level API for Go users. See `github.com/open-policy-agent/opa/rego` package. +- Improved expression String() function to handle infix operators better. +- Added support for set intersection and union built-ins. See language docs. ## 0.4.1 diff --git a/Makefile b/Makefile index f494cbcecc..1208a51e2f 100644 --- a/Makefile +++ b/Makefile @@ -2,7 +2,7 @@ # Use of this source code is governed by an Apache2 # license that can be found in the LICENSE file. -VERSION := 0.4.2-dev +VERSION := 0.4.2 PACKAGES := \ github.com/open-policy-agent/opa/ast/.../ \ diff --git a/site/examples/docker-authorization/index.md b/site/examples/docker-authorization/index.md index a908ae08fe..48fff067a6 100644 --- a/site/examples/docker-authorization/index.md +++ b/site/examples/docker-authorization/index.md @@ -66,7 +66,7 @@ $ mkdir -p policies ### 2. Download the latest version of OPA. ```shell -$ curl -L https://github.com/open-policy-agent/opa/releases/download/v0.4.1/opa_linux_amd64 > opa +$ curl -L https://github.com/open-policy-agent/opa/releases/download/v0.4.2/opa_linux_amd64 > opa $ chmod u+x opa ``` diff --git a/site/get-opa/index.md b/site/get-opa/index.md index de5227df26..8933f9dcbf 100644 --- a/site/get-opa/index.md +++ b/site/get-opa/index.md @@ -13,9 +13,9 @@ title: Get Open Policy Agent The binary releases for 64-bit Linux and Mac are available for download here. For other releases of OPA see the [GitHub Releases](https://github.com/open-policy-agent/opa/releases) page. {: .opa-header--text} - * [64-bit Linux](https://github.com/open-policy-agent/opa/releases/download/v0.4.1/opa_linux_amd64){: .opa-header--download-list--link} - * [64-bit Mac OS X](https://github.com/open-policy-agent/opa/releases/download/v0.4.1/opa_darwin_amd64){: .opa-header--download-list--link} - * [Go Source](https://github.com/open-policy-agent/opa/archive/v0.4.1.tar.gz){: .opa-header--download-list--link} + * [64-bit Linux](https://github.com/open-policy-agent/opa/releases/download/v0.4.2/opa_linux_amd64){: .opa-header--download-list--link} + * [64-bit Mac OS X](https://github.com/open-policy-agent/opa/releases/download/v0.4.2/opa_darwin_amd64){: .opa-header--download-list--link} + * [Go Source](https://github.com/open-policy-agent/opa/archive/v0.4.2.tar.gz){: .opa-header--download-list--link} {: .opa-header--download-list} {% endcontentfor %} @@ -25,7 +25,7 @@ The binary releases for 64-bit Linux and Mac are available for download here. Fo ## 64-bit Linux ```shell -$ curl -L https://github.com/open-policy-agent/opa/releases/download/v0.4.1/opa_linux_amd64 > opa +$ curl -L https://github.com/open-policy-agent/opa/releases/download/v0.4.2/opa_linux_amd64 > opa $ chmod u+x opa $ ./opa version ``` @@ -33,14 +33,14 @@ $ ./opa version ## 64-bit Mac OS X ```shell -$ curl -L https://github.com/open-policy-agent/opa/releases/download/v0.4.1/opa_darwin_amd64 > opa +$ curl -L https://github.com/open-policy-agent/opa/releases/download/v0.4.2/opa_darwin_amd64 > opa $ chmod u+x opa $ ./opa version ``` ## Docker Image (64-bit Linux) ```shell -$ docker run openpolicyagent/opa:0.4.1 version +$ docker run openpolicyagent/opa:0.4.2 version ``` {% endcontentfor %}