fix(firestore-send-email): kit/extension parity – a required placeholder SMTP_PASSWORD overrides the password in SMTP_CONNECTION_URI

未关闭
#3,293 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 7 天内回复

还没有人认领这个 Issue。

评估

难度
3/5
预计耗时
1-2 天
新手友好度
56/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
活跃
技术栈
firebase, typescript

调研方向

Start with kits/firestore-send-email/src/helpers.ts around lines 93–99 and compare its SMTP password handling with the extension helper at functions/src/helpers.ts around lines 61–68. Read the kit README section around lines 157–169 and inspect the migration and secret binding references in the issue. Done means a kit migrated from a URI with an inline password can send successfully, with the intended behavior documented or covered.

由索引模型根据 Issue 内容生成。

描述

kits parity type: bug

firestore-send-email kit/extension parity. Priority: high. After migrating, every email fails to send if the SMTP password was kept in the connection URI.

Difference
  • Extension: SMTP_PASSWORD is optional. Installs that put the password in SMTP_CONNECTION_URI (the "backwards compatible" form in the param's description) have no secret, and the URI's password is used.
  • Kit:
    • All four secrets are always bound, so SMTP_PASSWORD must exist and must not be empty. ext:migrate and functions:kits:install prompt for it, and Secret Manager rejects an empty value.
    • Any non-blank value then replaces the URI's password, the same as in the extension.
    • Users who enter a placeholder (the README recommends placeholders for the unused secrets) get an authentication failure on every send. A placeholder also adds auth to SMTP relays that need none.
Reproduced
  1. Extension installed with SMTP_CONNECTION_URI=smtp://user:[email protected]:587 and no SMTP_PASSWORD: mail sends (SUCCESS).
  2. firebase ext:migrate on that instance: it prompts "Enter a value for SMTP password". An empty answer fails with Secret Payload cannot be empty, so "placeholder" was entered.
  3. The migrated kit fails every document with delivery.error: "Error: Invalid login: 535 Authentication failed". A README-setup kit with the same URI and a placeholder secret fails the same way.
  4. Setting the secret to a single space works around it: the kit trims it to unset, and mail sends.
Code
Resolution
  • Only use SMTP_PASSWORD when the URI carries no password of its own. That is a behaviour change only for configs that set both.
  • Or, at a minimum, document in the README and the migration notes: move an inline password into SMTP_PASSWORD, or set that secret to a single space.
主要语言
TypeScript
星标
979
派生
435
平均合并
4 天 22 小时
30 天内合并 PR
15

环境准备

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

从这里开始

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

firebase/extensions 的其他 Issue

查看 firebase/extensions 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

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