Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move rego files into their respective apps #7806

Merged
merged 1 commit into from
Apr 29, 2024

Commits on Apr 25, 2024

  1. Move rego files into their respective apps

    This is the promised sequel to cvat-ai#7734. After this change, the `iam` app will
    no longer contain any code specific to other apps.
    
    To make this work, the `/api/auth/rules` endpoint will now construct the OPA
    bundle from a set of paths, which will be populated by `load_app_permissions`.
    
    Move OPA test files accordingly. Fortunately, `opa test` accepts multiple
    directories, so it is trivial to adapt the testing instructions.
    
    Make the necessary adaptations to `generate_tests.py` to search for test
    generators in every app. The original parameters of `generate_tests.py` don't
    really make sense when there are multiple `rules` directory, so remove them.
    
    Instead, add a new `--apps-dir` parameter. This parameter isn't really
    needed to test the open source version of CVAT, but I expect it to be useful
    for testing the Enterprise version.
    
    In addition, add some safety checks to `generate_tests.py`:
    
    * Make sure that we find at least one test generator.
    
    * Propagate exceptions from `call_generator` into the main thread.
    SpecLad committed Apr 25, 2024
    Configuration menu
    Copy the full SHA
    e4a341b View commit details
    Browse the repository at this point in the history