package v1
import "github.com/open-policy-agent/opa/v1"
Package v1 implements the v1 API for the Open Policy Agent (OPA). The v1 API defaults to enforcing the v1 Rego syntax (github.com/open-policy-agent/opa/v1/ast.RegoV1). Most packages outside the v1 API are deprecated. These constitute the older v0 API, which defaults to the v0 Rego syntax (github.com/open-policy-agent/opa/v1/ast.RegoV0). The v0 API is provided as a means to ease transition to OPA 1.0 for 3rd party integrations, see [TODO: LINK TO V0 MIGRATION GUIDE].
Index ¶
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
v1/ast | Package ast declares Rego syntax tree types and also includes a parser and compiler for preparing policies for execution in the policy engine. |
v1/ast/internal | |
v1/ast/json | This package provides options for JSON marshalling of AST nodes, and location data in particular. |
v1/ast/location | Package location defines locations in Rego source code. |
v1/ast/oracle | |
v1/bundle | Package bundle implements bundle loading. |
v1/capabilities | |
v1/compile | Package compile implements bundles compilation and linking. |
v1/config | Package config implements OPA configuration file parsing and validation. |
v1/cover | Package cover reports coverage on modules. |
v1/debug | Package debug EXPERIMENTAL: This package is under active development and is subject to change. |
v1/dependencies | Package dependencies provides functions for determining the set of ast.Refs that AST elements depend on. |
v1/download | Package download implements low-level OPA bundle downloading. |
v1/features | |
v1/features/tracing | |
v1/features/wasm | Import this package to enable evaluation of rego code using the built-in wasm engine. |
v1/format | Package format implements formatting of Rego source files. |
v1/hooks | |
v1/ir | Package ir defines an intermediate representation (IR) for Rego. |
v1/ir/encoding | |
v1/keys | |
v1/loader | Package loader contains utilities for loading files into OPA. |
v1/loader/extension | |
v1/loader/filter | |
v1/logging | |
v1/logging/test | |
v1/metrics | Package metrics contains helpers for performance metric management inside the policy engine. |
v1/plugins | Package plugins implements plugin management for the policy engine. |
v1/plugins/bundle | Package bundle implements bundle loading. |
v1/plugins/discovery | Package discovery implements configuration discovery. |
v1/plugins/logs | Package logs implements decision log buffering and uploading. |
v1/plugins/logs/status | |
v1/plugins/rest | Package rest implements a REST client for communicating with remote services. |
v1/plugins/server | |
v1/plugins/server/decoding | Package decoding implements the configuration side of the upgraded gzip decompression framework. |
v1/plugins/server/encoding | |
v1/plugins/server/metrics | |
v1/plugins/status | Package status implements status reporting. |
v1/profiler | Package profiler computes and reports on the time spent on expressions. |
v1/refactor | Package refactor implements different refactoring operations over Rego modules. |
v1/rego | Package rego exposes high level APIs for evaluating Rego policies. |
v1/repl | Package repl implements a Read-Eval-Print-Loop (REPL) for interacting with the policy engine. |
v1/resolver | |
v1/resolver/wasm | |
v1/runtime | Package runtime contains the entry point to the policy engine. |
v1/schemas | |
v1/sdk | Package sdk contains a high-level API for embedding OPA inside of Go programs. |
v1/sdk/test | |
v1/server | Package server contains the policy engine's server handlers. |
v1/server/authorizer | Package authorizer provides authorization handlers to the server. |
v1/server/handlers | |
v1/server/identifier | Package identifier provides handlers for associating identity information with incoming requests. |
v1/server/types | Package types contains request/response types and codes for the server. |
v1/server/writer | Package writer contains utilities for writing responses in the server. |
v1/storage | Package storage exposes the policy engine's storage layer. |
v1/storage/disk | Package disk provides disk-based implementation of the storage.Store interface. |
v1/storage/inmem | Package inmem implements an in-memory version of the policy engine's storage layer. |
v1/storage/inmem/test | |
v1/storage/internal | |
v1/test | |
v1/test/authz | Package authz contains unit and benchmark tests for authz use-cases The public (non-test) APIs are meant to be used as helpers for other tests to build off of. |
v1/test/cases | Package cases contains utilities for evaluation test cases. |
v1/test/cases/internal | |
v1/test/e2e | |
v1/test/e2e/authz | nolint: deadcode,unused // build tags confuse these linters |
v1/test/e2e/certrefresh | |
v1/test/e2e/concurrency | |
v1/test/e2e/diagnostics | |
v1/test/e2e/distributedtracing | |
v1/test/e2e/h2c | |
v1/test/e2e/http | |
v1/test/e2e/logs | |
v1/test/e2e/logs/console | |
v1/test/e2e/metrics | |
v1/test/e2e/oci | |
v1/test/e2e/print | |
v1/test/e2e/shutdown | |
v1/test/e2e/tls | |
v1/test/e2e/wasm | |
v1/test/e2e/wasm/authz | nolint: deadcode,unused // build tags confuse these linters |
v1/tester | Package tester contains utilities for executing Rego tests. |
v1/test/scheduler | |
v1/test/wasm | |
v1/test/wasm/cmd | |
v1/test/wasm/cmd/wasm-rego-testgen | |
v1/topdown | Package topdown provides low-level query evaluation support. |
v1/topdown/builtins | Package builtins contains utilities for implementing built-in functions. |
v1/topdown/cache | Package cache defines the inter-query cache interface that can cache data across queries |
v1/topdown/copypropagation | |
v1/topdown/lineage | |
v1/topdown/print | |
v1/tracing | Package tracing enables dependency-injection at runtime. |
v1/types | Package types declares data types for Rego values and helper functions to operate on these types. |
v1/util | Package util provides generic utilities used throughout the policy engine. |
v1/util/decoding | |
v1/util/test | Package test contains utilities used in the policy engine's test suite. |
v1/version | Package version contains version information that is set at build time. |
- Version
- v1.4.2 (latest)
- Published
- May 2, 2025
- Platform
- linux/amd64
- Last checked
- 3 weeks ago –
Tools for package owners.