Skip to content

Commit

Permalink
v0.7.0 (#473)
Browse files Browse the repository at this point in the history
  • Loading branch information
gj committed Oct 13, 2020
1 parent 10154d0 commit 3e6009a
Show file tree
Hide file tree
Showing 22 changed files with 138 additions and 98 deletions.
6 changes: 3 additions & 3 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.6.0
0.7.0
2 changes: 1 addition & 1 deletion docs/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export JS_DIR := $(abspath ../languages/js)

rwildcard=$(foreach d,$(wildcard $(1:=/*)),$(call rwildcard,$d,$2) $(filter $(subst *,%,$2),$d))

JAVA_PACKAGE_JAR_PATH := $(JAVA_DIR)/target/oso-0.6.0.jar
JAVA_PACKAGE_JAR_PATH := $(JAVA_DIR)/target/oso-0.7.0.jar

RUBY_FILES := $(call rwildcard,../languages/ruby/lib,*.rb)
JAVA_FILES := $(call rwildcard ../languages/java/oso/src, *.java)
Expand Down
96 changes: 96 additions & 0 deletions docs/changelogs/0.7.0.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
=====
0.7.0
=====

**Release date:** 2020-10-13

Breaking changes
================

.. warning:: This release contains breaking changes. Be sure
to follow migration steps before upgrading.

``Oso.clear()`` replaced with ``Oso.clear_rules()``/``clearRules()``
--------------------------------------------------------------------

The ``Oso.clear()`` method in oso's language libraries has been removed.
To clear rules from the Polar knowledge base, use the new ``clear_rules()``
(or ``clearRules()``) method, which clears rules but leaves registered classes
and constants in place.

To migrate, replace calls to ``Oso.clear()`` with either ``Oso.clear_rules()`` or
``Oso.clearRules()``, depending on the library you are using.
It is no longer necessary to re-register classes/constants after clearing.

Method signature for ``Oso.register_constant()`` updated
--------------------------------------------------------

The parameters were swapped to mirror the signature of
``Oso.register_class()``.

Select Ruby methods now return ``self`` to enable method chaining
-----------------------------------------------------------------

- ``Oso#clear_rules``
- ``Oso#load_file``
- ``Oso#load_str``
- ``Oso#register_class``
- ``Oso#register_constant``

Custom constructors no longer supported in the Java, Python, or Ruby libraries
------------------------------------------------------------------------------

For the Java, Python, and Ruby libraries, custom constructors are a relic. They
were useful for translating keyword args into positional args before oso
supported supplying positional args when constructing an instance via Polar's
:ref:`new operator <operator-new>`. They were also useful for specifying a
``find_or_create``-style class method as a constructor, but that's been
superseded by the introduction of calling methods directly on registered
constants, including classes.

To migrate, replace usage of a custom constructor with an equivalent class
method.

Note that custom constructors are still supported for the Rust library since
specifying a static ``new`` method for a type is nothing more than a
convention.

New features
============

List filtering in ``django-oso`` (preview)
-------------------------------------------

oso can now respond to some queries with a set of constraints instead of a yes
or no decision. In the ``django-oso`` library, the
:py:meth:`django_oso.auth.authorize_model` function and
:py:class:`django_oso.models.AuthorizedModel` class have been added to use this
functionality to authorize a **collection** of objects. Instead of fetching
all objects and evaluating a query, the relevant authorization constraints will
be pushed down to the ORM and applied to a Django ``QuerySet``.

This feature makes implementing list endpoints with authorization more
performant, since authorization does not need to be applied after fetching
data.

**This feature is currently in preview.**

.. todo:: Link to blog post

Other bugs & improvements
=========================

- Language libraries that haven't yet implemented operations on application
instances (Java, Node.js, Ruby, Rust) now throw a uniform error type.

Improvements to the debugger
----------------------------

- Changes to the way stepping is implemented:
- ``step`` steps by query instead of goal.
- ``over`` and ``out`` are now implemented using a stack that tracks query
parents.
- New ``goal`` command to step by goal (the way ``step`` used to work).
- New ``stack`` command to show all parent queries of the current one.
- ``query n`` command can take an integer argument ``n`` to inspect the query
at the nth level of the stack.
90 changes: 17 additions & 73 deletions docs/changelogs/vNEXT.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,91 +7,35 @@ NEXT
Breaking changes
================

.. TODO remove warning and replace with "None" if no breaking
changes.
.. warning:: This release contains breaking changes. Be sure
to follow migration steps before upgrading.

``Oso.clear()`` replaced with ``Oso.clear_rules()``/``clearRules()``
--------------------------------------------------------------------

The ``Oso.clear()`` method in oso's language libraries has been removed.
To clear rules from the Polar knowledge base, use the new ``clear_rules()``
(or ``clearRules()``) method, which clears rules but leaves registered classes
and constants in place.

To migrate, replace calls to ``Oso.clear()`` with either ``Oso.clear_rules()`` or
``Oso.clearRules()``, depending on the library you are using.
It is no longer necessary to re-register classes/constants after clearing.

Method signature for ``Oso.register_constant()`` updated
--------------------------------------------------------

The parameters were swapped to mirror the signature of
``Oso.register_class()``.

Select Ruby methods now return ``self`` to enable method chaining
-----------------------------------------------------------------

- ``Oso#clear_rules``
- ``Oso#load_file``
- ``Oso#load_str``
- ``Oso#register_class``
- ``Oso#register_constant``

Custom constructors no longer supported in the Java, Python, or Ruby libraries
------------------------------------------------------------------------------
Breaking change 1
-----------------

For the Java, Python, and Ruby libraries, custom constructors are a relic. They
were useful for translating keyword args into positional args before oso
supported supplying positional args when constructing an instance via Polar's
:ref:`new operator <operator-new>`. They were also useful for specifying a
``find_or_create``-style class method as a constructor, but that's been
superseded by the introduction of calling methods directly on registered
constants, including classes.
- summary of breaking change

To migrate, replace usage of a custom constructor with an equivalent class
method.

Note that custom constructors are still supported for the Rust library since
specifying a static ``new`` method for a type is nothing more than a
convention.
Link to migration guide

New features
============

List filtering in ``django-oso`` (preview)
-------------------------------------------

oso can now respond to some queries with a set of constraints instead of a
yes or no decision. In the ``django-oso`` library, the
:py:meth:`django_oso.auth.authorize_model` function and
:py:class:`django_oso.models.AuthorizedModel` class have been added to use this
functionality to authorize a **collection** of objects. Instead of fetching all
objects and evaluating a query, the relevant authorization constraints will be
pushed down to the ORM and applied to a Django ``QuerySet``.

This feature makes implementing list endpoints with authorization more
performant, since authorization does not need to be applied after fetching data.

**This feature is currently in preview.**
Feature 1
---------

- summary
- of
- user facing changes

.. todo:: Link to blog post

Link to relevant documentation section

Other bugs & improvements
=========================

- Language libraries that haven't yet implemented operations on application
instances (Java, Node.js, Ruby, Rust) now throw a uniform error type.

Improvements to the debugger
----------------------------

- Changes to the way stepping is implemented:
- ``step`` steps by query instead of goal.
- ``over`` and ``out`` are now implemented using a stack that tracks query
parents.
- New ``goal`` command to step by goal (the way ``step`` used to work).
- New ``stack`` command to show all parent queries of the current one.
- ``query n`` command can take an integer argument ``n`` to inspect the query
at the nth level of the stack.
- bulleted list
- improvements
- of smaller
- potentially with doc links
2 changes: 0 additions & 2 deletions docs/changelogs/vTEMPLATE.rst
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ Breaking change 1

Link to migration guide


New features
============

Expand All @@ -33,7 +32,6 @@ Feature 1

Link to relevant documentation section


Other bugs & improvements
=========================

Expand Down
4 changes: 2 additions & 2 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@
project = "oso"
copyright = "2020 Oso Security, Inc"
author = "oso"
version = "0.6"
release = "0.6.0"
version = "0.7"
release = "0.7.0"


# -- General configuration ---------------------------------------------------
Expand Down
1 change: 1 addition & 0 deletions docs/download.rst
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,7 @@ Releases
:maxdepth: 1
:caption: See below for release notes:

v0.7.0 <changelogs/0.7.0>
v0.6.0 <changelogs/0.6.0>
v0.5.2 <changelogs/0.5.2>
v0.5.1 <changelogs/0.5.1>
Expand Down
3 changes: 2 additions & 1 deletion docs/spelling_allowed_words.txt
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ arity
NaN
constructable
precommit
args

## Product names
sqlite
Expand Down Expand Up @@ -102,4 +103,4 @@ vec
toml
enums
proc
io
io
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>
<version>0.6.0</version>
<version>0.7.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.6.0",
"version": "0.7.0",
"description": "oso authorization library.",
"main": "dist/src/index.js",
"bin": "bin/repl.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.2.0"
__version__ = "0.3.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.6.0
oso~=0.7.0
django~=3.0
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.3.0"
__version__ = "0.4.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.6.0
oso~=0.7.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.6.0"
__version__ = "0.7.0"

from pathlib import Path
import os
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.6.0)
oso-oso (0.7.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.6.0'
VERSION = '0.7.0'
end
2 changes: 1 addition & 1 deletion languages/rust/oso/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ required-features = ["anyhow"]
[dependencies]
impl-trait-for-tuples = { git = "https://github.com/bkchr/impl-trait-for-tuples", rev = "c6781ff" }
maplit = "1.0.2"
polar-core = { path = "../../../polar-core", version = "=0.6.0" }
polar-core = { path = "../../../polar-core", version = "=0.7.0" }
oso-derive = { path = "../oso-derive", version = "=0.6.0-alpha", optional = true }
thiserror = "1.0.21"
tracing = { version = "0.1.21", features = ["log"] }
Expand Down
4 changes: 2 additions & 2 deletions polar-c-api/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "polar-c-api"
version = "0.6.0"
version = "0.7.0"
authors = ["Oso Security, Inc. <support@osohq.com>"]
edition = "2018"

Expand All @@ -10,7 +10,7 @@ crate-type = ["lib", "staticlib", "cdylib"]
bench = false

[dependencies]
polar-core = { path = "../polar-core", version = "0.6.0" }
polar-core = { path = "../polar-core", version = "0.7.0" }
serde = { version = "1.0.116", features = ["derive", "rc"] }
serde_json = "1.0.58"

Expand Down
2 changes: 1 addition & 1 deletion polar-core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ authors = ["Oso Security, Inc. <support@osohq.com>"]
license = "Apache-2.0"
homepage = "https://github.com/osohq/oso"

version = "0.6.0"
version = "0.7.0"

edition = "2018"

Expand Down

1 comment on commit 3e6009a

@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: 3e6009a Previous: 10154d0 Ratio
unify_once 814 ns/iter (± 60) 876 ns/iter (± 67) 0.93
unify_twice 2457 ns/iter (± 271) 2620 ns/iter (± 177) 0.94
many_rules 63582 ns/iter (± 5439) 66510 ns/iter (± 3130) 0.96
fib/5 519388 ns/iter (± 36315) 532608 ns/iter (± 5804) 0.98
prime/3 18144 ns/iter (± 1587) 18646 ns/iter (± 1068) 0.97
prime/23 17761 ns/iter (± 2020) 18678 ns/iter (± 4032) 0.95
prime/43 17661 ns/iter (± 2056) 18530 ns/iter (± 740) 0.95
prime/83 17838 ns/iter (± 1438) 18722 ns/iter (± 1150) 0.95
prime/255 15837 ns/iter (± 1315) 16486 ns/iter (± 1112) 0.96
indexed/1 5311 ns/iter (± 394) 5508 ns/iter (± 382) 0.96
indexed/10 5362 ns/iter (± 331) 5538 ns/iter (± 1308) 0.97
indexed/100 5898 ns/iter (± 1224) 6038 ns/iter (± 889) 0.98

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

Please sign in to comment.