createManagementAuth drops the custom fetch option from clientOptions
维护者通常 1 天内回复
评估
- 难度
- 2/5
- 预计耗时
- 1-3 小时
- 新手友好度
- 77/100
- Issue 类型
- 缺陷
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
- 技术栈
- node.js, typescript
调研方向
先阅读 createManagementAuth 和 ManagementClientOptions 类型,然后比较 ManagementClient 转发 fetch 的方式与构建 clientOptions 的方式。添加一个有针对性的测试,传入自定义 fetch,并检查它是否被保留且由子客户端使用。issue 没有给出测试文件名,因此请查找现有的 management auth 测试。子客户端请求使用所提供的函数,即为完成。
由索引模型根据 Issue 内容生成。
描述
Description
createManagementAuth accepts a fetch option (it is part of ManagementClientOptions), and TokenProvider uses it for the token request. The returned clientOptions does not include it, so sub-clients built with new UsersClient(auth.clientOptions) send every Management API request through the global fetch.
ManagementClient forwards fetch to the underlying client, so the two setups behave differently. The createManagementAuth docs state that clientOptions carries the same behaviour as ManagementClient.
This affects any setup that relies on a custom fetch: proxies, instrumented fetch, runtimes without a global fetch, and useMTLS, where the token is certificate-bound but API calls go out without the client certificate.
Reproduction
import { createManagementAuth } from "auth0/management";
import { UsersClient } from "auth0/users";
const myFetch: typeof fetch = (input, init) => {
console.log("custom fetch", input);
return fetch(input, init);
};
const auth = createManagementAuth({
domain: "your-tenant.auth0.com",
token: "your-api-v2-token",
fetch: myFetch,
});
console.log(auth.clientOptions.fetch); // undefined
await new UsersClient(auth.clientOptions).list(); // "custom fetch" is never logged
Expected behaviour
auth.clientOptions.fetch is the supplied function, and sub-client requests use it, as with ManagementClient.
Environment
- auth0 v7.6.0 (current
master) - Node.js 22
- 主要语言
- TypeScript
- 星标
- 683
- 派生
- 319
- 平均合并
- 1 天 30 分钟
- 30 天内合并 PR
- 13
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
auth0/node-auth0 的其他 Issue
-
bug
难度 3/5 1-2 天 新手友好度 70/100
auth0/node-auth0#1434 · 3 个 reaction ·
维护者通常 1 天内回复
-
难度 3/5 1-2 天 新手友好度 52/100
auth0/node-auth0#1387 · 1 条评论 · 2 个 reaction ·
维护者通常 1 天内回复
-
bug
难度 5/5 一周以上 新手友好度 35/100
auth0/node-auth0#1295 · 2 条评论 ·
维护者通常 1 天内回复
-
难度 4/5 3-5 天 新手友好度 48/100
auth0/node-auth0#1204 · 11 条评论 · 7 个 reaction ·
维护者通常 1 天内回复
-
bug vNext
难度 3/5 半天 新手友好度 38/100
auth0/node-auth0#1106 · 3 条评论 · 1 个 reaction ·
维护者通常 1 天内回复
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 75/100
milind-soni/OpenMausBot#6730 ·
维护者通常 1 天内回复
-
`@angular/[email protected]` depends on vulnerable Vite 7.3.7 - GHSA-p4f5-76q4-ffq7 (Critical RCE)未关闭area: @angular/build
难度 2/5 1-3 小时 新手友好度 65/100
angular/angular-cli#34764 ·
维护者通常 1 天内回复
-
status/need-triage
难度 2/5 1-3 小时 新手友好度 76/100
google-gemini/gemini-cli#30384 · 1 条评论 ·
维护者通常 1 天内回复
-
P2
难度 1/5 1 小时以内 新手友好度 84/100
维护者通常 1 天内回复
-
area:image documentation good first issue
难度 2/5 1-3 小时 新手友好度 68/100
维护者通常 1 天内回复