opa
opa copied to clipboard
Support for Running OPA Test Server via Bundle
What is the underlying problem you're trying to solve?
I believe we should be able to start a test server via bundle.tar.gz
.
Right now, I see that there is a way for creating a MockBundle
out of policies given as map[string]string
.
Ref: https://github.com/open-policy-agent/opa/blob/b5173dbcf2df774ba0e9f6702043368e11c6d1db/sdk/opa_test.go#L103
Describe an "Ideal" solution
Having the .MustNewServer
support loading bundle .tar.gz
files directly.
Ref: https://github.com/open-policy-agent/opa/blob/2eee58c2c13dbce0f1caaf208b03ad382c780ef5/sdk/opa_test.go#L103
Describe a "Good Enough" solution
A Good Enough Solution would be for a function to convert a policy bundle tar.gz
file to map[string]string
. So that we can use the existing solution to start the OPA Test Server.
In the past, I've started a simple http server in my tests, and had the SDK's config use that. Worked out fine. Do you think that would be an option for you?
This issue has been automatically marked as inactive because it has not had any activity in the last 30 days.
Hi @srenatus ,
Yeah, I am also doing the same. But we have to do one step extra for starting the HTTP server. This can be solved by taking the .tar.gz
as input.
This issue has been automatically marked as inactive because it has not had any activity in the last 30 days.
This issue has been automatically marked as inactive because it has not had any activity in the last 30 days.
Closing this as we have a way to provide a server config in the SDK.