Roey Berman

Results 164 comments of Roey Berman

To set static headers use https://typescript.temporal.io/api/interfaces/client.ConnectionOptions#metadata and https://typescript.temporal.io/api/interfaces/worker.NativeConnectionOptions#metadata. Client and Connection objects expose a [`withMetadata`](https://typescript.temporal.io/api/classes/client.Connection#withmetadata) helper that can be used to set metadata in an async context. NativeConnection exposes [`setMetadata`](https://typescript.temporal.io/api/classes/worker.NativeConnection#setmetadata)...

Interceptors don't manipulate gRPC headers, they manipulate the persisted headers in workflow history like [this one](https://github.com/temporalio/api/blob/5f21c72de0ec9e6037e84c95f097641b71d7c39f/temporal/api/history/v1/message.proto#L98). Interceptors in workflows are also subject to deterministic constraints and run inside the sandbox....

> Put the token into the grpc header when executing activities You don't have this level of control from a workflow, you'll need to use the built-in Temporal headers to...

I think you're approaching it the wrong way. Workers require permissions to poll and complete activity and workflow tasks. They can't operate without the ability to access these APIs. Often,...

They can't be different, a worker uses the token to poll on and complete tasks for activities and workflows. There's only one token that can be used per worker, there's...

Yes, the connection may be kept alive for a long time. If you need to refresh the token use the https://typescript.temporal.io/api/classes/worker.NativeConnection#setmetadata method.

If the worker cannot communicate with the server for over a minute it will shut itself down with an exception. You should avoid this and handle token refresh externally, unfortunately...

I will find some time to properly respond to this.

What I've seen other companies do is the following: 1. A client starts a workflow using a token passed via either gRPC or Temporal headers 2. A custom authorizer on...

Apologies for the late response, I was on PTO.