Create policies programatically

Open
#594 1 comment 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
25/100
Issue type
Feature
Clarity
Needs clarification
Activity status
Stale
Tech stack
rust

Research direction

Start with the existing documentation and code around Module and Engine, then determine whether policies can be created and imported without using their plain-text representation. Compare constructing the AST directly with using a JSON AST representation, including the stability and Span concerns mentioned in the issue. Done means documenting a supported approach or defining the required API and its scope.

Written by the indexing model from the issue text.

Description

As I can see from the documentation and the code, there is no way right now to programatically create and import policies without going through their plain text representation.

Is there any plans (and is it wanted) to be able to craft Modules and import them into the Engine, either through the JSON representation of the AST, or by building the AST ourselves? Or is there already a way to do this I am not seeing?

I figure there are questions of stability of the internal AST, which is why it is not exported right now, and that it is very dependent on Spans, so it would not be a light endeavour, but I am putting it out there.


I realize that the AST is most probably the wrong level of abstraction for what I want to do, which is to retrieve allow to dynamically creating, storing, retrieving and evaluating policies, but was wondering how to do that.

Dominant language
Rust
Stars
375
Forks
81
Avg merge
1d 11h
Merged PRs (30d)
78

Getting set up

Open in Codespaces

Starts the project's dev container in your browser, under your own GitHub account.

  • No Dockerfile or Docker Compose file
  • No pull request template
  • No contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from microsoft/regorus

All issues in microsoft/regorus

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.