Logs client ignores `from` and `take` for checkpoint pagination
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ó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 80/100
Hướng nghiên cứu
Bắt đầu trong lib/auth0/logs/client.rb tại Auth0::Logs::Client#list và xem cách các query_params được whitelist (page, per_page, sort, fields, include_fields, include_totals, search) được sao chép ra khỏi **params; thêm from và take theo cùng cách. Kiểm tra xem mã có rẽ nhánh giữa phân trang offset và phân trang checkpoint hay không, và liệu include_totals có xung đột với take hay không. Cập nhật spec/auth0/logs/client_spec.rb với một kỳ vọng request cho from/take, sau đó chạy nó qua rspec; hoàn tất khi query string được phát ra mang cả hai tham số và các bài test phân trang hiện có vẫn pass.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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.
Description
The Auth0 Management API supports checkpoint pagination for tenant logs using the from and take query parameters.
However, Auth0::Logs::Client#list accepts these arguments through **params, but does not add them to the request query parameters. As a result, the arguments are silently ignored.
I expected the following call:
client.logs.list(
from: checkpoint_log_id,
take: 100
)
to send a request equivalent to:
GET /api/v2/logs?from=CHECKPOINT_LOG_ID&take=100
Instead, checkpoint pagination is not applied, and the default offset-pagination parameters are used.
Reproduction
-
Install version 6.7.0 of the
auth0gem.gem "auth0", "6.7.0" -
Create a Management API client using credentials with the
read:logsscope.client = Auth0::Client.new( domain: ENV.fetch("AUTH0_DOMAIN"), client_id: ENV.fetch("AUTH0_CLIENT_ID"), client_secret: ENV.fetch("AUTH0_CLIENT_SECRET") ) -
Obtain an existing tenant log ID and call
logs.listusing it as the checkpoint.logs = client.logs.list( from: checkpoint_log_id, take: 100 ).to_a -
Inspect the outgoing request or
lib/auth0/logs/client.rb.Auth0::Logs::Client#listacceptsfromandtakethrough**params, but does not copy them intoquery_params.The implementation only handles the following query parameters:
pageper_pagesortfieldsinclude_fieldsinclude_totalssearch
Therefore,
fromandtakeare not included in the request.
This issue is consistently reproducible.
Additional context
The Auth0 documentation describes from and take as the parameters for retrieving logs by checkpoint:
- https://auth0.com/docs/deploy-monitor/logs/retrieve-log-events-using-mgmt-api
- https://auth0.com/docs/api/management/v2/logs/get-logs
The method documentation also mentions checkpoint pagination, but the corresponding parameters are not handled by the implementation.
ruby-auth0 version
6.7.0
Ruby version
4.0.10
- Ngôn ngữ chính
- Ruby
- Star
- 205
- Fork
- 144
- Merge trung bình
- 1 ngày 6 giờ
- Pull request đã merge (30 ngày)
- 12
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- 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.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của auth0/ruby-auth0
-
Retrying a multipart request raises "Cannot write to closed encoder"Có thể đã có người làm @RaphaelFakhri đã nhận 30 ngày trước. Đang mở
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 56/100
auth0/ruby-auth0#818 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
feature request
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 45/100
auth0/ruby-auth0#709 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 50/100
auth0/ruby-auth0#610 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Rate limit data returned from API methodsCó thể đã có người làm Có pull request liên kết đang mở hoặc đã được merge. Đang mởfeature request
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 32/100
auth0/ruby-auth0#606 · 2 bình luận · 1 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày
-
MFA API Bearer token issueCó thể đã có người làm Có pull request liên kết đang mở hoặc đã được merge. Đang mởbug
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 35/100
auth0/ruby-auth0#556 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của auth0/ruby-auth0
Issue tương tự
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
TarteelAI/quranic-universal-library#1111 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Generated cask uses deprecated `postflight` stanza; Homebrew 7 warns on every commandCó thể đã có người làm @k4kratik đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
sachincool/cruft#4 ·
-
load_reserved() and store_conditional() call memory_model_acquire() before the memory accessĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
riscv/riscv-unified-db#2859 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
agent-driven deployment documentation future releases nice to have
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 1 ngày
-
changesets
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
openstreetmap/openstreetmap-website#7629 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày