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

Offen
#774 2 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Maintainer antworten meist innerhalb von 1 Tag

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
3/5
Geschätzter Aufwand
1-2 Tage
Anfängerfreundlichkeit
50/100
Issue-Typ
Bug
Klarheit
Größtenteils klar
Aktivitätsstatus
Veraltet
Tech-Stack
go
Bereich
cli

Rechercherichtung

Beginne damit, das Problem mit temporal env set --env=example --key=grpc-meta zu reproduzieren, und verfolge, wie die Env-Konfiguration in ClientOptions.GrpcMeta geladen wird. Bestätige, dass mehrere Metadateneinträge als separate Schlüssel-Wert-Paare und nicht als ein Schlüssel mit einem kombinierten Wert geparst werden; fertig ist es, wenn beide Authorization-Header aus der Env-Konfiguration funktionieren.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

bug
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
Vorherrschende Sprache
Go
Sterne
390
Forks
123
Ø Merge
2 T. 9 Std.
Gemergte PRs (30 T.)
13

Entwicklungsumgebung

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus temporalio/cli

Alle Issues in temporalio/cli

Ähnliche Issues

Weitere Issues zu Go

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.