temporalio / temporalio/cli

[Bug] Unable to set multiple grpc-meta in the env config

Open
#774 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
Go
Stars
379
Forks
103
Avg merge
2d 11h
Merged PRs (30d)
23

Description

What are you really trying to do?

Similar to how the web UI uses the authorization and authorization-extras headers, I'd like to be able to pass these via the temporal CLI.

I'd like to add these headers (grpc-meta) in the temporal env config file to simplify CLI invocation, e.g.

temporal operator namespace list \
  --grpc-meta "authorization=${AUTHORIZATION}" \
  --grpc-meta "authorization-extras=${AUTHORIZATION_EXTRAS}" \
  --address temporal.example.com \
  --tls

and the command succeeds as expected when valid auth headers are supplied.

Describe the bug

The temporal env command clobbers existing values when setting grpc-meta and it's not clear how to manually edit the YAML file to set them either.

Minimal Reproduction

temporal env set --env=example --key=grpc-meta --value="authorization=${AUTHORIZATION} authorization-extras=${AUTHORIZATION_EXTRAS}"

env:
  example:
    grpc-meta: authorization=Bearer xxx.yyy.zzz authorization-extras=REDACTED

However this doesn't work, the ClientOptions.GrpcMeta according to my debugger has a value like:

map[authorization:Bearer xxx.yyy.zzz authorization-extras=REDACTED]

i.e. a map[string]string but the key is authorization and the value is all the other grpc-meta values I'm trying to populate from the config.

Environment/Versions
  • OS and processor: M1 Mac
  • Temporal Version: 1.3.0
  • Are you using Docker or Kubernetes or building Temporal from source? Temporal CLI install from homebrew

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the issue with temporal env set --env=example --key=grpc-meta and trace how the env configuration is loaded into ClientOptions.GrpcMeta. Confirm that multiple metadata entries are parsed as separate key-value pairs rather than one key with a combined value; done means both authorization headers work from the env config.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
cli
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
50/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.