mirror of
https://github.com/opencloud-eu/opencloud.git
synced 2026-01-24 13:58:12 -05:00
* add policies service add policies proxy middleware add policies event service add policies grpc service prepare ci and git environments (ci, make, readme, doc) * add webfinger to the drone conf * fix docs remove not used virus scan postprocessing step * relocate example rego file implicitly enable and disable proxy and postprocessing policy checking by setting the query. update configuration descriptions * move policies update readme * use converter func to convert pp environment to actual environment expose and test custom rego functions add engine unit tests add opa unit tests update policies readme Co-authored-by: Martin <github@diemattels.at> * relocate sample policies to the deployments folder change and document policies service port * update index.md and small fix * add health command add version command add debug server --------- Co-authored-by: Martin <github@diemattels.at>
26 lines
711 B
Go
26 lines
711 B
Go
package engine_test
|
|
|
|
import (
|
|
. "github.com/onsi/ginkgo/v2"
|
|
. "github.com/onsi/gomega"
|
|
pMessage "github.com/owncloud/ocis/v2/protogen/gen/ocis/messages/policies/v0"
|
|
"github.com/owncloud/ocis/v2/services/policies/pkg/engine"
|
|
)
|
|
|
|
var _ = Describe("Engine", func() {
|
|
DescribeTable("NewEnvironmentFromPB",
|
|
func(incomingStage pMessage.Stage, outgoinStage engine.Stage) {
|
|
pEnv := &pMessage.Environment{
|
|
Stage: incomingStage,
|
|
}
|
|
|
|
env, err := engine.NewEnvironmentFromPB(pEnv)
|
|
Expect(err).ToNot(HaveOccurred())
|
|
|
|
Expect(env.Stage).To(Equal(outgoinStage))
|
|
},
|
|
Entry("http stage", pMessage.Stage_STAGE_HTTP, engine.StageHTTP),
|
|
Entry("pp stage", pMessage.Stage_STAGE_PP, engine.StagePP),
|
|
)
|
|
})
|