Help us shape the future of Go! Take the 2026 Go Developer Survey

temporal

package
v0.4.2 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2026 License: Apache-2.0 Imports: 29 Imported by: 0

Documentation

Overview

SPDX-License-Identifier: Apache-2.0 Copyright 2026 The Karakoram Authors

SPDX-License-Identifier: Apache-2.0 Copyright 2026 The Karakoram Authors

SPDX-License-Identifier: Apache-2.0 Copyright 2026 The Karakoram Authors

SPDX-License-Identifier: Apache-2.0 Copyright 2026 The Karakoram Authors

SPDX-License-Identifier: Apache-2.0 Copyright 2026 The Karakoram Authors

SPDX-License-Identifier: Apache-2.0 Copyright 2026 The Karakoram Authors

SPDX-License-Identifier: Apache-2.0 Copyright 2026 The Karakoram Authors

SPDX-License-Identifier: Apache-2.0 Copyright 2026 The Karakoram Authors

SPDX-License-Identifier: Apache-2.0 Copyright 2026 The Karakoram Authors

SPDX-License-Identifier: Apache-2.0 Copyright 2026 The Karakoram Authors

Index

Constants

View Source
const ConfigSecretPrefix = "temporal/config/"

ConfigSecretPrefix stores full agent envelopes, including credentials. The cluster CA uses tls/ca.crt and tls/ca.key for the shared agent dialer. Leaf pairs are sealed at temporal/{agent,internode,frontend}-cert/<member>.

View Source
const FrontendServerName = "frontend.temporal.karakoram.internal"

FrontendServerName is the stable serving identity verified by UI and SDK clients.

View Source
const InternalStateKey = "temporal"

InternalStateKey journals component identities, binding ownership and ordered upgrades in Cluster.Internal. It never holds private keys or passwords.

View Source
const InternodeServerName = "internode.temporal.karakoram.internal"

InternodeServerName is the shared SAN for role-to-role mutual TLS.

View Source
const UIOIDCClientSecretKey = "temporal/ui-oidc-client-secret"

UIOIDCClientSecretKey stores the write-only UI OIDC secret in SecretStore. Updating this key triggers configuration publication on the next Sync.

Variables

This section is empty.

Functions

This section is empty.

Types

type Access

type Access interface {
	// IssueClientCertificate signs a client certificate (CN = commonName, ttl
	// 1h–397d) from the cluster CA and records only its non-secret metadata.
	IssueClientCertificate(ctx context.Context, rc *engine.Context, commonName string, ttl time.Duration) (IssuedClientCertificate, error)
	ListClientCertificates(ctx context.Context, rc *engine.Context) ([]ClientCertificate, error)
	// ListNamespaces reads namespaces through a Ready frontend member.
	ListNamespaces(ctx context.Context, rc *engine.Context) ([]Namespace, error)
	// DeleteNamespace requests asynchronous deletion; "default" and namespaces
	// still declared in engineOptions.namespaces are refused (conflict).
	DeleteNamespace(ctx context.Context, rc *engine.Context, name string) error
	// SetUIOIDCClientSecret seals the write-only Web UI OIDC client secret.
	SetUIOIDCClientSecret(ctx context.Context, rc *engine.Context, secret string) error
}

Access is the Temporal-specific API surface the HTTP server calls on the provider (internal/server/temporal.go).

type ClientCertificate

type ClientCertificate struct {
	Serial            string    `json:"serial"`
	CommonName        string    `json:"commonName"`
	FingerprintSHA256 string    `json:"fingerprintSha256"`
	IssuedAt          time.Time `json:"issuedAt"`
	NotAfter          time.Time `json:"notAfter"`
	// CAFingerprintSHA256 identifies the issuing CA; certificates of a rotated CA are invalid.
	CAFingerprintSHA256 string `json:"caFingerprintSha256"`
	// CurrentCA is derived on read, never persisted. During rotate-tls, current
	// means the CA used to issue new client certificates now: the old CA during
	// trust staging, then the new CA once the signing CA switches, even while
	// both CAs remain trusted during the rolling transition.
	CurrentCA bool `json:"currentCa"`
}

ClientCertificate is the retained, non-secret record of an issued client certificate. Private keys are never stored.

type EngineOptions

type EngineOptions struct {
	Persistence struct {
		Postgres PostgresOptions `json:"postgres"`
	} `json:"persistence"`
	HistoryShards int `json:"historyShards"`
	Frontend      struct {
		RequireClientAuth bool `json:"requireClientAuth"`
	} `json:"frontend"`
	Namespaces []tspec.Namespace `json:"namespaces,omitempty"`
	UI         struct {
		PublicHTTPS bool         `json:"publicHttps"`
		OIDC        *OIDCOptions `json:"oidc,omitempty"`
	} `json:"ui"`
}

EngineOptions contains non-secret Temporal cluster configuration.

func ParseOptions

func ParseOptions(raw json.RawMessage) (EngineOptions, error)

ParseOptions rejects unknown fields, including write-only OIDC credentials.

type IssuedClientCertificate

type IssuedClientCertificate struct {
	ClientCertificate
	CertificatePEM string `json:"certificatePem"`
	PrivateKeyPEM  string `json:"privateKeyPem"`
	CAPEM          string `json:"caPem"`
	// FrontendAddress and ServerName are what an SDK client needs to connect.
	FrontendAddress string `json:"frontendAddress"`
	ServerName      string `json:"serverName"`
}

IssuedClientCertificate is returned exactly once by IssueClientCertificate.

type Namespace

type Namespace struct {
	Name        string `json:"name"`
	Retention   string `json:"retention"`
	Description string `json:"description,omitempty"`
	State       string `json:"state"`
	// Managed is true when engineOptions.namespaces declares it (or it is "default").
	Managed bool `json:"managed"`
}

Namespace is an observed Temporal namespace as exposed by the API.

type OIDCOptions

type OIDCOptions struct {
	Issuer   string `json:"issuer"`
	ClientID string `json:"clientId"`
}

OIDCOptions identifies the issuer and client; the secret is sealed separately.

type Options

type Options struct {
	ControlPlaneURL, InternalCAPEM string
	Store                          *store.Store
	Logger                         *slog.Logger
	Bindings                       pgbinding.Service
}

Options supplies PostgreSQL binding and member runtime dependencies.

type PostgresOptions

type PostgresOptions struct {
	Cluster            string `json:"cluster"`
	Namespace          string `json:"namespace,omitempty"`
	Database           string `json:"database,omitempty"`
	VisibilityDatabase string `json:"visibilityDatabase,omitempty"`
}

PostgresOptions identifies the immutable source and bound database names.

type Provider

type Provider struct {
	// contains filtered or unexported fields
}

Provider reconciles Temporal components and their bound PostgreSQL stores.

func New

func New(o Options) *Provider

New constructs a Temporal provider. Nil bindings reject cluster admission.

func (*Provider) ApplyDefaults

func (p *Provider) ApplyDefaults(s *domain.ClusterSpec)

ApplyDefaults fills absent topology, component, TLS and engine option settings.

func (*Provider) CanClaimOperation

func (*Provider) CanClaimOperation(c *domain.Cluster) (bool, error)

CanClaimOperation defers new maintenance while lifecycle or recovery owns runtimes.

func (*Provider) Cleanup

func (p *Provider) Cleanup(ctx context.Context, rc *engine.Context, opts domain.DeleteOptions) (done bool, err error)

Cleanup removes runtimes before releasing bound databases and sealed credentials.

func (*Provider) DeleteNamespace

func (*Provider) DeleteNamespace(ctx context.Context, rc *engine.Context, name string) error

DeleteNamespace requests deletion only for non-reserved, unmanaged namespaces.

func (*Provider) Describe

func (p *Provider) Describe() domain.ProviderInfo

Describe publishes the locked version catalog, topology bounds and presets.

func (*Provider) IssueClientCertificate

func (p *Provider) IssueClientCertificate(ctx context.Context, rc *engine.Context, cn string, ttl time.Duration) (IssuedClientCertificate, error)

IssueClientCertificate returns a client identity once and journals public metadata.

func (*Provider) ListClientCertificates

func (*Provider) ListClientCertificates(ctx context.Context, rc *engine.Context) ([]ClientCertificate, error)

ListClientCertificates returns metadata; CA fingerprint mismatch marks invalidation.

func (*Provider) ListNamespaces

func (*Provider) ListNamespaces(ctx context.Context, rc *engine.Context) ([]Namespace, error)

ListNamespaces reports observed namespaces and whether options manage them.

func (*Provider) MemberConfig

func (p *Provider) MemberConfig(ctx context.Context, rc *engine.Context, name string) (agentapi.MemberConfig, error)

MemberConfig returns a sealed, secret-bearing envelope for a known member.

func (*Provider) Name

func (*Provider) Name() string

Name identifies this provider in cluster specs and agent configuration.

func (*Provider) RequiredCapabilities

func (*Provider) RequiredCapabilities(s domain.ClusterSpec) []string

RequiredCapabilities declares public HTTPS and horizontal-scaling requirements.

func (*Provider) RunOperation

func (p *Provider) RunOperation(ctx context.Context, rc *engine.Context, op *domain.Operation) (result engine.OpResult, err error)

RunOperation advances checkpointed restart, CA rotation, backup and restore work.

func (*Provider) SetUIOIDCClientSecret

func (*Provider) SetUIOIDCClientSecret(ctx context.Context, rc *engine.Context, secret string) error

SetUIOIDCClientSecret seals a write-only secret for the next configuration roll.

func (*Provider) Status

Status observes component health and publishes password-free binding metadata.

func (*Provider) Sync

func (p *Provider) Sync(ctx context.Context, rc *engine.Context) (result engine.Result, err error)

Sync converges bindings, runtime recovery, ordered components and namespaces.

func (*Provider) SyncDuringOperation

func (*Provider) SyncDuringOperation(*domain.Operation) bool

SyncDuringOperation keeps imperative maintenance exclusive of normal convergence.

func (*Provider) Validate

func (p *Provider) Validate(_ context.Context, old, next *domain.Cluster) error

Validate checks locked artifacts, component topology and immutable options.

func (*Provider) ValidateBackend

func (*Provider) ValidateBackend(backend infra.Backend) error

ValidateBackend checks the private networking required by Temporal membership.

Directories

Path Synopsis
Package tspec defines the secret-bearing Temporal member contract shared by the control plane and the member agent.
Package tspec defines the secret-bearing Temporal member contract shared by the control plane and the member agent.

Jump to

Keyboard shortcuts

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