Reject requests when translated Namespace is not a valid Cloud Namespace

Aperta Adatta ai principianti
#281 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

@kriyanshii ci sta già lavorando.

Dal 16/11/2026.

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
78/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
go

Direzione di ricerca

Inizia con cloudNamespaceUnaryInterceptor e cloudNamespaceStreamInterceptor in internal/proxy/cloudns.go, poi leggi i test basati su tabelle in internal/proxy/cloudns_test.go. Aggiorna i test per verificare che i namespace tradotti non validi vengano rifiutati prima dell’inoltro. Il lavoro è completato quando il chiamante riceve codes.InvalidArgument con i namespace locale e remoto e l’errore di convalida.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

enhancement good first issue

Problem

When an upstream is Temporal Cloud, the proxy checks each request's translated Namespace with cloud.ValidateNamespace. If the check fails, it logs outbound namespace is not valid (at debug level) and forwards the request anyway. Cloud then rejects it, and the caller gets an error that says nothing about the Namespace.

For example, with a suffix rule on a Cloud upstream:

namespaces:
  rules:
    suffix: .${TEMPORAL_ACCOUNT}

A client that sends the fully-qualified name quickstart.a1b2c has it translated to quickstart.a1b2c.a1b2c. With buf curl, the caller sees:

code: internal
message: stream terminated by RST_STREAM with error code: PROTOCOL_ERROR

The real reason only shows up in the proxy's log, and then, only with --level debug set:

{"level":"debug","component":"translation","localNamespace":"quickstart.a1b2c","remoteNamespace":"quickstart.a1b2c.a1b2c","error":": id: is malformed. Should be <name>.<account-id>","message":"outbound namespace is not valid"}

[!NOTE]
This isn't a regression. It's the same on previous releases (e.g. v1.1.0).

Proposed change

In cloudNamespaceUnaryInterceptor and cloudNamespaceStreamInterceptor, when the translated Namespace fails
cloud.ValidateNamespace, return a codes.InvalidArgument status before calling the invoker or streamer. The message
should name the local and remote Namespaces and include the validation error, so a caller can fix the request without
access to the proxy's logs.

Where to look

  • internal/proxy/cloudns.go: the two interceptors and logNonCloudNamespace
  • internal/proxy/cloudns_test.go: table-driven tests that currently assert the debug entry and that the call is still forwarded
  • internal/dataplane/dataplane.go: the only caller, which installs these dial options on Cloud upstreams
Lingua principale
Go
Stelle
32
Fork
14
Merge medio
1g 10h
PR unite (30g)
62

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di temporalio/temporal-proxy

Tutte le issue di temporalio/temporal-proxy

Issue simili

Altre issue su Go

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.