auth0 / node-auth0

Node.js client library for the Auth0 platform.
MIT License
628 stars 307 forks source link

ManagmentClient logs.getAll ignores filters #956

Closed thutter closed 10 months ago

thutter commented 10 months ago

Checklist

Description

The management client seems to ignore provided filters for the logs endpoint.

Example

const fetchedLogs = await managementClient.logs.getAll({
  from: lastLogId,
  take: 1,
  sort: 'date:-1',
  include_fields: true,
  fields: 'log_id,user_id,type,date',
  q: 'type:cls OR type:cl OR type:fn OR type:gd_send_email OR type:limit_wc OR type:scp OR type:fcpr OR type:sv',
})

In this case fetchedLogs contains all types of logs and all fields, instead of the specified ones.

I tried this with version 3.x.x and 4.x.x of the ManagementClient.

Reproduction

  1. Initialize ManagementClient
  2. Run the request shown in description
  3. Validate the output

Additional context

Using @auth0/nextjs-auth0 as well

node-auth0 version

4.0.1

Node.js version

v18.12.1

adamjmcgrath commented 10 months ago

Hi @thutter - thanks for raising this

This is expected. Per the docs:

image

More info https://auth0.github.io/node-auth0/classes/management.LogsManager.html#getAll

thutter commented 10 months ago

Thanks for the quick reply. I actually read it, but didn't remember when put to use.