mirror of
https://github.com/open-policy-agent/opa.git
synced 2026-08-12 19:32:48 -06:00
Preparing for v1 API
Moving (most) source to v1 root package to prepare for v0/v1 API separation. Signed-off-by: Johan Fylling <johan.dev@fylling.se>
This commit is contained in:
@@ -233,7 +233,7 @@ wasm-lib-clean:
|
|||||||
|
|
||||||
.PHONY: wasm-rego-testgen-install
|
.PHONY: wasm-rego-testgen-install
|
||||||
wasm-rego-testgen-install:
|
wasm-rego-testgen-install:
|
||||||
$(GO) install ./test/wasm/cmd/wasm-rego-testgen
|
$(GO) install ./v1/test/wasm/cmd/wasm-rego-testgen
|
||||||
|
|
||||||
######################################################
|
######################################################
|
||||||
#
|
#
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ set -ex
|
|||||||
GOVERSION=${GOVERSION:?"You must set the GOVERSION environment variable."}
|
GOVERSION=${GOVERSION:?"You must set the GOVERSION environment variable."}
|
||||||
DOCKER_UID=${DOCKER_UID:-$(id -u)}
|
DOCKER_UID=${DOCKER_UID:-$(id -u)}
|
||||||
DOCKER_GID=${DOCKER_GID:-$(id -g)}
|
DOCKER_GID=${DOCKER_GID:-$(id -g)}
|
||||||
ASSETS=${ASSETS:-"$PWD/test/wasm/assets"}
|
ASSETS=${ASSETS:-"$PWD/v1/test/wasm/assets"}
|
||||||
VERBOSE=${VERBOSE:-"0"}
|
VERBOSE=${VERBOSE:-"0"}
|
||||||
TESTGEN_CONTAINER_NAME="opa-wasm-testgen-container"
|
TESTGEN_CONTAINER_NAME="opa-wasm-testgen-container"
|
||||||
TESTRUN_CONTAINER_NAME="opa-wasm-testrun-container"
|
TESTRUN_CONTAINER_NAME="opa-wasm-testrun-container"
|
||||||
@@ -61,7 +61,7 @@ function generate_testcases {
|
|||||||
sh -c 'git config --global --add safe.directory /src && make wasm-rego-testgen-install \
|
sh -c 'git config --global --add safe.directory /src && make wasm-rego-testgen-install \
|
||||||
&& wasm-rego-testgen \
|
&& wasm-rego-testgen \
|
||||||
--input-dir=/assets \
|
--input-dir=/assets \
|
||||||
--runner=/src/test/wasm/assets/test.js \
|
--runner=/src/v1/test/wasm/assets/test.js \
|
||||||
--output=/src/.go/cache/testcases.tar.gz'
|
--output=/src/.go/cache/testcases.tar.gz'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+8
-8
@@ -19,22 +19,22 @@ import (
|
|||||||
"testing"
|
"testing"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/open-policy-agent/opa/ast"
|
"github.com/open-policy-agent/opa/v1/ast"
|
||||||
|
|
||||||
"github.com/open-policy-agent/opa/server/types"
|
"github.com/open-policy-agent/opa/v1/server/types"
|
||||||
|
|
||||||
"github.com/open-policy-agent/opa/logging"
|
"github.com/open-policy-agent/opa/v1/logging"
|
||||||
"github.com/open-policy-agent/opa/runtime"
|
"github.com/open-policy-agent/opa/v1/runtime"
|
||||||
|
|
||||||
"github.com/olekukonko/tablewriter"
|
"github.com/olekukonko/tablewriter"
|
||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
|
|
||||||
"github.com/open-policy-agent/opa/cmd/internal/env"
|
"github.com/open-policy-agent/opa/cmd/internal/env"
|
||||||
"github.com/open-policy-agent/opa/compile"
|
|
||||||
"github.com/open-policy-agent/opa/internal/presentation"
|
"github.com/open-policy-agent/opa/internal/presentation"
|
||||||
"github.com/open-policy-agent/opa/metrics"
|
"github.com/open-policy-agent/opa/v1/compile"
|
||||||
"github.com/open-policy-agent/opa/rego"
|
"github.com/open-policy-agent/opa/v1/metrics"
|
||||||
"github.com/open-policy-agent/opa/util"
|
"github.com/open-policy-agent/opa/v1/rego"
|
||||||
|
"github.com/open-policy-agent/opa/v1/util"
|
||||||
)
|
)
|
||||||
|
|
||||||
// benchmarkCommandParams are a superset of evalCommandParams
|
// benchmarkCommandParams are a superset of evalCommandParams
|
||||||
|
|||||||
+5
-5
@@ -15,12 +15,12 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/open-policy-agent/opa/ast"
|
|
||||||
"github.com/open-policy-agent/opa/bundle"
|
|
||||||
"github.com/open-policy-agent/opa/internal/presentation"
|
"github.com/open-policy-agent/opa/internal/presentation"
|
||||||
"github.com/open-policy-agent/opa/rego"
|
"github.com/open-policy-agent/opa/v1/ast"
|
||||||
"github.com/open-policy-agent/opa/util"
|
"github.com/open-policy-agent/opa/v1/bundle"
|
||||||
"github.com/open-policy-agent/opa/util/test"
|
"github.com/open-policy-agent/opa/v1/rego"
|
||||||
|
"github.com/open-policy-agent/opa/v1/util"
|
||||||
|
"github.com/open-policy-agent/opa/v1/util/test"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Minimize the number of tests that *actually* run the benchmarks, they are pretty slow.
|
// Minimize the number of tests that *actually* run the benchmarks, they are pretty slow.
|
||||||
|
|||||||
+5
-5
@@ -14,12 +14,12 @@ import (
|
|||||||
|
|
||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
|
|
||||||
"github.com/open-policy-agent/opa/ast"
|
|
||||||
"github.com/open-policy-agent/opa/bundle"
|
|
||||||
"github.com/open-policy-agent/opa/cmd/internal/env"
|
"github.com/open-policy-agent/opa/cmd/internal/env"
|
||||||
"github.com/open-policy-agent/opa/compile"
|
"github.com/open-policy-agent/opa/v1/ast"
|
||||||
"github.com/open-policy-agent/opa/keys"
|
"github.com/open-policy-agent/opa/v1/bundle"
|
||||||
"github.com/open-policy-agent/opa/util"
|
"github.com/open-policy-agent/opa/v1/compile"
|
||||||
|
"github.com/open-policy-agent/opa/v1/keys"
|
||||||
|
"github.com/open-policy-agent/opa/v1/util"
|
||||||
)
|
)
|
||||||
|
|
||||||
const defaultPublicKeyID = "default"
|
const defaultPublicKeyID = "default"
|
||||||
|
|||||||
+4
-4
@@ -13,11 +13,11 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/open-policy-agent/opa/ast"
|
|
||||||
"github.com/open-policy-agent/opa/internal/file/archive"
|
"github.com/open-policy-agent/opa/internal/file/archive"
|
||||||
"github.com/open-policy-agent/opa/loader"
|
"github.com/open-policy-agent/opa/v1/ast"
|
||||||
"github.com/open-policy-agent/opa/util"
|
"github.com/open-policy-agent/opa/v1/loader"
|
||||||
"github.com/open-policy-agent/opa/util/test"
|
"github.com/open-policy-agent/opa/v1/util"
|
||||||
|
"github.com/open-policy-agent/opa/v1/util/test"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestBuildProducesBundle(t *testing.T) {
|
func TestBuildProducesBundle(t *testing.T) {
|
||||||
|
|||||||
+1
-1
@@ -9,8 +9,8 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/open-policy-agent/opa/ast"
|
|
||||||
"github.com/open-policy-agent/opa/cmd/internal/env"
|
"github.com/open-policy-agent/opa/cmd/internal/env"
|
||||||
|
"github.com/open-policy-agent/opa/v1/ast"
|
||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ import (
|
|||||||
"path"
|
"path"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/open-policy-agent/opa/util/test"
|
"github.com/open-policy-agent/opa/v1/util/test"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestCapabilitiesNoArgs(t *testing.T) {
|
func TestCapabilitiesNoArgs(t *testing.T) {
|
||||||
|
|||||||
+3
-3
@@ -12,11 +12,11 @@ import (
|
|||||||
|
|
||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
|
|
||||||
"github.com/open-policy-agent/opa/ast"
|
|
||||||
"github.com/open-policy-agent/opa/cmd/internal/env"
|
"github.com/open-policy-agent/opa/cmd/internal/env"
|
||||||
pr "github.com/open-policy-agent/opa/internal/presentation"
|
pr "github.com/open-policy-agent/opa/internal/presentation"
|
||||||
"github.com/open-policy-agent/opa/loader"
|
"github.com/open-policy-agent/opa/v1/ast"
|
||||||
"github.com/open-policy-agent/opa/util"
|
"github.com/open-policy-agent/opa/v1/loader"
|
||||||
|
"github.com/open-policy-agent/opa/v1/util"
|
||||||
)
|
)
|
||||||
|
|
||||||
type checkParams struct {
|
type checkParams struct {
|
||||||
|
|||||||
+2
-2
@@ -13,9 +13,9 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/open-policy-agent/opa/ast"
|
|
||||||
"github.com/open-policy-agent/opa/internal/file/archive"
|
"github.com/open-policy-agent/opa/internal/file/archive"
|
||||||
"github.com/open-policy-agent/opa/util/test"
|
"github.com/open-policy-agent/opa/v1/ast"
|
||||||
|
"github.com/open-policy-agent/opa/v1/util/test"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestCheckRespectsCapabilities(t *testing.T) {
|
func TestCheckRespectsCapabilities(t *testing.T) {
|
||||||
|
|||||||
+4
-4
@@ -10,15 +10,15 @@ import (
|
|||||||
"io"
|
"io"
|
||||||
"os"
|
"os"
|
||||||
|
|
||||||
"github.com/open-policy-agent/opa/dependencies"
|
|
||||||
"github.com/open-policy-agent/opa/internal/presentation"
|
"github.com/open-policy-agent/opa/internal/presentation"
|
||||||
|
"github.com/open-policy-agent/opa/v1/dependencies"
|
||||||
|
|
||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
|
|
||||||
"github.com/open-policy-agent/opa/ast"
|
|
||||||
"github.com/open-policy-agent/opa/cmd/internal/env"
|
"github.com/open-policy-agent/opa/cmd/internal/env"
|
||||||
"github.com/open-policy-agent/opa/loader"
|
"github.com/open-policy-agent/opa/v1/ast"
|
||||||
"github.com/open-policy-agent/opa/util"
|
"github.com/open-policy-agent/opa/v1/loader"
|
||||||
|
"github.com/open-policy-agent/opa/v1/util"
|
||||||
)
|
)
|
||||||
|
|
||||||
type depsCommandParams struct {
|
type depsCommandParams struct {
|
||||||
|
|||||||
+1
-1
@@ -13,7 +13,7 @@ import (
|
|||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/open-policy-agent/opa/internal/file/archive"
|
"github.com/open-policy-agent/opa/internal/file/archive"
|
||||||
"github.com/open-policy-agent/opa/util/test"
|
"github.com/open-policy-agent/opa/v1/util/test"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestDepsCompatibleFlags(t *testing.T) {
|
func TestDepsCompatibleFlags(t *testing.T) {
|
||||||
|
|||||||
+12
-12
@@ -17,22 +17,22 @@ import (
|
|||||||
|
|
||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
|
|
||||||
"github.com/open-policy-agent/opa/ast"
|
|
||||||
"github.com/open-policy-agent/opa/ast/location"
|
|
||||||
"github.com/open-policy-agent/opa/bundle"
|
|
||||||
"github.com/open-policy-agent/opa/cmd/internal/env"
|
"github.com/open-policy-agent/opa/cmd/internal/env"
|
||||||
"github.com/open-policy-agent/opa/compile"
|
|
||||||
"github.com/open-policy-agent/opa/cover"
|
|
||||||
fileurl "github.com/open-policy-agent/opa/internal/file/url"
|
fileurl "github.com/open-policy-agent/opa/internal/file/url"
|
||||||
pr "github.com/open-policy-agent/opa/internal/presentation"
|
pr "github.com/open-policy-agent/opa/internal/presentation"
|
||||||
"github.com/open-policy-agent/opa/internal/runtime"
|
"github.com/open-policy-agent/opa/internal/runtime"
|
||||||
"github.com/open-policy-agent/opa/loader"
|
"github.com/open-policy-agent/opa/v1/ast"
|
||||||
"github.com/open-policy-agent/opa/metrics"
|
"github.com/open-policy-agent/opa/v1/ast/location"
|
||||||
"github.com/open-policy-agent/opa/profiler"
|
"github.com/open-policy-agent/opa/v1/bundle"
|
||||||
"github.com/open-policy-agent/opa/rego"
|
"github.com/open-policy-agent/opa/v1/compile"
|
||||||
"github.com/open-policy-agent/opa/topdown"
|
"github.com/open-policy-agent/opa/v1/cover"
|
||||||
"github.com/open-policy-agent/opa/topdown/lineage"
|
"github.com/open-policy-agent/opa/v1/loader"
|
||||||
"github.com/open-policy-agent/opa/util"
|
"github.com/open-policy-agent/opa/v1/metrics"
|
||||||
|
"github.com/open-policy-agent/opa/v1/profiler"
|
||||||
|
"github.com/open-policy-agent/opa/v1/rego"
|
||||||
|
"github.com/open-policy-agent/opa/v1/topdown"
|
||||||
|
"github.com/open-policy-agent/opa/v1/topdown/lineage"
|
||||||
|
"github.com/open-policy-agent/opa/v1/util"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
|
|||||||
+7
-7
@@ -19,14 +19,14 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/open-policy-agent/opa/ast"
|
|
||||||
"github.com/open-policy-agent/opa/internal/file/archive"
|
"github.com/open-policy-agent/opa/internal/file/archive"
|
||||||
"github.com/open-policy-agent/opa/internal/presentation"
|
"github.com/open-policy-agent/opa/internal/presentation"
|
||||||
"github.com/open-policy-agent/opa/loader"
|
"github.com/open-policy-agent/opa/v1/ast"
|
||||||
"github.com/open-policy-agent/opa/rego"
|
"github.com/open-policy-agent/opa/v1/loader"
|
||||||
"github.com/open-policy-agent/opa/topdown"
|
"github.com/open-policy-agent/opa/v1/rego"
|
||||||
"github.com/open-policy-agent/opa/util"
|
"github.com/open-policy-agent/opa/v1/topdown"
|
||||||
"github.com/open-policy-agent/opa/util/test"
|
"github.com/open-policy-agent/opa/v1/util"
|
||||||
|
"github.com/open-policy-agent/opa/v1/util/test"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestEvalWithIllegalUnknownArgs(t *testing.T) {
|
func TestEvalWithIllegalUnknownArgs(t *testing.T) {
|
||||||
@@ -1833,7 +1833,7 @@ func TestResetExprLocations(t *testing.T) {
|
|||||||
}
|
}
|
||||||
func kubeSchemaServer(t *testing.T) *httptest.Server {
|
func kubeSchemaServer(t *testing.T) *httptest.Server {
|
||||||
t.Helper()
|
t.Helper()
|
||||||
bs, err := os.ReadFile("../ast/testdata/_definitions.json")
|
bs, err := os.ReadFile("../v1/ast/testdata/_definitions.json")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatal(err)
|
t.Fatal(err)
|
||||||
}
|
}
|
||||||
|
|||||||
+8
-8
@@ -15,14 +15,14 @@ import (
|
|||||||
"github.com/open-policy-agent/opa/cmd/internal/exec"
|
"github.com/open-policy-agent/opa/cmd/internal/exec"
|
||||||
"github.com/open-policy-agent/opa/internal/config"
|
"github.com/open-policy-agent/opa/internal/config"
|
||||||
internal_logging "github.com/open-policy-agent/opa/internal/logging"
|
internal_logging "github.com/open-policy-agent/opa/internal/logging"
|
||||||
"github.com/open-policy-agent/opa/logging"
|
"github.com/open-policy-agent/opa/v1/logging"
|
||||||
"github.com/open-policy-agent/opa/plugins"
|
"github.com/open-policy-agent/opa/v1/plugins"
|
||||||
"github.com/open-policy-agent/opa/plugins/bundle"
|
"github.com/open-policy-agent/opa/v1/plugins/bundle"
|
||||||
"github.com/open-policy-agent/opa/plugins/discovery"
|
"github.com/open-policy-agent/opa/v1/plugins/discovery"
|
||||||
"github.com/open-policy-agent/opa/plugins/logs"
|
"github.com/open-policy-agent/opa/v1/plugins/logs"
|
||||||
"github.com/open-policy-agent/opa/plugins/status"
|
"github.com/open-policy-agent/opa/v1/plugins/status"
|
||||||
"github.com/open-policy-agent/opa/sdk"
|
"github.com/open-policy-agent/opa/v1/sdk"
|
||||||
"github.com/open-policy-agent/opa/util"
|
"github.com/open-policy-agent/opa/v1/util"
|
||||||
)
|
)
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
|
|||||||
+5
-5
@@ -12,13 +12,13 @@ import (
|
|||||||
"testing"
|
"testing"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/open-policy-agent/opa/ast"
|
|
||||||
"github.com/open-policy-agent/opa/cmd/internal/exec"
|
"github.com/open-policy-agent/opa/cmd/internal/exec"
|
||||||
"github.com/open-policy-agent/opa/internal/file/archive"
|
"github.com/open-policy-agent/opa/internal/file/archive"
|
||||||
loggingtest "github.com/open-policy-agent/opa/logging/test"
|
"github.com/open-policy-agent/opa/v1/ast"
|
||||||
sdk_test "github.com/open-policy-agent/opa/sdk/test"
|
loggingtest "github.com/open-policy-agent/opa/v1/logging/test"
|
||||||
"github.com/open-policy-agent/opa/util"
|
sdk_test "github.com/open-policy-agent/opa/v1/sdk/test"
|
||||||
"github.com/open-policy-agent/opa/util/test"
|
"github.com/open-policy-agent/opa/v1/util"
|
||||||
|
"github.com/open-policy-agent/opa/v1/util/test"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestExecBasic(t *testing.T) {
|
func TestExecBasic(t *testing.T) {
|
||||||
|
|||||||
+1
-1
@@ -7,4 +7,4 @@
|
|||||||
|
|
||||||
package cmd
|
package cmd
|
||||||
|
|
||||||
import _ "github.com/open-policy-agent/opa/features/wasm"
|
import _ "github.com/open-policy-agent/opa/v1/features/wasm"
|
||||||
|
|||||||
+2
-2
@@ -8,8 +8,8 @@ import (
|
|||||||
"os"
|
"os"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
|
|
||||||
"github.com/open-policy-agent/opa/bundle"
|
"github.com/open-policy-agent/opa/v1/bundle"
|
||||||
"github.com/open-policy-agent/opa/loader"
|
"github.com/open-policy-agent/opa/v1/loader"
|
||||||
)
|
)
|
||||||
|
|
||||||
type loaderFilter struct {
|
type loaderFilter struct {
|
||||||
|
|||||||
+2
-2
@@ -9,8 +9,8 @@ import (
|
|||||||
|
|
||||||
"github.com/spf13/pflag"
|
"github.com/spf13/pflag"
|
||||||
|
|
||||||
"github.com/open-policy-agent/opa/ast"
|
"github.com/open-policy-agent/opa/v1/ast"
|
||||||
"github.com/open-policy-agent/opa/util"
|
"github.com/open-policy-agent/opa/v1/util"
|
||||||
)
|
)
|
||||||
|
|
||||||
func addConfigFileFlag(fs *pflag.FlagSet, file *string) {
|
func addConfigFileFlag(fs *pflag.FlagSet, file *string) {
|
||||||
|
|||||||
+2
-2
@@ -14,10 +14,10 @@ import (
|
|||||||
"github.com/sergi/go-diff/diffmatchpatch"
|
"github.com/sergi/go-diff/diffmatchpatch"
|
||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
|
|
||||||
"github.com/open-policy-agent/opa/ast"
|
|
||||||
"github.com/open-policy-agent/opa/cmd/internal/env"
|
"github.com/open-policy-agent/opa/cmd/internal/env"
|
||||||
"github.com/open-policy-agent/opa/format"
|
|
||||||
fileurl "github.com/open-policy-agent/opa/internal/file/url"
|
fileurl "github.com/open-policy-agent/opa/internal/file/url"
|
||||||
|
"github.com/open-policy-agent/opa/v1/ast"
|
||||||
|
"github.com/open-policy-agent/opa/v1/format"
|
||||||
)
|
)
|
||||||
|
|
||||||
type fmtCommandParams struct {
|
type fmtCommandParams struct {
|
||||||
|
|||||||
+3
-3
@@ -10,9 +10,9 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/open-policy-agent/opa/ast"
|
"github.com/open-policy-agent/opa/v1/ast"
|
||||||
"github.com/open-policy-agent/opa/format"
|
"github.com/open-policy-agent/opa/v1/format"
|
||||||
"github.com/open-policy-agent/opa/util/test"
|
"github.com/open-policy-agent/opa/v1/util/test"
|
||||||
)
|
)
|
||||||
|
|
||||||
const formattedV0 = `package test
|
const formattedV0 = `package test
|
||||||
|
|||||||
+3
-3
@@ -13,13 +13,13 @@ import (
|
|||||||
"strconv"
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/open-policy-agent/opa/ast"
|
|
||||||
"github.com/open-policy-agent/opa/bundle"
|
|
||||||
"github.com/open-policy-agent/opa/cmd/internal/env"
|
"github.com/open-policy-agent/opa/cmd/internal/env"
|
||||||
ib "github.com/open-policy-agent/opa/internal/bundle/inspect"
|
ib "github.com/open-policy-agent/opa/internal/bundle/inspect"
|
||||||
pr "github.com/open-policy-agent/opa/internal/presentation"
|
pr "github.com/open-policy-agent/opa/internal/presentation"
|
||||||
iStrs "github.com/open-policy-agent/opa/internal/strings"
|
iStrs "github.com/open-policy-agent/opa/internal/strings"
|
||||||
"github.com/open-policy-agent/opa/util"
|
"github.com/open-policy-agent/opa/v1/ast"
|
||||||
|
"github.com/open-policy-agent/opa/v1/bundle"
|
||||||
|
"github.com/open-policy-agent/opa/v1/util"
|
||||||
|
|
||||||
"github.com/olekukonko/tablewriter"
|
"github.com/olekukonko/tablewriter"
|
||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
|
|||||||
+2
-2
@@ -14,9 +14,9 @@ import (
|
|||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/open-policy-agent/opa/internal/file/archive"
|
"github.com/open-policy-agent/opa/internal/file/archive"
|
||||||
"github.com/open-policy-agent/opa/util"
|
"github.com/open-policy-agent/opa/v1/util"
|
||||||
|
|
||||||
"github.com/open-policy-agent/opa/util/test"
|
"github.com/open-policy-agent/opa/v1/util/test"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestDoInspect(t *testing.T) {
|
func TestDoInspect(t *testing.T) {
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ import (
|
|||||||
"path/filepath"
|
"path/filepath"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/open-policy-agent/opa/sdk"
|
"github.com/open-policy-agent/opa/v1/sdk"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
|
|||||||
@@ -8,10 +8,10 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/open-policy-agent/opa/logging"
|
"github.com/open-policy-agent/opa/v1/logging"
|
||||||
"github.com/open-policy-agent/opa/sdk"
|
"github.com/open-policy-agent/opa/v1/sdk"
|
||||||
|
|
||||||
"github.com/open-policy-agent/opa/util/test"
|
"github.com/open-policy-agent/opa/v1/util/test"
|
||||||
)
|
)
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ import (
|
|||||||
"io"
|
"io"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/open-policy-agent/opa/sdk"
|
"github.com/open-policy-agent/opa/v1/sdk"
|
||||||
)
|
)
|
||||||
|
|
||||||
type result struct {
|
type result struct {
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/open-policy-agent/opa/sdk"
|
"github.com/open-policy-agent/opa/v1/sdk"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestJsonReporter_Close(t *testing.T) {
|
func TestJsonReporter_Close(t *testing.T) {
|
||||||
|
|||||||
@@ -5,8 +5,8 @@ import (
|
|||||||
"io"
|
"io"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/open-policy-agent/opa/logging"
|
"github.com/open-policy-agent/opa/v1/logging"
|
||||||
"github.com/open-policy-agent/opa/util"
|
"github.com/open-policy-agent/opa/v1/util"
|
||||||
)
|
)
|
||||||
|
|
||||||
type Params struct {
|
type Params struct {
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ package exec
|
|||||||
import (
|
import (
|
||||||
"io"
|
"io"
|
||||||
|
|
||||||
"github.com/open-policy-agent/opa/util"
|
"github.com/open-policy-agent/opa/v1/util"
|
||||||
)
|
)
|
||||||
|
|
||||||
type parser interface {
|
type parser interface {
|
||||||
|
|||||||
+3
-3
@@ -14,12 +14,12 @@ import (
|
|||||||
|
|
||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
|
|
||||||
"github.com/open-policy-agent/opa/ast"
|
|
||||||
"github.com/open-policy-agent/opa/bundle"
|
|
||||||
"github.com/open-policy-agent/opa/cmd/internal/env"
|
"github.com/open-policy-agent/opa/cmd/internal/env"
|
||||||
"github.com/open-policy-agent/opa/internal/oracle"
|
"github.com/open-policy-agent/opa/internal/oracle"
|
||||||
"github.com/open-policy-agent/opa/internal/presentation"
|
"github.com/open-policy-agent/opa/internal/presentation"
|
||||||
"github.com/open-policy-agent/opa/loader"
|
"github.com/open-policy-agent/opa/v1/ast"
|
||||||
|
"github.com/open-policy-agent/opa/v1/bundle"
|
||||||
|
"github.com/open-policy-agent/opa/v1/loader"
|
||||||
)
|
)
|
||||||
|
|
||||||
type findDefinitionParams struct {
|
type findDefinitionParams struct {
|
||||||
|
|||||||
+2
-2
@@ -9,8 +9,8 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/open-policy-agent/opa/util"
|
"github.com/open-policy-agent/opa/v1/util"
|
||||||
"github.com/open-policy-agent/opa/util/test"
|
"github.com/open-policy-agent/opa/v1/util/test"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestOracleFindDefinition(t *testing.T) {
|
func TestOracleFindDefinition(t *testing.T) {
|
||||||
|
|||||||
+4
-4
@@ -13,12 +13,12 @@ import (
|
|||||||
|
|
||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
|
|
||||||
"github.com/open-policy-agent/opa/ast"
|
|
||||||
astJSON "github.com/open-policy-agent/opa/ast/json"
|
|
||||||
"github.com/open-policy-agent/opa/cmd/internal/env"
|
"github.com/open-policy-agent/opa/cmd/internal/env"
|
||||||
pr "github.com/open-policy-agent/opa/internal/presentation"
|
pr "github.com/open-policy-agent/opa/internal/presentation"
|
||||||
"github.com/open-policy-agent/opa/loader"
|
"github.com/open-policy-agent/opa/v1/ast"
|
||||||
"github.com/open-policy-agent/opa/util"
|
astJSON "github.com/open-policy-agent/opa/v1/ast/json"
|
||||||
|
"github.com/open-policy-agent/opa/v1/loader"
|
||||||
|
"github.com/open-policy-agent/opa/v1/util"
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
|
|||||||
+2
-2
@@ -6,8 +6,8 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/open-policy-agent/opa/util"
|
"github.com/open-policy-agent/opa/v1/util"
|
||||||
"github.com/open-policy-agent/opa/util/test"
|
"github.com/open-policy-agent/opa/v1/util/test"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestParseExit0(t *testing.T) {
|
func TestParseExit0(t *testing.T) {
|
||||||
|
|||||||
+4
-4
@@ -13,12 +13,12 @@ import (
|
|||||||
|
|
||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
|
|
||||||
"github.com/open-policy-agent/opa/ast"
|
|
||||||
"github.com/open-policy-agent/opa/cmd/internal/env"
|
"github.com/open-policy-agent/opa/cmd/internal/env"
|
||||||
"github.com/open-policy-agent/opa/format"
|
|
||||||
fileurl "github.com/open-policy-agent/opa/internal/file/url"
|
fileurl "github.com/open-policy-agent/opa/internal/file/url"
|
||||||
"github.com/open-policy-agent/opa/loader"
|
"github.com/open-policy-agent/opa/v1/ast"
|
||||||
"github.com/open-policy-agent/opa/refactor"
|
"github.com/open-policy-agent/opa/v1/format"
|
||||||
|
"github.com/open-policy-agent/opa/v1/loader"
|
||||||
|
"github.com/open-policy-agent/opa/v1/refactor"
|
||||||
)
|
)
|
||||||
|
|
||||||
type moveCommandParams struct {
|
type moveCommandParams struct {
|
||||||
|
|||||||
@@ -7,9 +7,9 @@ import (
|
|||||||
"reflect"
|
"reflect"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/open-policy-agent/opa/ast"
|
"github.com/open-policy-agent/opa/v1/ast"
|
||||||
"github.com/open-policy-agent/opa/format"
|
"github.com/open-policy-agent/opa/v1/format"
|
||||||
"github.com/open-policy-agent/opa/util/test"
|
"github.com/open-policy-agent/opa/v1/util/test"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestDoMoveRenamePackage(t *testing.T) {
|
func TestDoMoveRenamePackage(t *testing.T) {
|
||||||
|
|||||||
+3
-3
@@ -17,9 +17,9 @@ import (
|
|||||||
|
|
||||||
"github.com/open-policy-agent/opa/cmd/internal/env"
|
"github.com/open-policy-agent/opa/cmd/internal/env"
|
||||||
fileurl "github.com/open-policy-agent/opa/internal/file/url"
|
fileurl "github.com/open-policy-agent/opa/internal/file/url"
|
||||||
"github.com/open-policy-agent/opa/runtime"
|
"github.com/open-policy-agent/opa/v1/runtime"
|
||||||
"github.com/open-policy-agent/opa/server"
|
"github.com/open-policy-agent/opa/v1/server"
|
||||||
"github.com/open-policy-agent/opa/util"
|
"github.com/open-policy-agent/opa/v1/util"
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
|
|||||||
+3
-3
@@ -16,9 +16,9 @@ import (
|
|||||||
"testing"
|
"testing"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/open-policy-agent/opa/logging"
|
"github.com/open-policy-agent/opa/v1/logging"
|
||||||
"github.com/open-policy-agent/opa/test/e2e"
|
"github.com/open-policy-agent/opa/v1/test/e2e"
|
||||||
"github.com/open-policy-agent/opa/util/test"
|
"github.com/open-policy-agent/opa/v1/util/test"
|
||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
+2
-2
@@ -16,10 +16,10 @@ import (
|
|||||||
|
|
||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
|
|
||||||
"github.com/open-policy-agent/opa/bundle"
|
|
||||||
"github.com/open-policy-agent/opa/cmd/internal/env"
|
"github.com/open-policy-agent/opa/cmd/internal/env"
|
||||||
initload "github.com/open-policy-agent/opa/internal/runtime/init"
|
initload "github.com/open-policy-agent/opa/internal/runtime/init"
|
||||||
"github.com/open-policy-agent/opa/util"
|
"github.com/open-policy-agent/opa/v1/bundle"
|
||||||
|
"github.com/open-policy-agent/opa/v1/util"
|
||||||
)
|
)
|
||||||
|
|
||||||
type signCmdParams struct {
|
type signCmdParams struct {
|
||||||
|
|||||||
+3
-3
@@ -11,10 +11,10 @@ import (
|
|||||||
"path/filepath"
|
"path/filepath"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/open-policy-agent/opa/bundle"
|
|
||||||
"github.com/open-policy-agent/opa/internal/file/archive"
|
"github.com/open-policy-agent/opa/internal/file/archive"
|
||||||
"github.com/open-policy-agent/opa/keys"
|
"github.com/open-policy-agent/opa/v1/bundle"
|
||||||
"github.com/open-policy-agent/opa/util/test"
|
"github.com/open-policy-agent/opa/v1/keys"
|
||||||
|
"github.com/open-policy-agent/opa/v1/util/test"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestWriteTokenToFile(t *testing.T) {
|
func TestWriteTokenToFile(t *testing.T) {
|
||||||
|
|||||||
+11
-11
@@ -18,21 +18,21 @@ import (
|
|||||||
"github.com/fsnotify/fsnotify"
|
"github.com/fsnotify/fsnotify"
|
||||||
"github.com/open-policy-agent/opa/internal/pathwatcher"
|
"github.com/open-policy-agent/opa/internal/pathwatcher"
|
||||||
initload "github.com/open-policy-agent/opa/internal/runtime/init"
|
initload "github.com/open-policy-agent/opa/internal/runtime/init"
|
||||||
"github.com/open-policy-agent/opa/loader"
|
"github.com/open-policy-agent/opa/v1/loader"
|
||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
|
|
||||||
"github.com/open-policy-agent/opa/ast"
|
|
||||||
"github.com/open-policy-agent/opa/bundle"
|
|
||||||
"github.com/open-policy-agent/opa/cmd/internal/env"
|
"github.com/open-policy-agent/opa/cmd/internal/env"
|
||||||
"github.com/open-policy-agent/opa/compile"
|
|
||||||
"github.com/open-policy-agent/opa/cover"
|
|
||||||
"github.com/open-policy-agent/opa/internal/runtime"
|
"github.com/open-policy-agent/opa/internal/runtime"
|
||||||
"github.com/open-policy-agent/opa/storage"
|
"github.com/open-policy-agent/opa/v1/ast"
|
||||||
"github.com/open-policy-agent/opa/storage/inmem"
|
"github.com/open-policy-agent/opa/v1/bundle"
|
||||||
"github.com/open-policy-agent/opa/tester"
|
"github.com/open-policy-agent/opa/v1/compile"
|
||||||
"github.com/open-policy-agent/opa/topdown"
|
"github.com/open-policy-agent/opa/v1/cover"
|
||||||
"github.com/open-policy-agent/opa/topdown/lineage"
|
"github.com/open-policy-agent/opa/v1/storage"
|
||||||
"github.com/open-policy-agent/opa/util"
|
"github.com/open-policy-agent/opa/v1/storage/inmem"
|
||||||
|
"github.com/open-policy-agent/opa/v1/tester"
|
||||||
|
"github.com/open-policy-agent/opa/v1/topdown"
|
||||||
|
"github.com/open-policy-agent/opa/v1/topdown/lineage"
|
||||||
|
"github.com/open-policy-agent/opa/v1/util"
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
|
|||||||
+5
-5
@@ -14,12 +14,12 @@ import (
|
|||||||
"testing"
|
"testing"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/open-policy-agent/opa/ast"
|
|
||||||
"github.com/open-policy-agent/opa/bundle"
|
|
||||||
"github.com/open-policy-agent/opa/internal/file/archive"
|
"github.com/open-policy-agent/opa/internal/file/archive"
|
||||||
"github.com/open-policy-agent/opa/rego"
|
"github.com/open-policy-agent/opa/v1/ast"
|
||||||
"github.com/open-policy-agent/opa/topdown"
|
"github.com/open-policy-agent/opa/v1/bundle"
|
||||||
"github.com/open-policy-agent/opa/util/test"
|
"github.com/open-policy-agent/opa/v1/rego"
|
||||||
|
"github.com/open-policy-agent/opa/v1/topdown"
|
||||||
|
"github.com/open-policy-agent/opa/v1/util/test"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestFilterTraceDefault(t *testing.T) {
|
func TestFilterTraceDefault(t *testing.T) {
|
||||||
|
|||||||
+8
-8
@@ -11,12 +11,12 @@ import (
|
|||||||
"io"
|
"io"
|
||||||
"os"
|
"os"
|
||||||
|
|
||||||
|
version2 "github.com/open-policy-agent/opa/version"
|
||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
|
|
||||||
"github.com/open-policy-agent/opa/cmd/internal/env"
|
"github.com/open-policy-agent/opa/cmd/internal/env"
|
||||||
"github.com/open-policy-agent/opa/internal/report"
|
"github.com/open-policy-agent/opa/internal/report"
|
||||||
"github.com/open-policy-agent/opa/internal/uuid"
|
"github.com/open-policy-agent/opa/internal/uuid"
|
||||||
"github.com/open-policy-agent/opa/version"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
@@ -41,16 +41,16 @@ func init() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func generateCmdOutput(out io.Writer, check bool) {
|
func generateCmdOutput(out io.Writer, check bool) {
|
||||||
fmt.Fprintln(out, "Version: "+version.Version)
|
fmt.Fprintln(out, "Version: "+version2.Version)
|
||||||
fmt.Fprintln(out, "Build Commit: "+version.Vcs)
|
fmt.Fprintln(out, "Build Commit: "+version2.Vcs)
|
||||||
fmt.Fprintln(out, "Build Timestamp: "+version.Timestamp)
|
fmt.Fprintln(out, "Build Timestamp: "+version2.Timestamp)
|
||||||
fmt.Fprintln(out, "Build Hostname: "+version.Hostname)
|
fmt.Fprintln(out, "Build Hostname: "+version2.Hostname)
|
||||||
fmt.Fprintln(out, "Go Version: "+version.GoVersion)
|
fmt.Fprintln(out, "Go Version: "+version2.GoVersion)
|
||||||
fmt.Fprintln(out, "Platform: "+version.Platform)
|
fmt.Fprintln(out, "Platform: "+version2.Platform)
|
||||||
|
|
||||||
var wasmAvailable string
|
var wasmAvailable string
|
||||||
|
|
||||||
if version.WasmRuntimeAvailable() {
|
if version2.WasmRuntimeAvailable() {
|
||||||
wasmAvailable = "available"
|
wasmAvailable = "available"
|
||||||
} else {
|
} else {
|
||||||
wasmAvailable = "unavailable"
|
wasmAvailable = "unavailable"
|
||||||
|
|||||||
@@ -1,23 +0,0 @@
|
|||||||
package peoplefinder.DELETE.api.users.__id
|
|
||||||
|
|
||||||
import rego.v1
|
|
||||||
import input.user.attributes.properties as user_props
|
|
||||||
|
|
||||||
default allowed = false
|
|
||||||
|
|
||||||
default visible = false
|
|
||||||
|
|
||||||
default enabled = false
|
|
||||||
|
|
||||||
allowed if {
|
|
||||||
user_props.department == "Operations"
|
|
||||||
user_props.title == "IT Manager"
|
|
||||||
}
|
|
||||||
|
|
||||||
visible if {
|
|
||||||
user_props.department == "Operations"
|
|
||||||
}
|
|
||||||
|
|
||||||
enabled if {
|
|
||||||
allowed
|
|
||||||
}
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
package peoplefinder.GET.api.users.__id
|
|
||||||
|
|
||||||
default allowed = true
|
|
||||||
|
|
||||||
default visible = true
|
|
||||||
|
|
||||||
default enabled = true
|
|
||||||
@@ -1,18 +0,0 @@
|
|||||||
package peoplefinder.POST.api.users.__id
|
|
||||||
|
|
||||||
import rego.v1
|
|
||||||
import input.user.attributes.properties as user_props
|
|
||||||
|
|
||||||
default allowed = false
|
|
||||||
|
|
||||||
default visible = true
|
|
||||||
|
|
||||||
default enabled = false
|
|
||||||
|
|
||||||
allowed if {
|
|
||||||
user_props.department == "Operations"
|
|
||||||
}
|
|
||||||
|
|
||||||
enabled if {
|
|
||||||
allowed
|
|
||||||
}
|
|
||||||
@@ -1,18 +0,0 @@
|
|||||||
package peoplefinder.PUT.api.users.__id
|
|
||||||
|
|
||||||
import rego.v1
|
|
||||||
import input.user.attributes.properties as user_props
|
|
||||||
|
|
||||||
default allowed = false
|
|
||||||
|
|
||||||
default visible = true
|
|
||||||
|
|
||||||
default enabled = true
|
|
||||||
|
|
||||||
allowed if {
|
|
||||||
user_props.department == "Operations"
|
|
||||||
}
|
|
||||||
|
|
||||||
allowed if {
|
|
||||||
input.user.id == input.resource.id
|
|
||||||
}
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
package peoplefinder.GET.api.users
|
|
||||||
|
|
||||||
default allowed = true
|
|
||||||
|
|
||||||
default visible = true
|
|
||||||
|
|
||||||
default enabled = true
|
|
||||||
@@ -1,23 +0,0 @@
|
|||||||
package peoplefinder.POST.api.users
|
|
||||||
|
|
||||||
import rego.v1
|
|
||||||
import input.user.attributes.properties as user_props
|
|
||||||
|
|
||||||
default allowed = false
|
|
||||||
|
|
||||||
default visible = false
|
|
||||||
|
|
||||||
default enabled = false
|
|
||||||
|
|
||||||
allowed if {
|
|
||||||
user_props.department == "Operations"
|
|
||||||
user_props.title == "IT Manager"
|
|
||||||
}
|
|
||||||
|
|
||||||
visible if {
|
|
||||||
allowed
|
|
||||||
}
|
|
||||||
|
|
||||||
enabled if {
|
|
||||||
allowed
|
|
||||||
}
|
|
||||||
@@ -12,12 +12,12 @@ import (
|
|||||||
"path/filepath"
|
"path/filepath"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/open-policy-agent/opa/ast"
|
|
||||||
"github.com/open-policy-agent/opa/ast/json"
|
|
||||||
"github.com/open-policy-agent/opa/bundle"
|
|
||||||
initload "github.com/open-policy-agent/opa/internal/runtime/init"
|
initload "github.com/open-policy-agent/opa/internal/runtime/init"
|
||||||
"github.com/open-policy-agent/opa/loader"
|
"github.com/open-policy-agent/opa/v1/ast"
|
||||||
"github.com/open-policy-agent/opa/util"
|
"github.com/open-policy-agent/opa/v1/ast/json"
|
||||||
|
"github.com/open-policy-agent/opa/v1/bundle"
|
||||||
|
"github.com/open-policy-agent/opa/v1/loader"
|
||||||
|
"github.com/open-policy-agent/opa/v1/util"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Info represents information about a bundle.
|
// Info represents information about a bundle.
|
||||||
|
|||||||
@@ -14,10 +14,10 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/open-policy-agent/opa/ast"
|
|
||||||
"github.com/open-policy-agent/opa/bundle"
|
|
||||||
"github.com/open-policy-agent/opa/internal/file/archive"
|
"github.com/open-policy-agent/opa/internal/file/archive"
|
||||||
"github.com/open-policy-agent/opa/util/test"
|
"github.com/open-policy-agent/opa/v1/ast"
|
||||||
|
"github.com/open-policy-agent/opa/v1/bundle"
|
||||||
|
"github.com/open-policy-agent/opa/v1/util/test"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestGenerateBundleInfoWithFileDir(t *testing.T) {
|
func TestGenerateBundleInfoWithFileDir(t *testing.T) {
|
||||||
|
|||||||
@@ -11,10 +11,10 @@ import (
|
|||||||
"os"
|
"os"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
|
|
||||||
"github.com/open-policy-agent/opa/ast"
|
"github.com/open-policy-agent/opa/v1/ast"
|
||||||
"github.com/open-policy-agent/opa/bundle"
|
"github.com/open-policy-agent/opa/v1/bundle"
|
||||||
"github.com/open-policy-agent/opa/resolver/wasm"
|
"github.com/open-policy-agent/opa/v1/resolver/wasm"
|
||||||
"github.com/open-policy-agent/opa/storage"
|
"github.com/open-policy-agent/opa/v1/storage"
|
||||||
)
|
)
|
||||||
|
|
||||||
// LoadWasmResolversFromStore will lookup all Wasm modules from the store along with the
|
// LoadWasmResolversFromStore will lookup all Wasm modules from the store along with the
|
||||||
|
|||||||
@@ -10,9 +10,9 @@ import (
|
|||||||
"os"
|
"os"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/open-policy-agent/opa/ast"
|
|
||||||
"github.com/open-policy-agent/opa/internal/compiler/wasm"
|
"github.com/open-policy-agent/opa/internal/compiler/wasm"
|
||||||
"github.com/open-policy-agent/opa/types"
|
"github.com/open-policy-agent/opa/v1/ast"
|
||||||
|
"github.com/open-policy-agent/opa/v1/types"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ import (
|
|||||||
"encoding/json"
|
"encoding/json"
|
||||||
"os"
|
"os"
|
||||||
|
|
||||||
"github.com/open-policy-agent/opa/ast"
|
"github.com/open-policy-agent/opa/v1/ast"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
|
|||||||
@@ -4,8 +4,8 @@ import (
|
|||||||
"encoding/json"
|
"encoding/json"
|
||||||
"os"
|
"os"
|
||||||
|
|
||||||
"github.com/open-policy-agent/opa/ast"
|
|
||||||
"github.com/open-policy-agent/opa/internal/semver"
|
"github.com/open-policy-agent/opa/internal/semver"
|
||||||
|
"github.com/open-policy-agent/opa/v1/ast"
|
||||||
)
|
)
|
||||||
|
|
||||||
func minVersionIndex() ast.VersionIndex {
|
func minVersionIndex() ast.VersionIndex {
|
||||||
|
|||||||
@@ -5,9 +5,9 @@
|
|||||||
package compiler
|
package compiler
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/open-policy-agent/opa/ast"
|
"github.com/open-policy-agent/opa/v1/ast"
|
||||||
"github.com/open-policy-agent/opa/schemas"
|
"github.com/open-policy-agent/opa/v1/schemas"
|
||||||
"github.com/open-policy-agent/opa/util"
|
"github.com/open-policy-agent/opa/v1/util"
|
||||||
)
|
)
|
||||||
|
|
||||||
type SchemaFile string
|
type SchemaFile string
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/open-policy-agent/opa/ast"
|
"github.com/open-policy-agent/opa/v1/ast"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestVerifyAuthorizationPolicySchema(t *testing.T) {
|
func TestVerifyAuthorizationPolicySchema(t *testing.T) {
|
||||||
|
|||||||
@@ -4,8 +4,8 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/open-policy-agent/opa/ast"
|
|
||||||
"github.com/open-policy-agent/opa/internal/planner"
|
"github.com/open-policy-agent/opa/internal/planner"
|
||||||
|
"github.com/open-policy-agent/opa/v1/ast"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestRemoveUnusedCode(t *testing.T) {
|
func TestRemoveUnusedCode(t *testing.T) {
|
||||||
|
|||||||
@@ -12,7 +12,6 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"io"
|
"io"
|
||||||
|
|
||||||
"github.com/open-policy-agent/opa/ast"
|
|
||||||
"github.com/open-policy-agent/opa/internal/compiler/wasm/opa"
|
"github.com/open-policy-agent/opa/internal/compiler/wasm/opa"
|
||||||
"github.com/open-policy-agent/opa/internal/debug"
|
"github.com/open-policy-agent/opa/internal/debug"
|
||||||
"github.com/open-policy-agent/opa/internal/wasm/encoding"
|
"github.com/open-policy-agent/opa/internal/wasm/encoding"
|
||||||
@@ -20,8 +19,9 @@ import (
|
|||||||
"github.com/open-policy-agent/opa/internal/wasm/module"
|
"github.com/open-policy-agent/opa/internal/wasm/module"
|
||||||
"github.com/open-policy-agent/opa/internal/wasm/types"
|
"github.com/open-policy-agent/opa/internal/wasm/types"
|
||||||
"github.com/open-policy-agent/opa/internal/wasm/util"
|
"github.com/open-policy-agent/opa/internal/wasm/util"
|
||||||
"github.com/open-policy-agent/opa/ir"
|
"github.com/open-policy-agent/opa/v1/ast"
|
||||||
opatypes "github.com/open-policy-agent/opa/types"
|
"github.com/open-policy-agent/opa/v1/ir"
|
||||||
|
opatypes "github.com/open-policy-agent/opa/v1/types"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Record Wasm ABI version in exported global variable
|
// Record Wasm ABI version in exported global variable
|
||||||
|
|||||||
@@ -7,10 +7,10 @@ package wasm
|
|||||||
import (
|
import (
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/open-policy-agent/opa/ast"
|
|
||||||
"github.com/open-policy-agent/opa/internal/planner"
|
"github.com/open-policy-agent/opa/internal/planner"
|
||||||
"github.com/open-policy-agent/opa/internal/wasm/instruction"
|
"github.com/open-policy-agent/opa/internal/wasm/instruction"
|
||||||
"github.com/open-policy-agent/opa/internal/wasm/module"
|
"github.com/open-policy-agent/opa/internal/wasm/module"
|
||||||
|
"github.com/open-policy-agent/opa/v1/ast"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestCompilerHelloWorld(t *testing.T) {
|
func TestCompilerHelloWorld(t *testing.T) {
|
||||||
|
|||||||
@@ -15,11 +15,11 @@ import (
|
|||||||
"sigs.k8s.io/yaml"
|
"sigs.k8s.io/yaml"
|
||||||
|
|
||||||
"github.com/open-policy-agent/opa/internal/strvals"
|
"github.com/open-policy-agent/opa/internal/strvals"
|
||||||
"github.com/open-policy-agent/opa/keys"
|
"github.com/open-policy-agent/opa/v1/keys"
|
||||||
"github.com/open-policy-agent/opa/logging"
|
"github.com/open-policy-agent/opa/v1/logging"
|
||||||
"github.com/open-policy-agent/opa/plugins/rest"
|
"github.com/open-policy-agent/opa/v1/plugins/rest"
|
||||||
"github.com/open-policy-agent/opa/tracing"
|
"github.com/open-policy-agent/opa/v1/tracing"
|
||||||
"github.com/open-policy-agent/opa/util"
|
"github.com/open-policy-agent/opa/v1/util"
|
||||||
)
|
)
|
||||||
|
|
||||||
// ServiceOptions stores the options passed to ParseServicesConfig
|
// ServiceOptions stores the options passed to ParseServicesConfig
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ import (
|
|||||||
|
|
||||||
"sigs.k8s.io/yaml"
|
"sigs.k8s.io/yaml"
|
||||||
|
|
||||||
"github.com/open-policy-agent/opa/util/test"
|
"github.com/open-policy-agent/opa/v1/util/test"
|
||||||
)
|
)
|
||||||
|
|
||||||
func setTestEnvVar(t *testing.T, name, value string) string {
|
func setTestEnvVar(t *testing.T, name, value string) string {
|
||||||
|
|||||||
@@ -22,14 +22,14 @@ import (
|
|||||||
semconv "go.opentelemetry.io/otel/semconv/v1.7.0"
|
semconv "go.opentelemetry.io/otel/semconv/v1.7.0"
|
||||||
"google.golang.org/grpc/credentials"
|
"google.golang.org/grpc/credentials"
|
||||||
|
|
||||||
"github.com/open-policy-agent/opa/config"
|
"github.com/open-policy-agent/opa/v1/config"
|
||||||
"github.com/open-policy-agent/opa/logging"
|
"github.com/open-policy-agent/opa/v1/logging"
|
||||||
"github.com/open-policy-agent/opa/util"
|
"github.com/open-policy-agent/opa/v1/util"
|
||||||
|
|
||||||
// The import registers opentelemetry with the top-level `tracing` package,
|
// The import registers opentelemetry with the top-level `tracing` package,
|
||||||
// so the latter can be used from rego/topdown without an explicit build-time
|
// so the latter can be used from rego/topdown without an explicit build-time
|
||||||
// dependency.
|
// dependency.
|
||||||
_ "github.com/open-policy-agent/opa/features/tracing"
|
_ "github.com/open-policy-agent/opa/v1/features/tracing"
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
|
|||||||
@@ -151,8 +151,8 @@ import (
|
|||||||
"sort"
|
"sort"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/open-policy-agent/opa/ast"
|
|
||||||
"github.com/open-policy-agent/opa/internal/edittree/bitvector"
|
"github.com/open-policy-agent/opa/internal/edittree/bitvector"
|
||||||
|
"github.com/open-policy-agent/opa/v1/ast"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Deletions are encoded with a nil value pointer.
|
// Deletions are encoded with a nil value pointer.
|
||||||
|
|||||||
@@ -9,8 +9,8 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/open-policy-agent/opa/ast"
|
"github.com/open-policy-agent/opa/v1/ast"
|
||||||
"github.com/open-policy-agent/opa/topdown/builtins"
|
"github.com/open-policy-agent/opa/v1/topdown/builtins"
|
||||||
)
|
)
|
||||||
|
|
||||||
// These test cases require malformed tree nodes or arguments,
|
// These test cases require malformed tree nodes or arguments,
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
|
|
||||||
package future
|
package future
|
||||||
|
|
||||||
import "github.com/open-policy-agent/opa/ast"
|
import "github.com/open-policy-agent/opa/v1/ast"
|
||||||
|
|
||||||
// FilterFutureImports filters OUT any future imports from the passed slice of
|
// FilterFutureImports filters OUT any future imports from the passed slice of
|
||||||
// `*ast.Import`s.
|
// `*ast.Import`s.
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ package future
|
|||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
"github.com/open-policy-agent/opa/ast"
|
"github.com/open-policy-agent/opa/v1/ast"
|
||||||
)
|
)
|
||||||
|
|
||||||
// ParserOptionsFromFutureImports transforms a slice of `ast.Import`s into the
|
// ParserOptionsFromFutureImports transforms a slice of `ast.Import`s into the
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ package patch
|
|||||||
import (
|
import (
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/open-policy-agent/opa/storage"
|
"github.com/open-policy-agent/opa/v1/storage"
|
||||||
)
|
)
|
||||||
|
|
||||||
// ParsePatchPathEscaped returns a new path for the given escaped str.
|
// ParsePatchPathEscaped returns a new path for the given escaped str.
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import (
|
|||||||
"reflect"
|
"reflect"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/open-policy-agent/opa/storage"
|
"github.com/open-policy-agent/opa/v1/storage"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestParsePatchPathEscaped(t *testing.T) {
|
func TestParsePatchPathEscaped(t *testing.T) {
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ import (
|
|||||||
|
|
||||||
"github.com/sirupsen/logrus"
|
"github.com/sirupsen/logrus"
|
||||||
|
|
||||||
"github.com/open-policy-agent/opa/logging"
|
"github.com/open-policy-agent/opa/v1/logging"
|
||||||
)
|
)
|
||||||
|
|
||||||
func GetLevel(level string) (logging.Level, error) {
|
func GetLevel(level string) (logging.Level, error) {
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ import (
|
|||||||
"reflect"
|
"reflect"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/open-policy-agent/opa/util"
|
"github.com/open-policy-agent/opa/v1/util"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestMergeDocs(t *testing.T) {
|
func TestMergeDocs(t *testing.T) {
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ package oracle
|
|||||||
import (
|
import (
|
||||||
"errors"
|
"errors"
|
||||||
|
|
||||||
"github.com/open-policy-agent/opa/ast"
|
"github.com/open-policy-agent/opa/v1/ast"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Error defines the structure of errors returned by the oracle.
|
// Error defines the structure of errors returned by the oracle.
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/open-policy-agent/opa/ast"
|
"github.com/open-policy-agent/opa/v1/ast"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestOracleFindDefinitionErrors(t *testing.T) {
|
func TestOracleFindDefinitionErrors(t *testing.T) {
|
||||||
|
|||||||
@@ -12,10 +12,10 @@ import (
|
|||||||
"sort"
|
"sort"
|
||||||
|
|
||||||
"github.com/fsnotify/fsnotify"
|
"github.com/fsnotify/fsnotify"
|
||||||
"github.com/open-policy-agent/opa/ast"
|
|
||||||
initload "github.com/open-policy-agent/opa/internal/runtime/init"
|
initload "github.com/open-policy-agent/opa/internal/runtime/init"
|
||||||
"github.com/open-policy-agent/opa/loader"
|
"github.com/open-policy-agent/opa/v1/ast"
|
||||||
"github.com/open-policy-agent/opa/storage"
|
"github.com/open-policy-agent/opa/v1/loader"
|
||||||
|
"github.com/open-policy-agent/opa/v1/storage"
|
||||||
)
|
)
|
||||||
|
|
||||||
// CreatePathWatcher creates watchers to monitor for path changes
|
// CreatePathWatcher creates watchers to monitor for path changes
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/open-policy-agent/opa/util/test"
|
"github.com/open-policy-agent/opa/v1/util/test"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestWatchPaths(t *testing.T) {
|
func TestWatchPaths(t *testing.T) {
|
||||||
|
|||||||
@@ -11,10 +11,10 @@ import (
|
|||||||
"io"
|
"io"
|
||||||
"sort"
|
"sort"
|
||||||
|
|
||||||
"github.com/open-policy-agent/opa/ast"
|
|
||||||
"github.com/open-policy-agent/opa/ast/location"
|
|
||||||
"github.com/open-policy-agent/opa/internal/debug"
|
"github.com/open-policy-agent/opa/internal/debug"
|
||||||
"github.com/open-policy-agent/opa/ir"
|
"github.com/open-policy-agent/opa/v1/ast"
|
||||||
|
"github.com/open-policy-agent/opa/v1/ast/location"
|
||||||
|
"github.com/open-policy-agent/opa/v1/ir"
|
||||||
)
|
)
|
||||||
|
|
||||||
// QuerySet represents the input to the planner.
|
// QuerySet represents the input to the planner.
|
||||||
|
|||||||
@@ -11,8 +11,8 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/open-policy-agent/opa/ast"
|
"github.com/open-policy-agent/opa/v1/ast"
|
||||||
"github.com/open-policy-agent/opa/ir"
|
"github.com/open-policy-agent/opa/v1/ir"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestPlannerHelloWorld(t *testing.T) {
|
func TestPlannerHelloWorld(t *testing.T) {
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"sort"
|
"sort"
|
||||||
|
|
||||||
"github.com/open-policy-agent/opa/ast"
|
"github.com/open-policy-agent/opa/v1/ast"
|
||||||
)
|
)
|
||||||
|
|
||||||
// funcstack implements a simple map structure used to keep track of virtual
|
// funcstack implements a simple map structure used to keep track of virtual
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ package planner
|
|||||||
import (
|
import (
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/open-policy-agent/opa/ast"
|
"github.com/open-policy-agent/opa/v1/ast"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestFuncstack(t *testing.T) {
|
func TestFuncstack(t *testing.T) {
|
||||||
|
|||||||
@@ -5,8 +5,8 @@
|
|||||||
package planner
|
package planner
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/open-policy-agent/opa/ast"
|
"github.com/open-policy-agent/opa/v1/ast"
|
||||||
"github.com/open-policy-agent/opa/ir"
|
"github.com/open-policy-agent/opa/v1/ir"
|
||||||
)
|
)
|
||||||
|
|
||||||
type varstack []map[ast.Var]ir.Local
|
type varstack []map[ast.Var]ir.Local
|
||||||
|
|||||||
@@ -3,8 +3,8 @@ package planner
|
|||||||
import (
|
import (
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/open-policy-agent/opa/ast"
|
"github.com/open-policy-agent/opa/v1/ast"
|
||||||
"github.com/open-policy-agent/opa/ir"
|
"github.com/open-policy-agent/opa/v1/ir"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestVarStackPushPop(t *testing.T) {
|
func TestVarStackPushPop(t *testing.T) {
|
||||||
|
|||||||
@@ -18,15 +18,15 @@ import (
|
|||||||
|
|
||||||
"github.com/olekukonko/tablewriter"
|
"github.com/olekukonko/tablewriter"
|
||||||
|
|
||||||
"github.com/open-policy-agent/opa/ast"
|
"github.com/open-policy-agent/opa/v1/ast"
|
||||||
"github.com/open-policy-agent/opa/cover"
|
"github.com/open-policy-agent/opa/v1/cover"
|
||||||
"github.com/open-policy-agent/opa/format"
|
"github.com/open-policy-agent/opa/v1/format"
|
||||||
"github.com/open-policy-agent/opa/loader"
|
"github.com/open-policy-agent/opa/v1/loader"
|
||||||
"github.com/open-policy-agent/opa/metrics"
|
"github.com/open-policy-agent/opa/v1/metrics"
|
||||||
"github.com/open-policy-agent/opa/profiler"
|
"github.com/open-policy-agent/opa/v1/profiler"
|
||||||
"github.com/open-policy-agent/opa/rego"
|
"github.com/open-policy-agent/opa/v1/rego"
|
||||||
"github.com/open-policy-agent/opa/storage"
|
"github.com/open-policy-agent/opa/v1/storage"
|
||||||
"github.com/open-policy-agent/opa/topdown"
|
"github.com/open-policy-agent/opa/v1/topdown"
|
||||||
)
|
)
|
||||||
|
|
||||||
// DefaultProfileSortOrder is the default ordering unless something is specified in the CLI
|
// DefaultProfileSortOrder is the default ordering unless something is specified in the CLI
|
||||||
|
|||||||
@@ -14,13 +14,13 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/open-policy-agent/opa/ast"
|
"github.com/open-policy-agent/opa/v1/ast"
|
||||||
"github.com/open-policy-agent/opa/loader"
|
"github.com/open-policy-agent/opa/v1/loader"
|
||||||
"github.com/open-policy-agent/opa/rego"
|
"github.com/open-policy-agent/opa/v1/rego"
|
||||||
"github.com/open-policy-agent/opa/storage"
|
"github.com/open-policy-agent/opa/v1/storage"
|
||||||
inmem "github.com/open-policy-agent/opa/storage/inmem/test"
|
inmem "github.com/open-policy-agent/opa/v1/storage/inmem/test"
|
||||||
"github.com/open-policy-agent/opa/util"
|
"github.com/open-policy-agent/opa/v1/util"
|
||||||
"github.com/open-policy-agent/opa/util/test"
|
"github.com/open-policy-agent/opa/v1/util/test"
|
||||||
)
|
)
|
||||||
|
|
||||||
type testErrorWithMarshaller struct {
|
type testErrorWithMarshaller struct {
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ import (
|
|||||||
"github.com/prometheus/client_golang/prometheus"
|
"github.com/prometheus/client_golang/prometheus"
|
||||||
"github.com/prometheus/client_golang/prometheus/promhttp"
|
"github.com/prometheus/client_golang/prometheus/promhttp"
|
||||||
|
|
||||||
"github.com/open-policy-agent/opa/metrics"
|
"github.com/open-policy-agent/opa/v1/metrics"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Provider wraps a metrics.Metrics provider with a Prometheus registry that can
|
// Provider wraps a metrics.Metrics provider with a Prometheus registry that can
|
||||||
|
|||||||
@@ -12,8 +12,8 @@ import (
|
|||||||
"encoding/json"
|
"encoding/json"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/open-policy-agent/opa/logging"
|
"github.com/open-policy-agent/opa/v1/logging"
|
||||||
"github.com/open-policy-agent/opa/metrics"
|
"github.com/open-policy-agent/opa/v1/metrics"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestJSONSerialization(t *testing.T) {
|
func TestJSONSerialization(t *testing.T) {
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ import (
|
|||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/open-policy-agent/opa/internal/version"
|
"github.com/open-policy-agent/opa/internal/version"
|
||||||
"github.com/open-policy-agent/opa/logging"
|
"github.com/open-policy-agent/opa/v1/logging"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Values taken from
|
// Values taken from
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ import (
|
|||||||
"testing"
|
"testing"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/open-policy-agent/opa/logging"
|
"github.com/open-policy-agent/opa/v1/logging"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestECR(t *testing.T) {
|
func TestECR(t *testing.T) {
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ import (
|
|||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/open-policy-agent/opa/internal/version"
|
"github.com/open-policy-agent/opa/internal/version"
|
||||||
"github.com/open-policy-agent/opa/logging"
|
"github.com/open-policy-agent/opa/v1/logging"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Values taken from
|
// Values taken from
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ import (
|
|||||||
"net/http/httptest"
|
"net/http/httptest"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/open-policy-agent/opa/logging"
|
"github.com/open-policy-agent/opa/v1/logging"
|
||||||
)
|
)
|
||||||
|
|
||||||
func mockPayload(request KMSSignRequest) string {
|
func mockPayload(request KMSSignRequest) string {
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ import (
|
|||||||
|
|
||||||
v4 "github.com/open-policy-agent/opa/internal/providers/aws/v4"
|
v4 "github.com/open-policy-agent/opa/internal/providers/aws/v4"
|
||||||
|
|
||||||
"github.com/open-policy-agent/opa/ast"
|
"github.com/open-policy-agent/opa/v1/ast"
|
||||||
)
|
)
|
||||||
|
|
||||||
func stringFromTerm(t *ast.Term) string {
|
func stringFromTerm(t *ast.Term) string {
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import (
|
|||||||
"io"
|
"io"
|
||||||
"net/http"
|
"net/http"
|
||||||
|
|
||||||
"github.com/open-policy-agent/opa/logging"
|
"github.com/open-policy-agent/opa/v1/logging"
|
||||||
)
|
)
|
||||||
|
|
||||||
// DoRequestWithClient is a convenience function to get the body of an HTTP response with
|
// DoRequestWithClient is a convenience function to get the body of an HTTP response with
|
||||||
|
|||||||
+2
-2
@@ -9,8 +9,8 @@ import (
|
|||||||
"errors"
|
"errors"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/open-policy-agent/opa/ast"
|
"github.com/open-policy-agent/opa/v1/ast"
|
||||||
"github.com/open-policy-agent/opa/storage"
|
"github.com/open-policy-agent/opa/v1/storage"
|
||||||
)
|
)
|
||||||
|
|
||||||
// ParseDataPath returns a ref from the slash separated path s rooted at data.
|
// ParseDataPath returns a ref from the slash separated path s rooted at data.
|
||||||
|
|||||||
@@ -4,11 +4,11 @@ import (
|
|||||||
"io"
|
"io"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/open-policy-agent/opa/ast"
|
"github.com/open-policy-agent/opa/v1/ast"
|
||||||
"github.com/open-policy-agent/opa/metrics"
|
"github.com/open-policy-agent/opa/v1/metrics"
|
||||||
"github.com/open-policy-agent/opa/topdown/builtins"
|
"github.com/open-policy-agent/opa/v1/topdown/builtins"
|
||||||
"github.com/open-policy-agent/opa/topdown/cache"
|
"github.com/open-policy-agent/opa/v1/topdown/cache"
|
||||||
"github.com/open-policy-agent/opa/topdown/print"
|
"github.com/open-policy-agent/opa/v1/topdown/print"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Result holds the evaluation result.
|
// Result holds the evaluation result.
|
||||||
|
|||||||
@@ -17,12 +17,12 @@ import (
|
|||||||
"sync"
|
"sync"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/open-policy-agent/opa/keys"
|
"github.com/open-policy-agent/opa/v1/keys"
|
||||||
"github.com/open-policy-agent/opa/logging"
|
"github.com/open-policy-agent/opa/v1/logging"
|
||||||
|
|
||||||
"github.com/open-policy-agent/opa/plugins/rest"
|
|
||||||
"github.com/open-policy-agent/opa/util"
|
|
||||||
"github.com/open-policy-agent/opa/version"
|
"github.com/open-policy-agent/opa/version"
|
||||||
|
|
||||||
|
"github.com/open-policy-agent/opa/v1/plugins/rest"
|
||||||
|
"github.com/open-policy-agent/opa/v1/util"
|
||||||
)
|
)
|
||||||
|
|
||||||
// ExternalServiceURL is the base HTTP URL for a telemetry service.
|
// ExternalServiceURL is the base HTTP URL for a telemetry service.
|
||||||
|
|||||||
@@ -12,12 +12,12 @@ import (
|
|||||||
"path/filepath"
|
"path/filepath"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/open-policy-agent/opa/ast"
|
|
||||||
"github.com/open-policy-agent/opa/bundle"
|
|
||||||
storedversion "github.com/open-policy-agent/opa/internal/version"
|
storedversion "github.com/open-policy-agent/opa/internal/version"
|
||||||
"github.com/open-policy-agent/opa/loader"
|
"github.com/open-policy-agent/opa/v1/ast"
|
||||||
"github.com/open-policy-agent/opa/metrics"
|
"github.com/open-policy-agent/opa/v1/bundle"
|
||||||
"github.com/open-policy-agent/opa/storage"
|
"github.com/open-policy-agent/opa/v1/loader"
|
||||||
|
"github.com/open-policy-agent/opa/v1/metrics"
|
||||||
|
"github.com/open-policy-agent/opa/v1/storage"
|
||||||
)
|
)
|
||||||
|
|
||||||
// InsertAndCompileOptions contains the input for the operation.
|
// InsertAndCompileOptions contains the input for the operation.
|
||||||
|
|||||||
@@ -16,14 +16,14 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/open-policy-agent/opa/ast"
|
|
||||||
"github.com/open-policy-agent/opa/bundle"
|
|
||||||
"github.com/open-policy-agent/opa/internal/file/archive"
|
"github.com/open-policy-agent/opa/internal/file/archive"
|
||||||
"github.com/open-policy-agent/opa/loader"
|
"github.com/open-policy-agent/opa/v1/ast"
|
||||||
"github.com/open-policy-agent/opa/storage"
|
"github.com/open-policy-agent/opa/v1/bundle"
|
||||||
inmem "github.com/open-policy-agent/opa/storage/inmem/test"
|
"github.com/open-policy-agent/opa/v1/loader"
|
||||||
"github.com/open-policy-agent/opa/util"
|
"github.com/open-policy-agent/opa/v1/storage"
|
||||||
"github.com/open-policy-agent/opa/util/test"
|
inmem "github.com/open-policy-agent/opa/v1/storage/inmem/test"
|
||||||
|
"github.com/open-policy-agent/opa/v1/util"
|
||||||
|
"github.com/open-policy-agent/opa/v1/util/test"
|
||||||
"github.com/open-policy-agent/opa/version"
|
"github.com/open-policy-agent/opa/version"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@@ -9,8 +9,8 @@ import (
|
|||||||
"os"
|
"os"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/open-policy-agent/opa/ast"
|
"github.com/open-policy-agent/opa/v1/ast"
|
||||||
"github.com/open-policy-agent/opa/util"
|
"github.com/open-policy-agent/opa/v1/util"
|
||||||
"github.com/open-policy-agent/opa/version"
|
"github.com/open-policy-agent/opa/version"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@@ -10,8 +10,8 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/open-policy-agent/opa/storage"
|
"github.com/open-policy-agent/opa/v1/storage"
|
||||||
"github.com/open-policy-agent/opa/storage/inmem"
|
"github.com/open-policy-agent/opa/v1/storage/inmem"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Transaction is a mock storage.Transaction implementation for use in testing.
|
// Transaction is a mock storage.Transaction implementation for use in testing.
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"runtime"
|
"runtime"
|
||||||
|
|
||||||
"github.com/open-policy-agent/opa/storage"
|
"github.com/open-policy-agent/opa/v1/storage"
|
||||||
"github.com/open-policy-agent/opa/version"
|
"github.com/open-policy-agent/opa/version"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
Basic Wasm Module Evaluation Example
|
Basic Wasm Module Evaluation Example
|
||||||
====================================
|
====================================
|
||||||
|
|
||||||
The [main.go](./main.go) example demonstrates the loading and executing of OPA
|
The [main.go](main.go) example demonstrates the loading and executing of OPA
|
||||||
produced wasm policy binary.
|
produced wasm policy binary.
|
||||||
|
|
||||||
## Setup
|
## Setup
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
Loader Example
|
Loader Example
|
||||||
==============
|
==============
|
||||||
|
|
||||||
[main.go](./main.go) loads a bundle either from a file or HTTP server.
|
[main.go](main.go) loads a bundle either from a file or HTTP server.
|
||||||
|
|
||||||
## Setup
|
## Setup
|
||||||
|
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user