Documentation
¶
Index ¶
- func AuthSecretValues(auth *restfile.AuthSpec, res *vars.Resolver) []string
- func CloneRequest(req *restfile.Request) *restfile.Request
- func CommandAuthSecrets(res authcmd.Result) []string
- func HistoryText(req *restfile.Request, text string) string
- func InjectedAuthHeaders(before, after *restfile.Request) []string
- func InjectedAuthSecrets(auth *restfile.AuthSpec, before *restfile.Request, after *restfile.Request) []string
- func RenderRequestText(req *restfile.Request) string
- func ReportResponse(resp *httpx.Response, grpc *grpcx.Response, caps []restfile.Variable, ...) *runfmt.Response
- func ResolveEnvironment(src vars.Environment, doc *restfile.Document, req *restfile.Request) vars.ResolvedEnv
- func ShortSecrets(doc *restfile.Document, env vars.Environment, n int) []string
- type Engine
- func (e *Engine) ApplyPatches(ctx context.Context, doc *restfile.Document, req *restfile.Request, ...) error
- func (e *Engine) BuildCommandAuthConfig(doc *restfile.Document, auth *restfile.AuthSpec, res *vars.Resolver, ...) (authcmd.Config, error)
- func (e *Engine) BuildOAuthConfig(auth *restfile.AuthSpec, res *vars.Resolver) (oauth.Config, error)
- func (e *Engine) CollectVariables(doc *restfile.Document, req *restfile.Request, env vars.Environment, ...) map[string]string
- func (e *Engine) DisplayResolver(ctx context.Context, doc *restfile.Document, req *restfile.Request, ...) *vars.Resolver
- func (e *Engine) EnsureCommandAuth(ctx context.Context, doc *restfile.Document, req *restfile.Request, ...) (authcmd.Result, error)
- func (e *Engine) EnsureOAuth(ctx context.Context, req *restfile.Request, res *vars.Resolver, ...) (string, error)
- func (e *Engine) EvalCondition(ctx context.Context, d RunDoc, req *restfile.Request, src vars.Environment, ...) (bool, string, error)
- func (e *Engine) EvalForEachItems(ctx context.Context, d RunDoc, req *restfile.Request, src vars.Environment, ...) ([]rts.Value, error)
- func (e *Engine) EvalRunVars(ctx context.Context, d RunDoc, req *restfile.Request, src vars.Environment, ...) (vars.NameMap[string], error)
- func (e *Engine) EvalValue(ctx context.Context, in EvalInput) (rts.Value, error)
- func (e *Engine) Execute(doc *restfile.Document, req *restfile.Request, env vars.Environment) (engine.RequestResult, error)
- func (e *Engine) ExecuteWith(doc *restfile.Document, req *restfile.Request, src vars.Environment, ...) (engine.RequestResult, error)
- func (e *Engine) ExprEval(ctx context.Context, in ExprInput) vars.ExprEval
- func (e *Engine) ExprEvalWithOptions(ctx context.Context, in ExprInput, opt ExprEvalOptions) vars.ExprEval
- func (e *Engine) ForRun(cfg engine.Config, resp *httpx.Response, grpc *grpcx.Response) *Engine
- func (e *Engine) PrepareCommandAuth(doc *restfile.Document, auth *restfile.AuthSpec, res *vars.Resolver, ...) (authcmd.Prepared, error)
- func (e *Engine) PrepareExplainAuthPreview(doc *restfile.Document, req *restfile.Request, res *vars.Resolver, ...) (ExplainAuthPreviewResult, error)
- func (e *Engine) ResolveInheritedAuth(doc *restfile.Document, req *restfile.Request)
- func (e *Engine) ResolveOAuthConfig(auth *restfile.AuthSpec, res *vars.Resolver, env vars.ResolvedEnv) (oauth.Config, error)
- func (e *Engine) RunDoc(doc *restfile.Document) RunDoc
- func (e *Engine) RunPreRequest(ctx context.Context, doc *restfile.Document, req *restfile.Request, ...) (prerequest.Output, error)
- func (e *Engine) Secrets(doc *restfile.Document, req *restfile.Request, env vars.Environment) []string
- func (e *Engine) ValueString(ctx context.Context, pos rts.Pos, v rts.Value) (string, error)
- type EvalInput
- type ExecMode
- type ExecOptions
- type ExplainAuthPreviewResult
- type ExprEvalOptions
- type ExprInput
- type ForEachSpec
- type RunDoc
- type RunScope
- type SecretSources
- type Warning
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AuthSecretValues ¶ added in v0.27.2
func CloneRequest ¶
Execution normalizes and mutates requests, so every run starts with its own working copy.
func CommandAuthSecrets ¶ added in v0.27.2
func HistoryText ¶ added in v1.18.0
HistoryText masks sensitive header values in a request's text, unless the request logs them with @log-sensitive-headers.
func InjectedAuthHeaders ¶ added in v1.5.0
func InjectedAuthSecrets ¶ added in v0.27.2
func RenderRequestText ¶
func ReportResponse ¶ added in v1.18.0
func ReportResponse( resp *httpx.Response, grpc *grpcx.Response, caps []restfile.Variable, sec redact.Set, ) *runfmt.Response
ReportResponse returns the response of an HTTP or gRPC result for a run report, or nil when no response arrived. A non-empty gzip body is decoded before it is masked and loses its Content-Encoding and Content-Length headers. A non-empty body with any other content coding, or one that cannot be decoded, is left out. An empty body keeps its headers. Secrets, sensitive headers and cookies are masked before the body is cut to runfmt.MaxBodyBytes, so the cut cannot leave part of a secret behind.
func ResolveEnvironment ¶ added in v1.2.0
func ResolveEnvironment( src vars.Environment, doc *restfile.Document, req *restfile.Request, ) vars.ResolvedEnv
ResolveEnvironment snapshots every declared env: reference for one run, including unused values that may need redaction.
func ShortSecrets ¶ added in v1.18.0
ShortSecrets returns names, never values, sorted.
Types ¶
type Engine ¶
type Engine struct {
// contains filtered or unexported fields
}
func (*Engine) ApplyPatches ¶ added in v0.44.1
func (*Engine) BuildCommandAuthConfig ¶ added in v0.27.2
func (*Engine) BuildOAuthConfig ¶ added in v0.27.2
func (*Engine) CollectVariables ¶
func (*Engine) DisplayResolver ¶ added in v0.48.1
func (e *Engine) DisplayResolver( ctx context.Context, doc *restfile.Document, req *restfile.Request, src vars.Environment, base string, locals rts.Locals, ) *vars.Resolver
DisplayResolver uses normal variable precedence for UI text but leaves out known secret values so labels and previews do not expose them.
func (*Engine) EnsureCommandAuth ¶ added in v0.27.2
func (*Engine) EnsureOAuth ¶ added in v0.27.2
func (*Engine) EvalCondition ¶
func (*Engine) EvalForEachItems ¶
func (*Engine) EvalRunVars ¶ added in v1.9.0
func (e *Engine) EvalRunVars( ctx context.Context, d RunDoc, req *restfile.Request, src vars.Environment, sc RunScope, decls []restfile.RunVar, ) (vars.NameMap[string], error)
EvalRunVars returns the new values alongside those already in sc.RunVars.
func (*Engine) Execute ¶
func (e *Engine) Execute( doc *restfile.Document, req *restfile.Request, env vars.Environment, ) (engine.RequestResult, error)
func (*Engine) ExecuteWith ¶
func (e *Engine) ExecuteWith( doc *restfile.Document, req *restfile.Request, src vars.Environment, opt ExecOptions, ) (engine.RequestResult, error)
func (*Engine) ExprEval ¶ added in v0.44.1
ExprEval returns a {{= expr }} evaluator with default policy.
func (*Engine) ExprEvalWithOptions ¶ added in v0.44.1
func (e *Engine) ExprEvalWithOptions( ctx context.Context, in ExprInput, opt ExprEvalOptions, ) vars.ExprEval
ExprEvalWithOptions is ExprEval with an explicit evaluation policy.
func (*Engine) ForRun ¶ added in v0.49.1
ForRun returns an engine view for a single execution, so preparing the next run cannot rewrite what a request in flight is reading. Fields are listed rather than the struct copied to keep shared and per-run state an explicit choice.
func (*Engine) PrepareCommandAuth ¶ added in v0.27.2
func (*Engine) PrepareExplainAuthPreview ¶ added in v0.27.2
func (*Engine) ResolveInheritedAuth ¶ added in v0.27.2
func (*Engine) ResolveOAuthConfig ¶ added in v0.27.2
func (*Engine) RunPreRequest ¶ added in v0.44.1
type EvalInput ¶ added in v0.49.1
type EvalInput struct {
RunDoc
Req *restfile.Request
Env vars.ResolvedEnv
Base string
Expr string
Site string
Pos rts.Pos
Vars map[string]string
Locals rts.Locals
// contains filtered or unexported fields
}
EvalInput is one expression evaluation. Expr is the source to evaluate, Site is the directive text it came from, used in diagnostics.
type ExecOptions ¶
type ExecOptions struct {
Run *RunScope
Locals rts.Locals
Record bool
Ctx context.Context
Mode ExecMode
OnWarning func(Warning)
OnRepeat func(xexec.RepeatProgress)
AttachSSE func(*httpx.StreamHandle, *restfile.Request)
AttachWS func(*httpx.WebSocketHandle, *restfile.Request)
AttachGRPC func(*stream.Session, *restfile.Request)
}
type ExplainAuthPreviewResult ¶ added in v0.27.2
type ExplainAuthPreviewResult struct {
Status xplain.StageStatus
Summary string
Notes []string
ExtraSecrets []string
}
type ExprEvalOptions ¶ added in v0.44.1
type ExprEvalOptions struct {
// OmitSecretGlobals drops secret global values from the runtime so preview
// and status evaluation cannot expose them.
OmitSecretGlobals bool
}
ExprEvalOptions tunes how a {{= expr }} evaluator treats the RTS runtime.
type ExprInput ¶ added in v0.49.1
type ExprInput struct {
Doc *restfile.Document
Req *restfile.Request
Env vars.ResolvedEnv
Base string
Vars map[string]string
Response *rtshost.Response
Stream *rtshost.Stream
Locals rts.Locals
// contains filtered or unexported fields
}
ExprInput contains the request data available to a {{= expr }} expression.
type ForEachSpec ¶
type RunDoc ¶ added in v1.15.0
RunDoc is a document as one run reads it. A run makes one where it starts and passes it on, so its positions in Doc share one File and the text it read.
type RunScope ¶ added in v1.9.0
RunScope carries workflow and loop values, plus run values already fixed.
type SecretSources ¶ added in v1.2.0
type SecretSources struct {
Doc *restfile.Document
Req *restfile.Request
Env vars.ResolvedEnv
FilePath string
Files *rtrun.Files
Globals *rtrun.Globals
Extra []string
}
SecretSources collects values that must be redacted from run output.
func (SecretSources) Secrets ¶ added in v1.2.0
func (s SecretSources) Secrets() []string