temporal-proxy

module
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Aug 3, 2026 License: MIT

README

Temporal Proxy (Pre-release)

ci codecov Go Reference release license

A gRPC proxy that sits between Temporal SDK Clients, Workers, and the Temporal UI on one side and one or more upstream Temporal Services on the other. It handles Namespace translation, TLS termination, and payload encryption so applications can target a single local endpoint while the proxy fans requests out to the right upstream (a local dev Temporal Service, a self-hosted deployment, Temporal Cloud, or some mix).

[!NOTE]

Pre-release: This project is under active development and evolving quickly. It is not ready for production use. Open a GitHub issue if you have questions or want to follow along.

Why

Connection details leak into application code. Every Worker and Client has to know the upstream's host, TLS material, credentials, and the exact Namespace name the upstream expects. That couples your code to an environment and makes moving between a local Temporal Service, a self-hosted deployment, and Temporal Cloud a code change.

The proxy pulls that concern out. Workers talk plaintext to a single local endpoint using a short Namespace name; the proxy owns TLS, credentials, and Namespace translation on the way out. Point a Worker at a different Namespace and it reaches a different upstream with no change to the Worker.

How

  flowchart LR
    Worker[Worker]
    Client[SDK Client]
    UI[Web UI]

    subgraph Proxy[Temporal Proxy]
        direction LR
        Gateway["Gateway<br/>routes by Namespace<br/>codec-transparent (no payload parsing)"]
        ProxyA["Per-upstream proxy A<br/>Namespace translation<br/>payload encryption (optional)"]
        ProxyB["Per-upstream proxy B<br/>Namespace translation<br/>payload encryption (optional)"]
        Gateway -->|unix socket| ProxyA
        Gateway -->|unix socket| ProxyB
    end

    Cloud[Temporal Cloud]
    SelfHosted[Self-hosted Temporal Service]

    Worker --> Gateway
    Client --> Gateway
    UI --> Gateway
    ProxyA --> Cloud
    ProxyB --> SelfHosted

Features

  • Rule-based routing. Route requests to different upstreams by Namespace and/or request metadata, with a system upstream for Namespace-less calls and a default fallback.
  • Namespace translation. Rewrite local Namespace names to the names an upstream expects (prefix, suffix, or explicit overrides) in both requests and responses.
  • TLS termination and outbound credentials. Terminate inbound TLS/mTLS and attach the upstream's own TLS and credentials (API key or mTLS), so client code carries none of it.
  • Payload encryption. Optionally seal payloads with envelope encryption on the hop to an upstream and open them on responses, so the upstream only ever sees ciphertext while local Workers keep exchanging cleartext. DEKs are wrapped by a KMS key (AWS KMS, Azure Key Vault, or GCP KMS), rotate automatically, and can be overridden per Namespace.
  • Pluggable key management. For a backend the proxy has no built-in support for, such as an on-prem HSM or an internal key service, point it at an extension server you run and it wraps DEKs through that instead. Only key material is exchanged; payloads never reach it.
  • Inbound authentication. Optional static-token or JWKS validation on the gateway; off by default. For an identity system neither covers, delegate the decision to an extension server you run and it admits or refuses each caller.
  • Codec-transparent. The gateway never parses payloads. It peeks the Namespace, picks an upstream, and relays raw frames in both directions.
  • Multiple deployment options. Ship as a Go binary, a container image, or a Helm chart.

Installation

Go

Install the proxy binary into your $GOBIN with go install:

go install github.com/temporalio/temporal-proxy/cmd/proxy@latest

@latest resolves to the newest stable release. Pin an explicit version from the releases page if you prefer:

go install github.com/temporalio/temporal-proxy/cmd/proxy@vX.Y.Z
Container image

Images are published to Docker Hub:

docker pull temporalio/temporal-proxy:latest
Helm

A chart is published to the Temporal Helm repo at https://go.temporal.io/helm-charts:

# Latest stable release
helm install temporal-proxy temporal-proxy \
  --repo https://go.temporal.io/helm-charts

# Or pin a specific proxy version (see the releases page)
helm install temporal-proxy temporal-proxy \
  --repo https://go.temporal.io/helm-charts \
  --set image.tag=vX.Y.Z

Each chart release deploys a proxy version by default; --set image.tag overrides it to pin a specific one.

Supply the proxy config under the config: key in a values file and pass it with -f:

# values.yaml
config:
  hostPort: :7233
  upstreams:
    - name: local
      hostPort: localhost:7234
  routing:
    default: local
helm install temporal-proxy temporal-proxy \
  --repo https://go.temporal.io/helm-charts \
  -f values.yaml

See the chart README for the full set of options.

Get started

The Temporal Cloud example is the quickest way to see the proxy in action: a Worker and starter that carry no Cloud configuration talk plaintext to localhost:7233, and the proxy adds TLS, the API key, and the Namespace rewrite on the way to Cloud. Follow its README to run it end to end.

The KMS extension server example shows the pluggable key management path end to end: a local dev server, a key provider you run, and workflow payloads that the Temporal Service only ever stores as ciphertext.

Terms

Term Meaning
gateway The single inbound gRPC endpoint that every SDK Client, Worker, and the UI connects to. It routes each request to an upstream by Namespace and/or request metadata, and never parses payloads.
upstream A configured destination the proxy forwards to: a Temporal Service (local dev, self-hosted, or Temporal Cloud), or another Temporal Proxy.
system upstream The upstream that handles Namespace-less requests, such as the SDK's GetSystemInfo call on connect.
extension server A gRPC service you run that the proxy calls out to for a capability it has no built-in backend for. Today that means wrapping DEKs as a key management backend.
Temporal Service A Temporal frontend the proxy connects to.

Development

See .github/CONTRIBUTING.md for the dev loop. The common entry points are mise run test, mise run lint, and mise run format.

Security

See SECURITY.md for how to report vulnerabilities.

License

MIT, see LICENSE.

Directories

Path Synopsis
cmd
proxy command
Package e2e contains black-box, full-stack integration tests that drive the proxy the way production does: a client through the inbound server, router, per-upstream proxy, and out to a fake upstream.
Package e2e contains black-box, full-stack integration tests that drive the proxy the way production does: a client through the inbound server, router, per-upstream proxy, and out to a fake upstream.
internal
api
Package api reaches the extension servers an operator runs: gRPC services implementing one of the contracts published under api/, currently api.kms.v1.EncryptionService and api.auth.v1.AuthService.
Package api reaches the extension servers an operator runs: gRPC services implementing one of the contracts published under api/, currently api.kms.v1.EncryptionService and api.auth.v1.AuthService.
auth
Package auth authenticates requests arriving at the proxy.
Package auth authenticates requests arriving at the proxy.
auth/outbound
Package outbound presents the proxy's own credentials on connections it dials.
Package outbound presents the proxy's own credentials on connections it dials.
config
Package config loads and validates the proxy YAML configuration.
Package config loads and validates the proxy YAML configuration.
kms
Package kms wires the proxy's encryption configuration into a running crypto.Vault.
Package kms wires the proxy's encryption configuration into a running crypto.Vault.
metrics
Package metrics wires Prometheus metrics into the proxy.
Package metrics wires Prometheus metrics into the proxy.
protoutil
Package protoutil provides helpers for working with Temporal's protobuf request types at the gRPC boundary, without the caller needing to know the concrete message type for a given method.
Package protoutil provides helpers for working with Temporal's protobuf request types at the gRPC boundary, without the caller needing to know the concrete message type for a given method.
proxy
Package proxy serves the Temporal WorkflowService on a local unix socket, forwarding every request to an upstream Temporal frontend over gRPC.
Package proxy serves the Temporal WorkflowService on a local unix socket, forwarding every request to an upstream Temporal frontend over gRPC.
router
Package router transparently forwards inbound gRPC traffic to an upstream connection without decoding it.
Package router transparently forwards inbound gRPC traffic to an upstream connection without decoding it.
template
Package template renders the templated fields used by the proxy against per-request values.
Package template renders the templated fields used by the proxy against per-request values.
transport/connect
Package connect manages a pool of reusable gRPC client connections keyed by a caller-supplied logical key, distinct from the dial target.
Package connect manages a pool of reusable gRPC client connections keyed by a caller-supplied logical key, distinct from the dial target.
transport/creds
Package creds resolves TLS transport credentials for Temporal proxy connections from a small set of options.
Package creds resolves TLS transport credentials for Temporal proxy connections from a small set of options.
transport/meta
Package meta defines the internal gRPC metadata contract carried between the router and the per-upstream proxy: the router stamps the request namespace it already extracted so the proxy can resolve a templated upstream address without parsing the payload again.
Package meta defines the internal gRPC metadata contract carried between the router and the per-upstream proxy: the router stamps the request namespace it already extracted so the proxy can resolve a templated upstream address without parsing the payload again.
transport/socket
Package socket defines the addressing contract for the proxy's local unix socket.
Package socket defines the addressing contract for the proxy's local unix socket.
pkg
api
crypto
Package crypto implements envelope encryption.
Package crypto implements envelope encryption.
logger
Package logger provides a small, leveled, structured logging interface for the proxy along with a zerolog-backed implementation and a no-op implementation for tests.
Package logger provides a small, leveled, structured logging interface for the proxy along with a zerolog-backed implementation and a no-op implementation for tests.
logger/tag
Package tag provides typed key/value pairs used to attach structured context to log entries.
Package tag provides typed key/value pairs used to attach structured context to log entries.
match
Package match implements the simple glob matching used by routing rules to compare namespaces and metadata values.
Package match implements the simple glob matching used by routing rules to compare namespaces and metadata values.
testutil
Package testutil provides helpers and utilities to make testing easier and less tedious.
Package testutil provides helpers and utilities to make testing easier and less tedious.
validation
Package validation provides structured error primitives plus a small rule-based API for accumulating validation failures.
Package validation provides structured error primitives plus a small rule-based API for accumulating validation failures.
validation/certs
Package certs provides reusable validation.Check building blocks for inspecting X.509 certificates and PEM material: expiry, CA basic constraint, signature-algorithm and key-type strength, and key size.
Package certs provides reusable validation.Check building blocks for inspecting X.509 certificates and PEM material: expiry, CA basic constraint, signature-algorithm and key-type strength, and key size.

Jump to

Keyboard shortcuts

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