Skip to content

[Feature] Support wildcards in model paths for '.fga' files #538

@dyeam0

Description

@dyeam0

Problem statement

Currently, when working with multiple authorization model files (.fga), each file path must be explicitly defined. For projects with a large number of .fga files, this becomes cumbersome and difficult to manage. It requires more maintenance and is error-prone. Users must manage a large quantity of .fga files and would benefit from a more streamlined way to include them.

Proposed solution

Add support for wildcards or regular expressions in the file paths for authorization models. This would allow users to include multiple .fga files using a single pattern.

For example, with an fga.mod manifest file:

schema: '1.2'
contents:
  - core.fga
  - parent_directory/subdirectory_1/foo.fga
  - parent_directory/subdirectory_1/bar.fga
  - parent_directory/subdirectory_1/baz.fga
  - parent_directory/subdirectory_2/foo.fga
  - parent_directory/subdirectory_2/bar.fga

For example, instead of listing each file individually, a user could specify a path like parent_directory/subdirectory_1/*.fga to include all .fga files within that directory.

Alternatives and current workarounds

The only alternative is the current method of manually listing each file, which is not ideal for larger projects.

Addional context

This feature should be implemented in the OpenFGA CLI. Additionally, this functionality should be considered for the VS Code and JetBrains extensions, as they also parse .fga files and would benefit from this enhancement for a consistent user experience across tools.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status

    Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions