oso 0.0.3

Breaking changes

Warning

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

Removed arguments to @polar_class decorator

The oso.polar_class() decorator no longer accepts fields or methods arguments. Any field or method defined on the Application Class will be accessible from Polar by default.

Before:

@polar_class(fields=("id", "name", "specialty"), methods=("department", "hospital"))
class Doctor:
    ...

After:

@polar_class
class Doctor:
    ...

Attempt to unify Python instances in Polar results in error

Fix for undefined behavior of application instance unification. Now results in the following error message:

PolarRuntimeException: Invalid operation: cannot unify Python instance objects.

Before:

allow(actor: User, action, resource) if
  actor = resource.owner();

Since actor is an instance of the User application class, any attempt to unify actor (using the = operator) will result in a PolarRuntimeException.

After:

The appropriate way to compare application instance objects is to use field-by-field comparison.

allow(actor: User, action, resource) if
  actor.id = resource.owner().id;

Other bugs & improvements

  • Bug fix: Nested logical operators now evaluate appropriately.

Connect with us on Slack

If you have any questions, or just want to talk something through, jump into Slack. An Oso engineer or one of the thousands of developers in the growing community will be happy to help.