Skip to main content

Modular Models

· 2 min read

Modular models aims to improve the model authoring experience when multiple teams are maintaining a model, such as:

  • A model can grow large and difficult to understand
  • As more teams begin to contribute to a model, the ownership boundaries may not be clear and code review processes might not scale

With modular models, a single model can be separated across multiple files allow grouping of types and conditions into modules. This means that a model can be organized more easily in terms of team or organizational structure. Used in conjunction with features such as GitHub, GitLab or Gitea's code owners, it should become easier to ensure the owners of a portion of your model are correctly assigned to review it.

How to use it?

Modular models is currently shipped as an experimental feature while we gather feedback, in order for you to try it out.

  • Update to the v0.3.0 release of the CLI
    • With the CLI you will be able to write your modular model and test it against a store file you have, but you will not be able to write your model to any OpenFGA server that does not enable this feature.
  • Update to v0.2.20 of the VS Code Extension
  • Download v1.5.1 of OpenFGA
    • As this is currently experimental, you will need to start OpenFGA with openfga run --experimental enable-modular-models.
  • Check out the modular models sample store in the sample-stores repo
  • Review the documentation for this feature

What's next?

We intend to move this feature out of RC within the next few weeks, so as we gather feedback we'll deal with any issues that arise and look to improve upon any areas of the developer experience as needed.

Looking beyond the near term, modular models allows us to implement additional API authorization options for OpenFGA.

Reach out!

We want to learn how you use this feature and how we can improve it!

Please reach out through our community channels with any questions or feedback.