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

Expose simple Go API to enable OPA config embedding #3140

Closed
tsandall opened this issue Feb 9, 2021 · 1 comment
Closed

Expose simple Go API to enable OPA config embedding #3140

tsandall opened this issue Feb 9, 2021 · 1 comment
Assignees

Comments

@tsandall
Copy link
Member

tsandall commented Feb 9, 2021

We don't do a good job of enabling OPA config embedding today yet there are several use cases where a simple Go API that instantiates the management plugins and exposes an evaluation function would be useful. The beginnings of this idea are here: https://github.com/open-policy-agent/example-api-authz-go/blob/master/internal/opa/opa.go.

We should introduce a simple Go API like the one linked above inside of OPA proper and document when and how to use it on the website.

Some improvements need to be made to the code linked above:

  • Evaluation should not be limited to boolean responses (e.g., use interface{})
  • Evaluation should leverage prepared queries to avoid unnecessary work.
@tsandall tsandall added this to TODO (Things That Should Be Done) in Open Policy Agent via automation Feb 9, 2021
@tsandall tsandall moved this from TODO (Things That Should Be Done) to Planned (Things We Are Going To Do) in Open Policy Agent Feb 16, 2021
@tsandall tsandall moved this from Planned (Things We Are Going To Do) to In Progress in Open Policy Agent Feb 16, 2021
anderseknert added a commit to anderseknert/opa that referenced this issue Mar 24, 2021
Create simple constructs for instantiating OPA with the same configuation
options as provided the standalone application.

Included in PR also a simple management API server implementation for testing,
which could be useful both for SDK integration testing as well as for internal
tests. Plan is to extend this and move much of the repeated logic around this
in plugin tests et. al. in here.

Closes open-policy-agent#3140

Signed-off-by: Anders Eknert <anders@eknert.com>
@anderseknert
Copy link
Member

This is done, though we still need to document the SDK and update some of our side project repos to use it. Closing and creating separate issue for docs.

Open Policy Agent automation moved this from In Progress to Done May 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

Successfully merging a pull request may close this issue.

2 participants