Logs client ignores `from` and `take` for checkpoint pagination
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
调研方向
从 lib/auth0/logs/client.rb 中的 Auth0::Logs::Client#list 开始,查看白名单中的 query_params(page、per_page、sort、fields、include_fields、include_totals、search)是如何从 **params 中复制出来的;以相同方式添加 from 和 take。检查代码是否在 offset 分页和 checkpoint 分页之间分支,以及 include_totals 是否与 take 冲突。用针对 from/take 的请求期望更新 spec/auth0/logs/client_spec.rb,然后通过 rspec 运行它;当发出的 query string 带有这两个参数且现有分页测试仍然通过时完成。
由索引模型根据 Issue 内容生成。
描述
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
- 主要语言
- Ruby
- 星标
- 205
- 派生
- 144
- 平均合并
- 1 天 6 小时
- 30 天内合并 PR
- 12
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
auth0/ruby-auth0 的其他 Issue
-
Retrying a multipart request raises "Cannot write to closed encoder"可能已有人在做 @RaphaelFakhri 于 30 天前认领。 未关闭
难度 3/5 1-2 天 新手友好度 56/100
auth0/ruby-auth0#818 ·
维护者通常 1 天内回复
-
feature request
难度 3/5 1-2 天 新手友好度 45/100
auth0/ruby-auth0#709 ·
维护者通常 1 天内回复
-
bug
难度 1/5 1 小时以内 新手友好度 50/100
auth0/ruby-auth0#610 · 1 条评论 ·
维护者通常 1 天内回复
-
Rate limit data returned from API methods可能已有人在做 关联的 PR 仍在进行中或已合并。 未关闭feature request
难度 5/5 一周以上 新手友好度 32/100
auth0/ruby-auth0#606 · 2 条评论 · 1 个 reaction ·
维护者通常 1 天内回复
-
MFA API Bearer token issue可能已有人在做 关联的 PR 仍在进行中或已合并。 未关闭bug
难度 3/5 1-2 天 新手友好度 35/100
auth0/ruby-auth0#556 · 2 条评论 ·
维护者通常 1 天内回复
相似的 Issue
-
bug
难度 2/5 1-3 小时 新手友好度 70/100
TarteelAI/quranic-universal-library#1111 ·
维护者通常 1 天内回复
-
Generated cask uses deprecated `postflight` stanza; Homebrew 7 warns on every command可能已有人在做 @k4kratik 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 82/100
sachincool/cruft#4 ·
-
难度 2/5 1-3 小时 新手友好度 74/100
riscv/riscv-unified-db#2859 ·
维护者通常 2 天内回复
-
agent-driven deployment documentation future releases nice to have
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复
-
changesets
难度 2/5 1-3 小时 新手友好度 72/100
openstreetmap/openstreetmap-website#7629 · 1 条评论 ·
维护者通常 1 天内回复