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

doc.go

Directories

PathSynopsis
v1/astPackage 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/jsonThis package provides options for JSON marshalling of AST nodes, and location data in particular.
v1/ast/locationPackage location defines locations in Rego source code.
v1/ast/oracle
v1/bundlePackage bundle implements bundle loading.
v1/capabilities
v1/compilePackage compile implements bundles compilation and linking.
v1/configPackage config implements OPA configuration file parsing and validation.
v1/coverPackage cover reports coverage on modules.
v1/debugPackage debug EXPERIMENTAL: This package is under active development and is subject to change.
v1/dependenciesPackage dependencies provides functions for determining the set of ast.Refs that AST elements depend on.
v1/downloadPackage download implements low-level OPA bundle downloading.
v1/features
v1/features/tracing
v1/features/wasmImport this package to enable evaluation of rego code using the built-in wasm engine.
v1/formatPackage format implements formatting of Rego source files.
v1/hooks
v1/irPackage ir defines an intermediate representation (IR) for Rego.
v1/ir/encoding
v1/keys
v1/loaderPackage loader contains utilities for loading files into OPA.
v1/loader/extension
v1/loader/filter
v1/logging
v1/logging/test
v1/metricsPackage metrics contains helpers for performance metric management inside the policy engine.
v1/pluginsPackage plugins implements plugin management for the policy engine.
v1/plugins/bundlePackage bundle implements bundle loading.
v1/plugins/discoveryPackage discovery implements configuration discovery.
v1/plugins/logsPackage logs implements decision log buffering and uploading.
v1/plugins/logs/status
v1/plugins/restPackage rest implements a REST client for communicating with remote services.
v1/plugins/server
v1/plugins/server/decodingPackage decoding implements the configuration side of the upgraded gzip decompression framework.
v1/plugins/server/encoding
v1/plugins/server/metrics
v1/plugins/statusPackage status implements status reporting.
v1/profilerPackage profiler computes and reports on the time spent on expressions.
v1/refactorPackage refactor implements different refactoring operations over Rego modules.
v1/regoPackage rego exposes high level APIs for evaluating Rego policies.
v1/replPackage repl implements a Read-Eval-Print-Loop (REPL) for interacting with the policy engine.
v1/resolver
v1/resolver/wasm
v1/runtimePackage runtime contains the entry point to the policy engine.
v1/schemas
v1/sdkPackage sdk contains a high-level API for embedding OPA inside of Go programs.
v1/sdk/test
v1/serverPackage server contains the policy engine's server handlers.
v1/server/authorizerPackage authorizer provides authorization handlers to the server.
v1/server/handlers
v1/server/identifierPackage identifier provides handlers for associating identity information with incoming requests.
v1/server/typesPackage types contains request/response types and codes for the server.
v1/server/writerPackage writer contains utilities for writing responses in the server.
v1/storagePackage storage exposes the policy engine's storage layer.
v1/storage/diskPackage disk provides disk-based implementation of the storage.Store interface.
v1/storage/inmemPackage inmem implements an in-memory version of the policy engine's storage layer.
v1/storage/inmem/test
v1/storage/internal
v1/test
v1/test/authzPackage 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/casesPackage cases contains utilities for evaluation test cases.
v1/test/cases/internal
v1/test/e2e
v1/test/e2e/authznolint: 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/authznolint: deadcode,unused // build tags confuse these linters
v1/testerPackage 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/topdownPackage topdown provides low-level query evaluation support.
v1/topdown/builtinsPackage builtins contains utilities for implementing built-in functions.
v1/topdown/cachePackage cache defines the inter-query cache interface that can cache data across queries
v1/topdown/copypropagation
v1/topdown/lineage
v1/topdown/print
v1/tracingPackage tracing enables dependency-injection at runtime.
v1/typesPackage types declares data types for Rego values and helper functions to operate on these types.
v1/utilPackage util provides generic utilities used throughout the policy engine.
v1/util/decoding
v1/util/testPackage test contains utilities used in the policy engine's test suite.
v1/versionPackage 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.