Actions
Bug #18690
closedCannot query most auditable_types in API
Difficulty:
Triaged:
Bugzilla link:
Pull request:
Description
Cloned from https://bugzilla.redhat.com/show_bug.cgi?id=1426742
When a user edits an authentication source and audit record such as this is generated:
{ "user_id": 3, "user_type": null, "user_name": "admin", "version": 1, "comment": null, "associated_id": null, "associated_type": null, "remote_address": "192.168.0.0", "associated_name": null, "created_at": "2016-11-30 15:41:19 UTC", "id": 12417, "auditable_id": 3, "auditable_name": "LDAP-GBL-AD", "auditable_type": "AuthSource", "action": "create", "audited_changes": { "name": "GBL-AD", "host": <hostname>, "port": 389, "account": null, "account_password": null, "base_dn": null, "attr_login": "sAMAccountName", "attr_firstname": "givenName", "attr_lastname": "sn", "attr_mail": "userPrincipalName", "onthefly_register": true, "tls": false, "ldap_filter": null, "attr_photo": null, "server_type": "posix", "groups_base": null, "usergroup_sync": false } }
And the audit event with is recorded with auditable_type = AuthSource. However, this fails:
https://satellite.example.com/api/v2/audits/?search=name=AuthSource
With this (by name):
"error": {"message":"Field 'name' not recognized for searching!","class":"ScopedSearch::QueryNotSupported"}
But when you query by type:
"error": {"message":"'auditable_type' should be one of 'host, parameter, architecture, puppetclass, os, hostgroup, template', but the query was 'AuthSource'","class":"ScopedSearch::QueryNotSupported"}
From audit logs the available types seem to be:
"auditable_type": "AuthSource", "auditable_type": "ComputeAttribute", "auditable_type": "ComputeProfile", "auditable_type": "ComputeResource", "auditable_type": "Domain", "auditable_type": "HostClass", "auditable_type": "HostgroupClass", "auditable_type": "Katello::System", "auditable_type": "Location", "auditable_type": "LookupKey", "auditable_type": "LookupValue", "auditable_type": "Medium", "auditable_type": "Organization", "auditable_type": "Ptable", "auditable_type": "Role", "auditable_type": "Setting", "auditable_type": "SmartProxy", "auditable_type": "Subnet", "auditable_type": "User", "auditable_type": "Usergroup",
We would expect these types to be able to be queried as well as the types that already exist.
Updated by Tomáš Strachota over 7 years ago
- Subject changed from Cannot query most auditable_types in API to Cannot query most auditable_types in API
- Target version set to 115
Updated by Dominic Cleal over 7 years ago
- Category changed from 19 to Search
- Target version deleted (
115)
Updated by Marek Hulán over 7 years ago
- Related to Feature #17842: add audit search for compute resource type added
Updated by Marek Hulán over 7 years ago
- Related to Bug #17813: audits API can't search on LookupValue type added
Updated by Marek Hulán over 7 years ago
- Target version set to 115
I think the target version was removed by accident so resetting. The fix will be probably similar to the issues I linked.
Updated by Tomáš Strachota over 7 years ago
- Status changed from New to Assigned
- Assignee set to Tomáš Strachota
Updated by The Foreman Bot over 7 years ago
- Status changed from Assigned to Ready For Testing
- Pull request https://github.com/theforeman/foreman/pull/4363 added
Updated by Anonymous over 7 years ago
- Status changed from Ready For Testing to Closed
- % Done changed from 0 to 100
Applied in changeset 28599ad1ffd0374fcfb504e0d1e5a0f4d9e51f4b.
Updated by Marek Hulán over 7 years ago
- Translation missing: en.field_release set to 209
Actions