opa icon indicating copy to clipboard operation
opa copied to clipboard

Support for Running OPA Test Server via Bundle

Open maheshmedam opened this issue 2 years ago • 3 comments

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.

maheshmedam avatar Jul 14 '22 06:07 maheshmedam

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?

srenatus avatar Jul 22 '22 15:07 srenatus

This issue has been automatically marked as inactive because it has not had any activity in the last 30 days.

stale[bot] avatar Sep 11 '22 20:09 stale[bot]

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.

maheshmedam avatar Sep 12 '22 04:09 maheshmedam

This issue has been automatically marked as inactive because it has not had any activity in the last 30 days.

stale[bot] avatar Oct 12 '22 07:10 stale[bot]

This issue has been automatically marked as inactive because it has not had any activity in the last 30 days.

stale[bot] avatar Feb 11 '23 03:02 stale[bot]

Closing this as we have a way to provide a server config in the SDK.

ashutosh-narkar avatar Mar 08 '23 01:03 ashutosh-narkar