Reject requests when translated Namespace is not a valid Cloud Namespace

オープン 初心者向け
#281 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

@kriyanshii がすでに取り組んでいます。

2026年11月16日 から。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
78/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
go

調査の方向性

まず internal/proxy/cloudns.go の cloudNamespaceUnaryInterceptor と cloudNamespaceStreamInterceptor を確認し、次に internal/proxy/cloudns_test.go のテーブル駆動テストを読みます。無効な翻訳後の namespace が転送前に拒否されることを確認するよう、テストを更新してください。呼び出し元がローカルとリモートの namespace、および検証エラーとともに codes.InvalidArgument を受け取れば完了です。

索引モデルが issue の本文から書いたものです。

説明

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
主要言語
Go
スター
32
フォーク
14
平均マージ
1日 10時間
マージ済み PR(30日)
62

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

temporalio/temporal-proxy のほかの issue

temporalio/temporal-proxy の issue をすべて見る

似ている issue

Go の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。