workflow

package
v1.18.0-rc.2 Latest Latest
Warning

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

Go to latest
Published: May 5, 2026 License: Apache-2.0 Imports: 17 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ActivityCompletionAttestations added in v1.18.0

func ActivityCompletionAttestations(t *testing.T, ctx context.Context, db *sqlite.SQLite, instanceID string) []*protos.ActivityCompletionAttestation

ActivityCompletionAttestations returns every ActivityCompletionAttestation present on Task{Completed,Failed} events stored in the given workflow instance's history.

func AssertSignerCertificateStripped added in v1.18.0

func AssertSignerCertificateStripped(t *testing.T, ctx context.Context, db *sqlite.SQLite, instanceID string)

AssertSignerCertificateStripped verifies that no completion events in the given workflow instance's history still carry a signerCertificate companion field. The companion is wire-only - it must always be cleared before persisting the event so the cert lives only once in ext-sigcert.

func CertificateCount added in v1.18.0

func CertificateCount(t *testing.T, ctx context.Context, db *sqlite.SQLite, instanceID string) int

CertificateCount returns the number of signing certificate entries stored for the given workflow instance.

func ChildCompletionAttestations added in v1.18.0

func ChildCompletionAttestations(t *testing.T, ctx context.Context, db *sqlite.SQLite, instanceID string) []*protos.ChildCompletionAttestation

ChildCompletionAttestations returns every ChildCompletionAttestation present on ChildWorkflowInstance{Completed,Failed} events stored in the given workflow instance's history.

func CountHistoryEventsOfType

func CountHistoryEventsOfType[T any](t *testing.T, ctx context.Context, client *client.TaskHubGrpcClient, id api.InstanceID) int

func ExtSigCertCount added in v1.18.0

func ExtSigCertCount(t *testing.T, ctx context.Context, db *sqlite.SQLite, instanceID string) int

ExtSigCertCount returns the number of external (foreign) signing certificate entries (ext-sigcert-NNNNNN keys) stored for the given workflow instance. Foreign certs are absorbed on inbox ingestion of completion events that carry attestations from child workflows and activities.

func GetLastHistoryEventOfType

func GetLastHistoryEventOfType[T any](t *testing.T, ctx context.Context, client *client.TaskHubGrpcClient, id api.InstanceID) *protos.HistoryEvent

func HistoryCount added in v1.18.0

func HistoryCount(t *testing.T, ctx context.Context, db *sqlite.SQLite, instanceID string) int

HistoryCount returns the number of history entries stored for the given workflow instance.

func MutateMetadata added in v1.18.0

func MutateMetadata(t *testing.T, ctx context.Context, db *sqlite.SQLite, instanceID string, mutate func(*backend.BackendWorkflowStateMetadata))

MutateMetadata loads the persisted BackendWorkflowStateMetadata for the given workflow instance, applies the mutation, and writes it back. Used by negative tests that simulate state store tampering.

func ReadExtSigCerts added in v1.18.0

func ReadExtSigCerts(t *testing.T, ctx context.Context, db *sqlite.SQLite, instanceID string) []*protos.ExternalSigningCertificate

ReadExtSigCerts reads and unmarshals all ExternalSigningCertificate entries for the given workflow instance.

func ReadHistoryEvents added in v1.18.0

func ReadHistoryEvents(t *testing.T, ctx context.Context, db *sqlite.SQLite, instanceID string) []*protos.HistoryEvent

ReadHistoryEvents reads and unmarshals all stored history events for the given workflow instance, preserving state-store order.

func SignatureCount added in v1.18.0

func SignatureCount(t *testing.T, ctx context.Context, db *sqlite.SQLite, instanceID string) int

SignatureCount returns the number of signature entries stored for the given workflow instance. Use this in tests to verify signing happened or did not happen, instead of calling CountStateKeys directly with a raw key prefix string (which is error-prone).

func VerifyCertAppID added in v1.18.0

func VerifyCertAppID(t *testing.T, ctx context.Context, db *sqlite.SQLite, instanceID, expectedAppID string)

VerifyCertAppID checks that all signing certificates for a workflow instance contain a SPIFFE ID matching the expected app ID in the "default" namespace, and that each certificate has a 2-deep chain (leaf + issuer intermediate).

func VerifySignatureChain added in v1.18.0

func VerifySignatureChain(t *testing.T, ctx context.Context, db *sqlite.SQLite, instanceID string, trustAnchors []byte)

VerifySignatureChain verifies the full history signature chain for a workflow instance, including cryptographic signatures and certificate chain-of-trust against the given trust anchors.

func WaitForRuntimeStatus

func WaitForRuntimeStatus(t *testing.T, ctx context.Context, client *client.TaskHubGrpcClient, id api.InstanceID, status protos.OrchestrationStatus)

func WaitForWorkflowStartedEvent added in v1.18.0

func WaitForWorkflowStartedEvent(t *testing.T, ctx context.Context, client *client.TaskHubGrpcClient, id api.InstanceID)

Types

type SigningData added in v1.18.0

type SigningData struct {
	// RawSignatures are the raw serialized bytes of each HistorySignature
	// as stored. Required for digest computation in chain verification.
	RawSignatures [][]byte
	// Signatures are the parsed HistorySignature protos.
	Signatures []*protos.HistorySignature
	// Certs are the signing certificates.
	Certs []*protos.SigningCertificate
	// RawEvents are the raw serialized bytes of each history event as stored.
	RawEvents [][]byte
}

SigningData holds signatures, certificates, and raw history events for a workflow instance, loaded from the state store for verification.

func UnmarshalSigningData added in v1.18.0

func UnmarshalSigningData(t *testing.T, ctx context.Context, db *sqlite.SQLite, instanceID string) SigningData

UnmarshalSigningData reads and unmarshals signatures, certificates, and raw history events from the SQLite state store for the given workflow instance.

Jump to

Keyboard shortcuts

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