Documentation
¶
Overview ¶
Package redact hides the secret fields of payloads before the console sees them: the input and output of hooks, activities and workflows and the payloads of events, by the schemas their manifests declare, and the inputs of binding steps by the schemas the compiler derives from what their expressions read.
Masking is for display. It changes JSON text going to the console and nothing stored: Temporal history, NATS streams and the services' own logs hold the payloads as they were.
Index ¶
Constants ¶
const Hidden = "***"
Hidden replaces a secret value.
Variables ¶
This section is empty.
Functions ¶
func All ¶
All is data hidden whole: Hidden as a JSON string. Empty stays empty: there was nothing to show.
func EventSchema ¶
EventSchema is the schema of an event, nil when the catalog has none.
Types ¶
type Catalog ¶
type Catalog interface {
Hook(full string) (*backplanev1.Hook, bool)
Activity(full string) (*backplanev1.Activity, bool)
Event(full string) (*backplanev1.Event, bool)
Workflow(full string) (*backplanev1.Workflow, bool)
}
Catalog resolves full names ("<service>.<Name>") to what the manifests declare: the schemas payloads are masked by.
type History ¶
type History struct {
// contains filtered or unexported fields
}
History masks the payloads of one run's history as it is read, in order: the start tells what the run is — a binding or rule run with its program, a hook call, an activity run, a declared workflow — and each scheduled call what its result is masked by. Payloads come and go as the console's JSON text: envelopes (HookCall, ActivityCall and their results) with their payload unwrapped to the JSON it carries.
func NewHistory ¶
NewHistory is the masker of one run; cat may be nil when only binding runs are read.
func (*History) Completed ¶
Completed takes the result of the call scheduled by id and is it masked.
func (*History) Nexus ¶
Nexus takes the input of a Nexus operation event id schedules — a hook call from a service's workflow — and is it masked.
func (*History) Result ¶
Result is the run's result masked: a HookResult or ActivityResult envelope's payload, or a declared workflow's own JSON.
type Manifests ¶
type Manifests func(service string) *backplanev1.Manifest
Manifests is a Catalog over the latest manifest of each service (nil: none).
func (Manifests) Activity ¶
func (m Manifests) Activity(full string) (*backplanev1.Activity, bool)
Activity implements Catalog.
func (Manifests) Event ¶
func (m Manifests) Event(full string) (*backplanev1.Event, bool)
Event implements Catalog.
type Program ¶
type Program struct {
// contains filtered or unexported fields
}
Program is what the console needs of a compiled binding or rule to mask its run: the schemas the compiler derived for the input, every step's calls and the result. It reads the program's serialized form (the workflow's input), so a run masks by the definition it ran, whatever the manifests say now.
func ParseProgram ¶
ParseProgram reads a marshaled program; a program that does not read has no steps and masks nothing.
func (*Program) MaskResult ¶
MaskResult is the hook's answer masked.
type Step ¶
type Step struct {
Name string
Activity string
Kind backplanev1.ActivityKind
// Parent is the path of the for-each steps the step is in, "a/b"; ""
// at the top.
Parent string
// contains filtered or unexported fields
}
Step is one step of a program with its masks.
func (*Step) MaskOutput ¶
MaskOutput is the step's activity output masked.