Skip to content

Commit

Permalink
0.26.0 (#1508)
Browse files Browse the repository at this point in the history
Co-authored-by: gw <[email protected]>
  • Loading branch information
gj and gw authored Jan 25, 2022
1 parent e0ae6f1 commit 42f249a
Show file tree
Hide file tree
Showing 26 changed files with 170 additions and 94 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/publish-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,16 @@ on:
description: "docs s3 path (docs.oso.dev or docs-preview.oso.dev)"
oso_version:
description: "oso release to build docs for"
default: "0.25.1" # oso_version
default: "0.26.0" # oso_version
flask_oso_version:
description: "flask oso release to build docs for"
default: "0.25.1" # flask_oso_version
default: "0.26.0" # flask_oso_version
django_oso_version:
description: "django oso release to build docs for"
default: "0.25.1" # django_oso_version
default: "0.26.0" # django_oso_version
sqlalchemy_oso_version:
description: "sqlalchemy oso release to build docs for"
default: "0.25.1" # sqlalchemy_oso_version
default: "0.26.0" # sqlalchemy_oso_version
jobs:
publish:
name: Publish docs
Expand Down
12 changes: 6 additions & 6 deletions Cargo.lock

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

2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.25.1
0.26.0
122 changes: 122 additions & 0 deletions docs/content/any/project/changelogs/2022-01-26.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
---
title: Release 2022-01-26
menuTitle: 2022-01-26
any: true
description: >-
Changelog for Release 2022-01-26 (oso 0.26.0, VS Code extension 0.26.0,
django-oso 0.26.0, flask-oso 0.26.0, sqlalchemy-oso 0.26.0) containing new
features, bug fixes, and more.
---

## `oso` 0.26.0

### Core

#### Other bugs & improvements

- Fixed a bug affecting runtime type checking on nested object attributes.
- When using data filtering, the list of relations returned to the adapter
is now topologically sorted.

### Go

#### Breaking changes

{{% callout "Warning" "orange" %}}
This release contains breaking changes. Be sure to follow migration steps
before upgrading.
{{% /callout %}}

##### Updated Go type checking behavior

When evaluating whether a given query variable matches a Go type Polar will now use direct instance comparisons instead of Go's `reflect.ConvertibleTo` functionality. This change resolves false-positive type checking results where discrete structs with identical sets of fields were considered to be equivalent.

This change has implications for the use of NewTypes in Polar rule definitions. Rules that are defined using NewTypes will now only match instances of the NewType and no longer match the underlying wrapped type.

Rules which consume NewTypes must now be specialized over the NewType directly and not the underlying wrapped type.

```go
type Action string
const (
View Action = "view"
Create Action = "create"
Update Action = "update"
)
```

Where previously it was possible to utilize this `Action` type as interchangeable with that of `string`:

```polar
user_has_action(user: User, action: String, resource: Resource) if ...
```

This rule definition must be rewritten as follows:

```polar
user_has_action(user: User, action: Action, resource: Resource) if ...
```

#### New Features

##### Data Filtering for Go

Data filtering is now officially supported for Go! Check out
[our docs]({{< ref path="guides/data_filtering" lang="go" >}})
for more details and usage information.

#### Other bugs & improvements

- Fixed regression in Go mod vendoring. Thank you
[`@sourcec0de`](https://github.com/sourcec0de)!

### Python

#### Breaking Changes

##### `@polar_class` is deprecated in favor of `Oso#register_class`

The `@polar_class` decorator used to register classes with Polar has been deprecated. To register a class with Polar it is now necessary to use the [`Oso#register_class`](https://docs.osohq.com/reference/api/index.html#oso.Oso.register_class) API.

##### New data filtering configuration API is now mandatory

The original data filtering configuration API using per-class `build_query`, `exec_query`, and `combine_query` methods
has been removed. Data filtering is now configured through [the new Adapter API]({{< ref path="guides/data_filtering" lang="python" >}}).

### Ruby

#### Breaking Changes

{{% callout "Warning" "orange" %}}
This release contains breaking changes. Be sure to follow migration steps
before upgrading.
{{% /callout %}}

##### New data filtering configuration API is now mandatory

The original data filtering configuration API using per-class `build_query`, `exec_query`, and `combine_query` methods
has been removed. Data filtering is now configured through [the new Adapter API]({{< ref path="guides/data_filtering" lang="ruby" >}}).

### Node.js

#### Breaking Changes

{{% callout "Warning" "orange" %}}
This release contains breaking changes. Be sure to follow migration steps
before upgrading.
{{% /callout %}}

##### New data filtering configuration API is now mandatory

The original data filtering configuration API using per-class `buildQuery`, `execQuery`, and `combineQuery` methods
has been removed. Data filtering is now configured through [the new Adapter API]({{< ref path="guides/data_filtering" lang="node" >}}).

## VS Code extension 0.26.0

### New features

#### Configuring which Polar files are treated as part of the same policy

The `oso.polarLanguageServer.projectRoots` VS Code workspace configuration
setting can be used to control which Polar files in a particular workspace
folder are treated as part of the same Oso policy. For more details, see [the
docs](reference/tooling/ide#configuring-which-polar-files-are-treated-as-part-of-the-same-policy).
65 changes: 9 additions & 56 deletions docs/content/any/project/changelogs/NEXT.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,65 +3,29 @@ title: Release YYYY-MM-DD
menuTitle: YYYY-MM-DD
any: true
description: >-
Changelog for Release YYYY-MM-DD (oso 0.26.0, VS Code extension 0.26.0)
containing new features, bug fixes, and more.
Changelog for Release YYYY-MM-DD (RELEASED_VERSIONS) containing new features,
bug fixes, and more.
draft: true
---

## `oso` 0.26.0
## `RELEASED_PACKAGE_1` NEW_VERSION

### Core

#### Other bugs & improvements

- Fixed a bug affecting runtime type checking on nested object attributes.

### Go
### LANGUAGE (e.g., 'Core' or 'Python' or 'Node.js')

#### Breaking changes

<!-- TODO: remove warning and replace with "None" if no breaking changes. -->

{{% callout "Warning" "orange" %}}
This release contains breaking changes. Be sure to follow migration steps
before upgrading.
{{% /callout %}}

##### Updated Go type checking behavior

When evaluating whether a given query variable matches a Go type Polar will now use direct instance comparisons instead of Go's `reflect.ConvertibleTo` functionality. This change resolves false-positive type checking results where discrete structs with identical sets of fields were considered to be equivalent.

This change has implications for the use of NewTypes in Polar rule definitions. Rules that are defined using NewTypes will now only match instances of the NewType and no longer match the underlying wrapped type.

Rules which consume NewTypes must now be specialized over the NewType directly and not the underlying wrapped type.

```go
type Action string
const (
View Action = "view"
Create Action = "create"
Update Action = "update"
)
```

Where previously it was possible to utilize this `Action` type as interchangeable with that of `string`:
```polar
user_has_action(user: User, action: String, resource: Resource) if ...
```
##### Breaking change 1

This rule definition must be rewritten as follows:
Summary of breaking change.

```polar
user_has_action(user: User, action: Action, resource: Resource) if ...
```

### Python

#### Breaking Changes

##### `@polar_class` is deprecated in favor of `Oso#register_class`

The `@polar_class` decorator used to register classes with Polar has been deprecated. To register a class with Polar it is now necessary to use the [`Oso#register_class`](https://docs.osohq.com/reference/api/index.html#oso.Oso.register_class) API.

### `LANGUAGE`
Link to [migration guide]().

#### New features

Expand All @@ -76,14 +40,3 @@ Link to [relevant documentation section]().
- Bulleted list
- Of smaller improvements
- Potentially with doc [links]().

## VS Code extension 0.26.0

### New features

#### Configuring which Polar files are treated as part of the same policy

The `oso.polarLanguageServer.projectRoots` VS Code workspace configuration
setting can be used to control which Polar files in a particular workspace
folder are treated as part of the same Oso policy. For more details, see [the
docs](reference/tooling/ide#configuring-which-polar-files-are-treated-as-part-of-the-same-policy).
2 changes: 1 addition & 1 deletion docs/examples/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ JS_DIR := $(OSO_ROOT)/languages/js
RUBY_DIR := $(OSO_ROOT)/languages/ruby

# Needed for tests
JAVA_PACKAGE_JAR_PATH := $(JAVA_DIR)/oso/target/oso-0.25.1.jar
JAVA_PACKAGE_JAR_PATH := $(JAVA_DIR)/oso/target/oso-0.26.0.jar

# Note: if you are using bundler in a sub-makefile (in a docs test for example),
# you need to add `unexport BUNDLE_GEMFILE` to that makefile. Otherwise this
Expand Down
1 change: 1 addition & 0 deletions docs/spelling/allowed_words.txt
Original file line number Diff line number Diff line change
Expand Up @@ -243,4 +243,5 @@ unsafety
unspecialized
untaken
vec
vendoring
webpack
2 changes: 1 addition & 1 deletion languages/java/oso/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

<groupId>com.osohq</groupId>
<artifactId>oso</artifactId>
<!-- oso_version --><version>0.25.1</version>
<!-- oso_version --><version>0.26.0</version>

<distributionManagement>
<snapshotRepository>
Expand Down
2 changes: 1 addition & 1 deletion languages/js/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "oso",
"version": "0.25.1",
"version": "0.26.0",
"description": "oso authorization library.",
"bin": "bin/repl.js",
"main": "dist/src/index.js",
Expand Down
2 changes: 1 addition & 1 deletion languages/python/django-oso/django_oso/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@

from .oso import Oso

__version__ = "0.25.1"
__version__ = "0.26.0"

default_app_config = "django_oso.apps.DjangoOsoConfig"
2 changes: 1 addition & 1 deletion languages/python/django-oso/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
oso~=0.25.0
oso~=0.26.0
django>=2.2
4 changes: 2 additions & 2 deletions languages/python/docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@
project = "oso"
copyright = "2020-2021 Oso Security, Inc"
author = "oso"
version = "0.25.1"
release = "0.25.1"
version = "0.26.0"
release = "0.26.0"


# -- General configuration ---------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion languages/python/flask-oso/flask_oso/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
__version__ = "0.25.1"
__version__ = "0.26.0"

from .flask_oso import FlaskOso
from .decorators import authorize, skip_authorization
Expand Down
2 changes: 1 addition & 1 deletion languages/python/flask-oso/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
oso~=0.25.0
oso~=0.26.0
flask>=0.12.0
2 changes: 1 addition & 1 deletion languages/python/oso/oso/oso.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"""Core oso functionality"""

__version__ = "0.25.1"
__version__ = "0.26.0"

import os
from typing import List, Any, Set
Expand Down
2 changes: 1 addition & 1 deletion languages/python/sqlalchemy-oso/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
oso~=0.25.0
oso~=0.26.0
SQLAlchemy>=1.3.17,<1.5
packaging~=20.9
2 changes: 1 addition & 1 deletion languages/python/sqlalchemy-oso/sqlalchemy_oso/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
__version__ = "0.25.1"
__version__ = "0.26.0"


from .auth import register_models
Expand Down
2 changes: 1 addition & 1 deletion languages/ruby/Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PATH
remote: .
specs:
oso-oso (0.25.1)
oso-oso (0.26.0)
ffi (~> 1.0)

GEM
Expand Down
2 changes: 1 addition & 1 deletion languages/ruby/lib/oso/version.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# frozen_string_literal: true

module Oso
VERSION = '0.25.1'
VERSION = '0.26.0'
end
2 changes: 1 addition & 1 deletion languages/rust/oso-derive/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ license = "Apache-2.0"
homepage = "https://github.com/osohq/oso"
readme = "README.md"

version = "0.25.1"
version = "0.26.0"

edition = "2021"

Expand Down
Loading

1 comment on commit 42f249a

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rust Benchmark

Benchmark suite Current: 42f249a Previous: e0ae6f1 Ratio
rust_get_attribute 45467 ns/iter (± 2095) 51159 ns/iter (± 4367) 0.89
n_plus_one/100 2282956 ns/iter (± 37527) 2446622 ns/iter (± 71120) 0.93
n_plus_one/500 10915377 ns/iter (± 102333) 12272661 ns/iter (± 542641) 0.89
n_plus_one/1000 21713821 ns/iter (± 337164) 24220250 ns/iter (± 719619) 0.90
unify_once 986 ns/iter (± 46) 1085 ns/iter (± 86) 0.91
unify_twice 2592 ns/iter (± 555) 2713 ns/iter (± 110) 0.96
many_rules 63884 ns/iter (± 1288) 68004 ns/iter (± 3302) 0.94
fib/5 537975 ns/iter (± 8039) 578905 ns/iter (± 27708) 0.93
prime/3 18196 ns/iter (± 772) 19516 ns/iter (± 5703) 0.93
prime/23 18188 ns/iter (± 826) 19548 ns/iter (± 1993) 0.93
prime/43 18196 ns/iter (± 788) 19661 ns/iter (± 1723) 0.93
prime/83 18188 ns/iter (± 770) 19452 ns/iter (± 1363) 0.94
prime/255 16536 ns/iter (± 654) 17920 ns/iter (± 1017) 0.92
indexed/100 5976 ns/iter (± 670) 6510 ns/iter (± 1387) 0.92
indexed/500 7469 ns/iter (± 2208) 8175 ns/iter (± 2227) 0.91
indexed/1000 9200 ns/iter (± 233) 10178 ns/iter (± 6351) 0.90
indexed/10000 25450 ns/iter (± 2303) 18000 ns/iter (± 4181) 1.41
not 6173 ns/iter (± 1194) 6619 ns/iter (± 369) 0.93
double_not 12517 ns/iter (± 252) 13582 ns/iter (± 814) 0.92
De_Morgan_not 8143 ns/iter (± 231) 8562 ns/iter (± 381) 0.95
load_policy 892721 ns/iter (± 3862) 950472 ns/iter (± 23137) 0.94
partial_and/1 32371 ns/iter (± 1398) 35222 ns/iter (± 2491) 0.92
partial_and/5 112883 ns/iter (± 3332) 121439 ns/iter (± 6603) 0.93
partial_and/10 214697 ns/iter (± 4353) 231602 ns/iter (± 16696) 0.93
partial_and/20 435840 ns/iter (± 6724) 467711 ns/iter (± 21105) 0.93
partial_and/40 924653 ns/iter (± 12083) 998808 ns/iter (± 29374) 0.93
partial_and/80 2080529 ns/iter (± 3605) 2317162 ns/iter (± 89088) 0.90
partial_and/100 2749677 ns/iter (± 4757) 3109555 ns/iter (± 168321) 0.88
partial_rule_depth/1 104268 ns/iter (± 4155) 111883 ns/iter (± 5461) 0.93
partial_rule_depth/5 337936 ns/iter (± 7429) 364256 ns/iter (± 23875) 0.93
partial_rule_depth/10 732416 ns/iter (± 12972) 806790 ns/iter (± 46649) 0.91
partial_rule_depth/20 2048639 ns/iter (± 5386) 2326833 ns/iter (± 180110) 0.88
partial_rule_depth/40 7499724 ns/iter (± 99796) 8727450 ns/iter (± 290968) 0.86
partial_rule_depth/80 44884121 ns/iter (± 436547) 58064723 ns/iter (± 1783949) 0.77
partial_rule_depth/100 82826994 ns/iter (± 606662) 109466550 ns/iter (± 3478705) 0.76

This comment was automatically generated by workflow using github-action-benchmark.

Please sign in to comment.