Release: Oso 0.23.0 is out, including a Python 3.10 build and better Prisma support in Typescript

Oso 0.23.0 is out! It includes:

  • Feature preview for Prisma-like plain objects in Typescript/Javascript
  • Support for python 3.10
  • Support for musl-based Linux
  • Better filtering support for eager-loaded relationships in sqlalchemy-oso
  • Tweaks to data filtering: fixed a crash and added a requirement for field registration

[Feature Preview] Prisma-style plain objects in Typescript

If you're using Prisma, you might have noticed that Oso's type checking doesn't work with the "plain old javascript objects" that Prisma uses to represent model instances.

That's because the Oso Typescript library typically determines an object's type by looking at its prototype and comparing that to the registered classes. To make type checks compatible with Prisma (and any other plain objects), we're trying out a feature that lets you override how type checks are performed.

In the example below, any object with type === "user" will be considered a User by the Oso runtime. Note the isaCheck argument to registerClass:

oso.registerClass(Object, {
  name: "User",
  isaCheck: instance => instance.type === "user"

If you're interested in using Oso with Prisma, reach out on our Slack or schedule a 1x1 with an Oso engineer. We'd love to help you get started!

Python 3.10

Python 3.10 launched last month, and we've responded by building wheels for Python 3.10 in our CI releases. If you're running Python 3.10, you can now install Oso with a simple pip install oso.

Eager-loaded relationships in sqlalchemy-oso

sqlalchemy-oso now detects entities that are loaded due to relationship loading options declared on the model or query. For example:

orgs = query(Org).options(joinedload(Org.repositories)).all()
repositories = orgs[0].repositories

In that example, repositories now contains only authorized data according to the policy. In previous versions of sqlalchemy-oso, repositories would not be authorized with the joinedload option.

For more about data filtering in sqlalchemy-oso, check out the docs.

Other Bug Fixes and Improvements

  • In Typescript, we use Oso's Class type to represent abstract types for configuring data filtering. If you need to use that type in your own method signatures, you're in luck. It's now a top-level export from the oso library: import { Class } from "oso".
  • Oso's Rust REPL was having some serious problems outputting text, which we've sorted out with a well-placed fmt.Println.
  • We added support for musl-based Linux distributions. If you use a musl distro like Alpine, you can now install Oso using pip install oso instead of downloading the wheel files manually from Github.
  • We're plotting some big improvements to the way data filtering works, and in preparation for that we've made an important API change to class registration. Also, Gwen fixed a crash that could happen in some rare data filtering scenarios. Go Gwen.

For more details on these and other changes, read the changelog.

Set up a 1x1 with an Oso engineer

Our team is happy to help you get started with Oso. If you'd like to try out any of these new features, or if you're interested in learning how to use Oso in your app, schedule a 1x1 with an Oso engineers.

Our team is also available to help in Slack.

Want us to remind you?

We'll email you before the event with a friendly reminder.

The best way to learn is to get your hands dirty.