[FR] Support VERIFY_AND_CHANGE_EMAIL in generate_email_action_link (parity with firebase-admin-node)
@lahirumaramba 已经在做这个了。
开始于 2026年5月5日。
评估
这个 Issue 还没有评估数据。
描述
Is your feature request related to a problem? Please describe.
The Identity Toolkit accounts:sendOobCode endpoint supports a VERIFY_AND_CHANGE_EMAIL request type that generates an OOB link which, when followed, both verifies the new address and updates the user's email. This is the recommended way to implement a secure "change email" flow — the verification link is sent to the current address so the flow isn't vulnerable to a stolen session setting a new email without the original owner's knowledge.
The Python Admin SDK cannot generate these links today. firebase_admin/_auth_utils.py declares:
VALID_EMAIL_ACTION_TYPES = set(['VERIFY_EMAIL', 'EMAIL_SIGNIN', 'PASSWORD_RESET'])
validate_action_type() rejects 'VERIFY_AND_CHANGE_EMAIL' before the request is made, and there is no new_email parameter on generate_email_action_link to carry the target address.
Describe the solution you'd like
Mirror the API added to firebase-admin-node in firebase/firebase-admin-node#1633 (merged April 2022):
- Add
'VERIFY_AND_CHANGE_EMAIL'toVALID_EMAIL_ACTION_TYPES. - Add an optional
new_email: str | None = Noneparameter togenerate_email_action_link(and the correspondingClient/authmodule methods), required whenaction_type == 'VERIFY_AND_CHANGE_EMAIL'. - Include
newEmailin theaccounts:sendOobCodepayload when set.
For reference, the Node signature is:
generateEmailActionLink(requestType, email, actionCodeSettings?, newEmail?)
Describe alternatives you've considered
Calling accounts:sendOobCode directly through Client._user_manager._make_request(...) with {"requestType": "VERIFY_AND_CHANGE_EMAIL", "email": ..., "newEmail": ..., "returnOobLink": True, ...}, reusing firebase_admin._user_mgt.encode_action_code_settings for ActionCodeSettings serialization. This works but depends on SDK internals (private _user_manager, private _make_request, private encode_action_code_settings) and bypasses the SDK's validation and error mapping.
Additional context
- Node SDK PR adding the same feature: firebase/firebase-admin-node#1633
- The Identity Toolkit
requestTypeenum already includesVERIFY_AND_CHANGE_EMAIL; the REST surface is unchanged. - Verified against
firebase-admin7.4.0.
- 主要语言
- Python
- 星标
- 1.2k
- 派生
- 359
- 平均合并
- 3 天 9 小时
- 30 天内合并 PR
- 3
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
firebase/firebase-admin-python 的其他 Issue
-
api: remoteconfig
难度 2/5 1-3 小时 新手友好度 75/100
firebase/firebase-admin-python#957 · 1 条评论 ·
-
api: database type: feature request
难度 2/5 1-3 小时 新手友好度 62/100
-
难度 4/5 3-5 天 新手友好度 45/100
firebase/firebase-admin-python#978 · 1 条评论 ·
-
难度 4/5 3-5 天 新手友好度 43/100
firebase/firebase-admin-python#945 · 1 条评论 · 1 个 reaction ·
-
type: feature request
firebase/firebase-admin-python#915 · 5 条评论 · 3 个 reaction · 已指派 3 人 ·
查看 firebase/firebase-admin-python 的全部 Issue
相似的 Issue
-
essnmx good first issue
难度 1/5 1 小时以内 新手友好度 95/100
-
难度 2/5 1-3 小时 新手友好度 65/100
syfoud/Simulated_Scepter#174 ·
-
难度 2/5 1-3 小时 新手友好度 75/100
Giskard-AI/giskard-oss#2840 · 1 条评论 ·
-
A claim comment carrying the issue number is silently declined while the workflow reports success 未关闭area: repo bug perceived difficulty: 2
难度 2/5 1-3 小时 新手友好度 70/100
-
难度 2/5 1-3 小时 新手友好度 75/100
yeti-platform/yeti#1380 ·