Refreshing authorization token in worker

Hi guys,
I have a question about how to handle token refresh in an authoring scenario when making a Worker Activity.

Use case:
I need to send an “authorization” header in the GRPC request, a bearer token for example, and I can refresh it whenever I want without creating a new Worker Activity

client = await Client.connect(
    target_url=target_url,
    namespace=namespace,
    tls_config=tls_config,
    rpc_metadata={"authorization": "Bearer eyJra.."},
    runtime=runtime,
)

worker = Worker(
    client,
    task_queue=task_queue,
    activities={"say-hello-activity": say_hello_activity}
)

Currently I am passing the token client.rpc_metadata='Authorization': 'Bearer token' and handling the refresh logic. But even when the token is updated , workers are failing to authenticate.

You can set the rpc_metadata property of the client which is built to update the underlying client on set (do not mutate the mapping returned from the property, just reset to a new dict, see the API doc).