mirror of
https://github.com/open-policy-agent/opa.git
synced 2026-08-25 17:55:15 -06:00
8190f997af
This commit adds an experimental "intermediate results" field to decision logs, and provides some basic plumbing in the server package for attaching the intermediate results of an eval to the request context. Co-authored-by: Teemu Koponen <koponen@styra.com> Signed-off-by: Philip Conrad <philip@chariot-chaser.net>
48 lines
1.3 KiB
Go
48 lines
1.3 KiB
Go
// Copyright 2017 The OPA Authors. All rights reserved.
|
|
// Use of this source code is governed by an Apache2
|
|
// license that can be found in the LICENSE file.
|
|
|
|
package server
|
|
|
|
import (
|
|
"time"
|
|
|
|
"github.com/open-policy-agent/opa/v1/ast"
|
|
"github.com/open-policy-agent/opa/v1/logging"
|
|
"github.com/open-policy-agent/opa/v1/metrics"
|
|
"github.com/open-policy-agent/opa/v1/storage"
|
|
"github.com/open-policy-agent/opa/v1/topdown"
|
|
)
|
|
|
|
// Info contains information describing a policy decision.
|
|
type Info struct {
|
|
Txn storage.Transaction
|
|
Revision string // Deprecated: Use `Bundles` instead
|
|
Bundles map[string]BundleInfo
|
|
DecisionID string
|
|
BatchDecisionID string
|
|
TraceID string
|
|
SpanID string
|
|
RemoteAddr string
|
|
HTTPRequestContext logging.HTTPRequestContext
|
|
Query string
|
|
Path string
|
|
Timestamp time.Time
|
|
Input *any
|
|
InputAST ast.Value
|
|
Results *any
|
|
IntermediateResults map[string]any
|
|
MappedResults *any
|
|
NDBuiltinCache *any
|
|
Error error
|
|
Metrics metrics.Metrics
|
|
Trace []*topdown.Event
|
|
RequestID uint64
|
|
Custom map[string]any
|
|
}
|
|
|
|
// BundleInfo contains information describing a bundle.
|
|
type BundleInfo struct {
|
|
Revision string
|
|
}
|