Reject requests when translated Namespace is not a valid Cloud Namespace

未关闭 适合新手
#281 1 条评论 0 个 reaction 已指派 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 会在转发前被拒绝。完成标准是调用方收到 codes.InvalidArgument,并附带本地和远程 namespace 以及验证错误。

由索引模型根据 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 小时
30 天内合并 PR
62

环境准备

  • 提供 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 阅读贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

temporalio/temporal-proxy 的其他 Issue

查看 temporalio/temporal-proxy 的全部 Issue

相似的 Issue

更多 Go Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。