Skip to content

RawLogsClient search parameter is parameter is hardcoded to "search" instead of "q" #842

@josebarrueta

Description

@josebarrueta

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

https://github.com/auth0/auth0-java/blob/master/src/main/java/com/auth0/client/mgmt/RawLogsClient.java#L167C3-L170C10

The code is hardcodes search instead of q as the search criteria name, docs: https://auth0.com/docs/api/management/v2/logs/get-logs

now:

        if (!request.getSearch().isAbsent()) {
            QueryStringMapper.addQueryParameter(
                    httpUrl, "search", request.getSearch().orElse(null), false);
        }

fails with:

BadRequestError, statusCode: 400, body: {
  "statusCode" : 400,
  "error" : "Bad Request",
  "message" : "The query 'undefined' cannot be parsed. Please revise the query or visit https://auth0.com/docs/logs/log-search-query-syntax for help.",
  "code" : "query_syntax_error"
}}

Reproduction

  1. Use the logs search api:
    LogsClient logsClient = managementApi.logs();

    String searchQuery = request.toSearchQuery(org.getId());

    ListLogsRequestParameters.Builder paramsBuilder =
        ListLogsRequestParameters.builder()
            .search(searchQuery)
            .sort("date:-1");

Additional context

No response

auth0-java version

latest (3.3.0)

Java version

21

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugThis points to a verified bug in the code

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions