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
- func BadPatchOperationErr(op string) error
- func BadPatchPathErr(path string) error
- func IsBadRequest(err error) bool
- type AdhocQueryResultSetV1
- type BadRequestErr
- type BindingV1
- type BindingsV1
- type CompileRequestV1
- type CompileResponseV1
- type ConfigResponseV1
- type DataRequestV1
- type DataResponseV1
- type ErrorV1
- type ExplainModeV1
- type HealthResponseV1
- type MetricsV1
- type PartialEvaluationResultV1
- type PatchV1
- type PolicyDeleteResponseV1
- type PolicyGetResponseV1
- type PolicyListResponseV1
- type PolicyPutResponseV1
- type PolicyV1
- type ProvenanceBundleV1
- type ProvenanceV1
- type QueryRequestV1
- type QueryResponseV1
- type StatusResponseV1
- type TraceEventV1
- type TraceV1
- type TraceV1Pretty
- type TraceV1Raw
- type Warning
Constants ¶
const ( CodeInternal = v1.CodeInternal CodeEvaluation = v1.CodeEvaluation CodeInvalidParameter = v1.CodeInvalidParameter CodeInvalidOperation = v1.CodeInvalidOperation CodeResourceNotFound = v1.CodeResourceNotFound CodeResourceConflict = v1.CodeResourceConflict CodeUndefinedDocument = v1.CodeUndefinedDocument )
Error codes returned by OPA's REST API.
const ( MsgCompileModuleError = v1.MsgCompileModuleError MsgParseQueryError = v1.MsgParseQueryError MsgCompileQueryError = v1.MsgCompileQueryError MsgEvaluationError = v1.MsgEvaluationError MsgUndefinedError = v1.MsgUndefinedError MsgMissingError = v1.MsgMissingError MsgFoundUndefinedError = v1.MsgFoundUndefinedError MsgPluginConfigError = v1.MsgPluginConfigError MsgDecodingLimitError = v1.MsgDecodingLimitError MsgDecodingGzipLimitError = v1.MsgDecodingGzipLimitError )
Messages included in error responses.
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 )
const CodeAPIUsageWarn = v1.CodeAPIUsageWarn
Warning Codes
const MsgInputKeyMissing = v1.MsgInputKeyMissing
Warning Messages
Variables ¶
This section is empty.
Functions ¶
func BadPatchOperationErr ¶
BadPatchOperationErr returns BadRequestErr indicating the patch operation was invalid.
func BadPatchPathErr ¶
BadPatchPathErr returns BadRequestErr indicating the patch path was invalid.
func IsBadRequest ¶
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 ¶
BindingV1 represents a single term binding.
func NewBindingsV1 ¶
NewBindingsV1 returns a new BindingsV1 object.
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 ¶
ErrorV1 models an error response sent to the client.
func NewErrorV1 ¶
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 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 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 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 ¶
TraceV1 models the trace result returned for queries that include the "explain" parameter.
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.