types

package
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 20, 2024 License: Apache-2.0 Imports: 3 Imported by: 75

Documentation

Overview

Deprecated: This package is intended for older projects transitioning from OPA v0.x and will remain for the lifetime of OPA v1.x, but its use is not recommended. For newer features and behaviours, such as defaulting to the Rego v1 syntax, use the corresponding components in the github.com/open-policy-agent/opa/v1 package instead. See https://www.openpolicyagent.org/docs/latest/v0-compatibility/ for more information.

Package types contains request/response types and codes for the server.

Index

Constants

View Source
const (
	CodeInternal          = v1.CodeInternal
	CodeEvaluation        = v1.CodeEvaluation
	CodeUnauthorized      = v1.CodeUnauthorized
	CodeInvalidParameter  = v1.CodeInvalidParameter
	CodeInvalidOperation  = v1.CodeInvalidOperation
	CodeResourceNotFound  = v1.CodeResourceNotFound
	CodeResourceConflict  = v1.CodeResourceConflict
	CodeUndefinedDocument = v1.CodeUndefinedDocument
)

Error codes returned by OPA's REST API.

View Source
const (
	MsgCompileModuleError         = v1.MsgCompileModuleError
	MsgParseQueryError            = v1.MsgParseQueryError
	MsgCompileQueryError          = v1.MsgCompileQueryError
	MsgEvaluationError            = v1.MsgEvaluationError
	MsgUnauthorizedUndefinedError = v1.MsgUnauthorizedUndefinedError
	MsgUnauthorizedError          = v1.MsgUnauthorizedError
	MsgUndefinedError             = v1.MsgUndefinedError
	MsgMissingError               = v1.MsgMissingError
	MsgFoundUndefinedError        = v1.MsgFoundUndefinedError
	MsgPluginConfigError          = v1.MsgPluginConfigError
	MsgDecodingLimitError         = v1.MsgDecodingLimitError
	MsgDecodingGzipLimitError     = v1.MsgDecodingGzipLimitError
)

Messages included in error responses.

View Source
const (
	// ParamQueryV1 defines the name of the HTTP URL parameter that specifies
	// values for the request query.
	ParamQueryV1 = v1.ParamQueryV1

	// ParamInputV1 defines the name of the HTTP URL parameter that specifies
	// values for the "input" document.
	ParamInputV1 = v1.ParamInputV1

	// ParamPrettyV1 defines the name of the HTTP URL parameter that indicates
	// the client wants to receive a pretty-printed version of the response.
	ParamPrettyV1 = v1.ParamPrettyV1

	// ParamExplainV1 defines the name of the HTTP URL parameter that indicates the
	// client wants to receive explanations in addition to the result.
	ParamExplainV1 = v1.ParamExplainV1

	// ParamMetricsV1 defines the name of the HTTP URL parameter that indicates
	// the client wants to receive performance metrics in addition to the
	// result.
	ParamMetricsV1 = v1.ParamMetricsV1

	// ParamInstrumentV1 defines the name of the HTTP URL parameter that
	// indicates the client wants to receive instrumentation data for
	// diagnosing performance issues.
	ParamInstrumentV1 = v1.ParamInstrumentV1

	// ParamProvenanceV1 defines the name of the HTTP URL parameter that indicates
	// the client wants build and version information in addition to the result.
	ParamProvenanceV1 = v1.ParamProvenanceV1

	// ParamBundleActivationV1 defines the name of the HTTP URL parameter that
	// indicates the client wants to include bundle activation in the results
	// of the health API.
	// Deprecated: Use ParamBundlesActivationV1 instead.
	ParamBundleActivationV1 = v1.ParamBundleActivationV1

	// ParamBundlesActivationV1 defines the name of the HTTP URL parameter that
	// indicates the client wants to include bundle activation in the results
	// of the health API.
	ParamBundlesActivationV1 = v1.ParamBundlesActivationV1

	// ParamPluginsV1 defines the name of the HTTP URL parameter that
	// indicates the client wants to include bundle status in the results
	// of the health API.
	ParamPluginsV1 = v1.ParamPluginsV1

	// ParamExcludePluginV1 defines the name of the HTTP URL parameter that
	// indicates the client wants to exclude plugin status in the results
	// of the health API for the specified plugin(s)
	ParamExcludePluginV1 = v1.ParamExcludePluginV1

	// ParamStrictBuiltinErrors names the HTTP URL parameter that indicates the client
	// wants built-in function errors to be treated as fatal.
	ParamStrictBuiltinErrors = v1.ParamStrictBuiltinErrors
)
View Source
const CodeAPIUsageWarn = v1.CodeAPIUsageWarn

Warning Codes

View Source
const MsgInputKeyMissing = v1.MsgInputKeyMissing

Warning Messages

Variables

This section is empty.

Functions

func BadPatchOperationErr

func BadPatchOperationErr(op string) error

BadPatchOperationErr returns BadRequestErr indicating the patch operation was invalid.

func BadPatchPathErr

func BadPatchPathErr(path string) error

BadPatchPathErr returns BadRequestErr indicating the patch path was invalid.

func IsBadRequest

func IsBadRequest(err error) bool

IsBadRequest returns true if err is a BadRequestErr.

Types

type AdhocQueryResultSetV1

type AdhocQueryResultSetV1 = v1.AdhocQueryResultSetV1

AdhocQueryResultSetV1 models the result of a Query API query.

type BadRequestErr

type BadRequestErr = v1.BadRequestErr

BadRequestErr represents an error condition raised if the caller passes invalid parameters.

type BindingV1

type BindingV1 = v1.BindingV1

BindingV1 represents a single term binding.

func NewBindingsV1

func NewBindingsV1(locals *ast.ValueMap) (result []*BindingV1)

NewBindingsV1 returns a new BindingsV1 object.

type BindingsV1

type BindingsV1 = v1.BindingsV1

BindingsV1 represents a set of term bindings.

type CompileRequestV1 added in v0.9.0

type CompileRequestV1 = v1.CompileRequestV1

CompileRequestV1 models the request message for Compile API operations.

type CompileResponseV1 added in v0.9.0

type CompileResponseV1 = v1.CompileResponseV1

CompileResponseV1 models the response message for Compile API operations.

type ConfigResponseV1 added in v0.28.0

type ConfigResponseV1 = v1.ConfigResponseV1

ConfigResponseV1 models the response message for Config API operations.

type DataRequestV1

type DataRequestV1 = v1.DataRequestV1

DataRequestV1 models the request message for Data API POST operations.

type DataResponseV1

type DataResponseV1 = v1.DataResponseV1

DataResponseV1 models the response message for Data API read operations.

type ErrorV1

type ErrorV1 = v1.ErrorV1

ErrorV1 models an error response sent to the client.

func NewErrorV1

func NewErrorV1(code, f string, a ...interface{}) *ErrorV1

NewErrorV1 returns a new ErrorV1 object.

type ExplainModeV1

type ExplainModeV1 = v1.ExplainModeV1

ExplainModeV1 defines supported values for the "explain" query parameter.

const (
	ExplainOffV1   ExplainModeV1 = v1.ExplainOffV1
	ExplainFullV1  ExplainModeV1 = v1.ExplainFullV1
	ExplainNotesV1 ExplainModeV1 = v1.ExplainNotesV1
	ExplainFailsV1 ExplainModeV1 = v1.ExplainFailsV1
	ExplainDebugV1 ExplainModeV1 = v1.ExplainDebugV1
)

Explanation mode enumeration.

type HealthResponseV1 added in v0.33.0

type HealthResponseV1 = v1.HealthResponseV1

HealthResponseV1 models the response message for Health API operations.

type MetricsV1 added in v0.4.9

type MetricsV1 = v1.MetricsV1

MetricsV1 models a collection of performance metrics.

type PartialEvaluationResultV1 added in v0.9.0

type PartialEvaluationResultV1 = v1.PartialEvaluationResultV1

PartialEvaluationResultV1 represents the output of partial evaluation and is included in Compile API responses.

type PatchV1

type PatchV1 = v1.PatchV1

PatchV1 models a single patch operation against a document.

type PolicyDeleteResponseV1 added in v0.5.6

type PolicyDeleteResponseV1 = v1.PolicyDeleteResponseV1

PolicyDeleteResponseV1 models the response message for the Policy API delete operation.

type PolicyGetResponseV1

type PolicyGetResponseV1 = v1.PolicyGetResponseV1

PolicyGetResponseV1 models the response message for the Policy API get operation.

type PolicyListResponseV1

type PolicyListResponseV1 = v1.PolicyListResponseV1

PolicyListResponseV1 models the response message for the Policy API list operation.

type PolicyPutResponseV1

type PolicyPutResponseV1 = v1.PolicyPutResponseV1

PolicyPutResponseV1 models the response message for the Policy API put operation.

type PolicyV1

type PolicyV1 = v1.PolicyV1

PolicyV1 models a policy module in OPA.

type ProvenanceBundleV1 added in v0.13.0

type ProvenanceBundleV1 = v1.ProvenanceBundleV1

ProvenanceBundleV1 models a bundle at some point in time

type ProvenanceV1 added in v0.11.0

type ProvenanceV1 = v1.ProvenanceV1

ProvenanceV1 models a collection of build/version information.

type QueryRequestV1 added in v0.10.0

type QueryRequestV1 = v1.QueryRequestV1

QueryRequestV1 models the request message for Query API operations.

type QueryResponseV1

type QueryResponseV1 = v1.QueryResponseV1

QueryResponseV1 models the response message for Query API operations.

type StatusResponseV1 added in v0.36.0

type StatusResponseV1 = v1.StatusResponseV1

StatusResponseV1 models the response message for Status API (pull) operations.

type TraceEventV1

type TraceEventV1 = v1.TraceEventV1

TraceEventV1 represents a step in the query evaluation process.

type TraceV1

type TraceV1 = v1.TraceV1

TraceV1 models the trace result returned for queries that include the "explain" parameter.

func NewTraceV1

func NewTraceV1(trace []*topdown.Event, pretty bool) (result TraceV1, err error)

NewTraceV1 returns a new TraceV1 object.

type TraceV1Pretty added in v0.5.5

type TraceV1Pretty = v1.TraceV1Pretty

TraceV1Pretty models the trace result returned for queries that include the "explain" parameter. The trace is modelled as a human readable array of strings representing the evaluation of the query.

type TraceV1Raw added in v0.5.5

type TraceV1Raw = v1.TraceV1Raw

TraceV1Raw models the trace result returned for queries that include the "explain" parameter. The trace is modelled as series of trace events that identify the expression, local term bindings, query hierarchy, etc.

type Warning added in v0.39.0

type Warning = v1.Warning

Warning models DataResponse warnings

func NewWarning added in v0.39.0

func NewWarning(code, message string) *Warning

NewWarning returns a new Warning object

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL