createManagementAuth drops the custom fetch option from clientOptions

Đang mở Phù hợp với người mới
#1,432 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

@RaphaelFakhri đang làm issue này rồi.

Từ ngày 22/10/2026.

  • #1433 của @RaphaelFakhri — đang mở

Đánh giá

Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
77/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
node.js, typescript
Lĩnh vực
backend-api-design

Hướng nghiên cứu

Bắt đầu bằng cách đọc createManagementAuth và kiểu ManagementClientOptions, sau đó so sánh cách ManagementClient chuyển tiếp fetch với cách xây dựng clientOptions. Thêm một bài kiểm thử tập trung, cung cấp fetch tùy chỉnh và kiểm tra rằng nó được giữ lại và được sub-client sử dụng. Issue không nêu tên tệp kiểm thử, vì vậy hãy tìm các bài kiểm thử management auth hiện có. Hoàn thành khi các yêu cầu của sub-client sử dụng hàm được cung cấp.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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
Ngôn ngữ chính
TypeScript
Star
683
Fork
319
Merge trung bình
1 ngày 30 phút
Pull request đã merge (30 ngày)
13

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của auth0/node-auth0

Tất cả issue của auth0/node-auth0

Issue tương tự

Thêm issue về TypeScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.