Logs client ignores `from` and `take` for checkpoint pagination
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
調査の方向性
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 pagination と checkpoint pagination の間で分岐するか、また include_totals が take と競合するかを確認してください。spec/auth0/logs/client_spec.rb を from/take のリクエスト期待で更新し、その後 rspec で実行してください。出力される query string が両方のパラメータを含み、既存の pagination テストが引き続き通れば完了です。
索引モデルが 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時間
- マージ済み PR(30日)
- 12
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- 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対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープンfeature request
難易度 5/5 1週間以上 初心者へのやさしさ 32/100
auth0/ruby-auth0#606 · コメント 2 件 · リアクション 1 件 ·
メンテナーはふだん 1 日以内に返信
-
MFA API Bearer token issue対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープンbug
難易度 3/5 1〜2日 初心者へのやさしさ 35/100
auth0/ruby-auth0#556 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
auth0/ruby-auth0 の issue をすべて見る
似ている 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 日以内に返信