Skip to main content

Launch Week, Day 4 - GitOps & Testing Workflows with the Warrant CLI

· 3 min read
Aditya Kajla
Co-Founder @ Warrant

Launch Week, Day 4

Welcome to Day 4 of Launch Week! In case you're just joining us, check out what we launched on Day 1, Day 2, and Day 3.

Yesterday's post detailed many of the enhancements we've made to Warrant over the past few months to improve overall performance and resiliency in production. Today's post is going to focus exclusively on testing and correctness, which are equally (if not more) important in an authorization service.

Testing your authorization model with assertions

First up, we're excited to announce that the Warrant CLI now supports test assertions! You can now easily write test cases using the CLI to test your access model:

warrant check user:john member permission:create-reports --assert true

An example test cmd that returns true if user:john has the create-reports permission

The Warrant Dashboard has always had a Check Access page where you can quickly check one-off rules. However, what we learned from customers is that they wanted an easy way to write automated tests for Warrant that could be run as regression test suites (either locally or in CI) prior to making any changes to an access model.

So we decided to augment the existing CLI check command with 'assert' capabilities to provide an easy, platform/framework-agnostic way to write test cases. You can now easily write a shell script that sets up a Warrant test environment, runs test cases, and does a full clean-up, all automatically.

Check out the testing guide for more details.

Managing object types via a GitOps workflow

The most important part of a Warrant authorization model is the object types schema. If you compare Warrant to a relational database, the object types schema is similar to a relational database's table schema. Both define the primitives that drive the underlying data-model. And just like with relational table schemas, Warrant object types might need to be updated as applications change over time.

In order to facilitate safer updates to object types schemas, we've created a new, built-in GitOps workflow that utilizes the CLI, object types APIs, and environments to enable automated testing & deployment of object types changes.

Check out the full guide to get started and set up your workflow.

That's it for day 4! We hope you're as excited about these testing improvements as we are! Join us back here tomorrow for day 5, and be sure to join us on Slack to talk shop, give us your feedback, or tell us what you'd like to see us work on next!