Bug #17813

audits API can't search on LookupValue type

Added by Shlomi Zadok 9 months ago. Updated 9 months ago.

Status:Closed
Priority:Normal
Assigned To:Shlomi Zadok
Category:Search
Target version:-
Difficulty: Bugzilla link:1406175
Found in release: Pull request:https://github.com/theforeman/foreman/pull/4124
Story points-
Velocity based estimate-
Release1.14.1Release relationshipAuto

Description

Cloned from https://bugzilla.redhat.com/show_bug.cgi?id=1406175
Description of problem:

When a user modifies a matcher in a smart param, this is logged as an audit event with auditable_type = LookupValue:

{
"user_id": 3,
"user_type": null,
"user_name": "admin",
"version": 4,
"comment": null,
"associated_id": 168,
"associated_type": "LookupKey",
"remote_address": "192.168.0.0",
"associated_name": "cs_puppet_config_csl31::naming_services_0001::nameservers",
"created_at": "2016-12-14 00:17:44 UTC",
"id": 15285,
"auditable_id": 53,
"auditable_name": "hostgroup=ORGANIZATION/CH/TESTING",
"auditable_type": "LookupValue",
"action": "update",
"audited_changes": {
"value": [
[
"192.168.0.0",
"192.168.0.0"
],
[
"192.168.0.0"
]
]
}
}

But I can't query these reports directly:

Doing this:

https://satellite.example.com/api/v2/audits?search=type=LookupValue

Returns this:

{
"error": {
"message": "'auditable_type' should be one of 'host, parameter, architecture, puppetclass, os, hostgroup, template', but the query was 'LookupValue'",
"class": "ScopedSearch::QueryNotSupported"
}
}

Version-Release number of selected component (if applicable):

How reproducible:

Very

Steps to Reproduce:
1. use https://satellite.example.com/api/v2/audits?search=type=LookupValue
2.
3.

Actual results:

{
"error": {
"message": "'auditable_type' should be one of 'host, parameter, architecture, puppetclass, os, hostgroup, template', but the query was 'LookupValue'",
"class": "ScopedSearch::QueryNotSupported"
}
}

Expected results:

for it to return the correct data.

Additional info:


Related issues

Related to Foreman - Bug #18690: Cannot query most auditable_types in API Closed 02/27/2017

Associated revisions

Revision 5cda7bd0
Added by Shlomi Zadok 9 months ago

Fixes #17813 - Add type=LookupValue to Audit search

History

#1 Updated by Dominic Cleal 9 months ago

  • Category set to Search
  • Priority changed from High to Normal

#2 Updated by The Foreman Bot 9 months ago

  • Status changed from New to Ready For Testing
  • Assigned To set to Shlomi Zadok
  • Pull request https://github.com/theforeman/foreman/pull/4124 added

#3 Updated by Shlomi Zadok 9 months ago

  • Status changed from Ready For Testing to Closed
  • % Done changed from 0 to 100

#4 Updated by Dominic Cleal 9 months ago

  • Subject changed from audits API can't search on some types to audits API can't search on LookupValue type
  • Release set to 1.14.1

#5 Updated by Marek Hulán 7 months ago

  • Related to Bug #18690: Cannot query most auditable_types in API added

Also available in: Atom PDF