Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

Please delay requesting an API token until one is needed

Đang mở
#709 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

Chưa có ai nhận issue này.

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
45/100
Loại issue
Tính năng
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
ruby
Lĩnh vực
api, authentication

Hướng nghiên cứu

Bắt đầu bằng cách lần theo Auth0::Client.new đến yêu cầu token đồng bộ và kiểm tra các test hiện có cũng như thiết lập WebMock liên quan đến việc khởi tạo client. Thay đổi được hoàn tất khi việc tạo client không thực hiện yêu cầu mạng nào, trong khi các thao tác yêu cầu token vẫn yêu cầu token và được bao phủ bởi các test.

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

Mô tả

feature request
Checklist
  • I have looked into the Readme and Examples, and have not found a suitable solution or answer.
  • I have looked into the API documentation and have not found a suitable solution or answer.
  • I have searched the issues and have not found a suitable solution or answer.
  • I have searched the Auth0 Community forums and have not found a suitable solution or answer.
  • I agree to the terms within the Auth0 Code of Conduct.
Describe the problem you'd like to have solved

Whenever a new Auth0::Client is instantiated a synchronous call is made to auth0 to fetch a token. This causes headaches in specs because any time that we instantiate it we have to mock it out with webmock to prevent actual requests. If it were only fetched when required we could focus our mocks to just the areas of code that require it rather than anything that happens to trigger an object instantiation.

Describe the ideal solution

When I do Auth0::Client.new there are zero network requests made.

Alternatives and current workarounds

We are considering putting a global mock in for this which we are not happy with.

Additional context

No response

Ngôn ngữ chính
Ruby
Star
205
Fork
146
Merge trung bình
16 giờ 2 phút
Pull request đã merge (30 ngày)
5

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/ruby-auth0

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

Issue tương tự

Thêm issue về Ruby

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.