@@ -41,9 +41,9 @@ Temporal Service. Common reasons to run a Codec Server include:
4141- ** Operating from the CLI.** Use commands like ` temporal workflow show ` and ` temporal workflow execute ` with readable
4242 data, even when payloads are encrypted at rest.
4343- ** Encoding inputs from the UI and CLI.** When you start or signal a Workflow from the Web UI or CLI, the Codec Server
44- can encode the input before it reaches the Temporal Service, so the Temporal Service never sees
45- plaintext (the input still travels from your browser or CLI to the Codec Server, which is why HTTPS
46- matters in any non-loopback deployment).
44+ can encode the input before it reaches the Temporal Service, so the Temporal Service never sees plaintext (the input
45+ still travels from your browser or CLI to the Codec Server, which is why HTTPS matters in any non-loopback
46+ deployment).
4747- ** Compliance and access control.** Because the Codec Server runs in your environment, you control who can decode
4848 payloads and under what conditions. You can layer authorization on top of the decode endpoint to restrict access per
4949 user or per Namespace.
@@ -76,8 +76,8 @@ The `/encode` endpoint works in the other direction. When you start a Workflow o
7676the input is sent to the Codec Server's ` /encode ` endpoint first, so data reaches the Temporal Service in its encoded
7777form.
7878
79- decoding. Because the Codec Server often holds the same keys as your Workers, treat its
80- host with the same trust as a Worker; anyone who can call it has effective decrypt parity .
79+ Your Codec Server should use the same Payload Codec implementation as your Workers to ensure consistent encoding and
80+ decoding .
8181
8282## Codec Server vs. Payload Codec
8383
@@ -96,13 +96,41 @@ CLI can use it remotely.
9696
9797## Securing a Codec Server
9898
99- Access to a Codec Server should be restricted because it can decode sensitive data. Common approaches include:
99+ Because a Codec Server can decode sensitive data, treat it with the same trust as a Worker. Anyone who can call it has
100+ effective decrypt access. Use HTTPS for any deployment that is not strictly loopback (` localhost ` ).
100101
101- - ** Network-level restrictions.** Run the Codec Server on ` localhost ` or behind a VPN. The Web UI can communicate with a
102- Codec Server that is only accessible locally.
103- - ** Token-based authorization.** Integrate your organization's authentication provider (OAuth, Auth0, or similar).
104- Temporal Cloud can pass access tokens (JWT) to your Codec Server with each request. Verify these tokens against the
105- [ Temporal Cloud JWKS endpoint] ( https://login.tmprl.cloud/.well-known/jwks.json ) .
102+ ### Network-level restrictions
103+
104+ Restrict network access to the Codec Server. The Web UI can communicate with a Codec Server that is only accessible on
105+ ` localhost ` , so running the Codec Server locally is a viable security pattern. For team access, place the Codec Server
106+ behind a VPN.
107+
108+ ### Authentication
109+
110+ When the Codec Server is accessible beyond ` localhost ` , authenticate requests to verify the identity of the caller. The
111+ Web UI supports two approaches:
112+
113+ ** Include cross-origin credentials (recommended).** Enable ** Include cross-origin credentials** in the Web UI Codec
114+ Server settings. The browser sends cookies scoped to the Codec Server's domain with each request. Your Codec Server must
115+ have its own authentication mechanism (its own login page and session cookies), so the user must have independently
116+ authenticated with the Codec Server. This is the recommended approach because the Codec Server maintains its own auth
117+ boundary, separate from the Temporal UI.
118+
119+ ** Pass access token.** Enable ** Pass access token** in the Web UI Codec Server settings. The Web UI includes the same
120+ JWT the user used to log into the Temporal UI in the ` Authorization ` header of each request. Your Codec Server validates
121+ the token signature against the OIDC provider's JWKS endpoint. On Temporal Cloud, verify against the
122+ [ Temporal Cloud JWKS endpoint] ( https://login.tmprl.cloud/.well-known/jwks.json ) . On a self-hosted Temporal Service, the
123+ token comes from whatever auth provider you have [ configured for the Web UI] ( /references/web-ui-configuration#auth ) .
124+ This approach requires less setup but reuses the same token across the Temporal UI and the Codec Server.
125+
126+ ### Namespace-level authorization
127+
128+ Authentication identifies the caller, but does not confirm the caller is authorized to decode payloads for a specific
129+ Namespace. Each request from the Web UI includes an ` X-Namespace ` header identifying the Namespace. To enforce
130+ Namespace-level access control, your Codec Server must enforce an additional check on whether the authenticated user has
131+ permissions for the requested Namespace. This applies regardless of which authentication approach you use.
132+
133+ ### Key management
106134
107135You may also need [ key management infrastructure] ( /key-management ) to share encryption keys between your Workers and the
108136Codec Server.
0 commit comments