Description of problem: When any API request is made, for example a retirement request, the $evm.root has no record of the requesting user - there are attributes such as `user` and `user_id` but these are the owner of the object that is being requested upon, not the ID of the reuqester. Additonaly the retirement_initiator is 'system' instead of 'user' as it is when it is initiated from the UI. When requested from the UI, the $evm.root object contains the `userid` attribute which contains the ID of the requester. Without this attribute, there is no auditing trail for requests, including retirement. Primary examples are any action, including `retire` from the `/services` endpoint of the API. Version-Release number of selected component (if applicable): 5.8.2.3-1 How reproducible: Every time Steps to Reproduce: 1. Make a request from the API (with or without using auth-tokens) to retire a service 2. Inspect the $evm.root from the event, determine it has no `userid` attribute. Actual results: There is no `userid` attribute in $evm.root for requests coming from the API. Expected results: There should be similar attributes whether the request is from the UI or the API.
From my inspectiong, seeing as the miq-ae-engine seems to simply consume the userid passed to it, I've set the component as 'API' - please correct me if I'm wrong.
At least the `request_initiator` appears to be resolved in [here][1] - is this possibly a duplicate of bz1487749? [1]: https://github.com/ManageIQ/manageiq/pull/16179/commits/940e56998c87b6aa8147a6c9062f846d76085e33#diff-d286dd33aa15fb98e02d16598ad92899L14
Lucy - Please try to validate if this is really a dup on bz1487749.
Levgen - This looks like a dupe of BZ1487749. Can you please check. Thanks - Sudhir
https://github.com/ManageIQ/manageiq-api/pull/326
New commit detected on ManageIQ/manageiq-api/master: https://github.com/ManageIQ/manageiq-api/commit/8284f6d6bd217f5cdfddbc309c2e7e2131d06398 commit 8284f6d6bd217f5cdfddbc309c2e7e2131d06398 Author: Jillian Tullo <jtullo> AuthorDate: Tue Feb 20 13:57:00 2018 -0500 Commit: Jillian Tullo <jtullo> CommitDate: Wed Feb 21 08:10:31 2018 -0500 Set user when queueing VM actions When VM actions are queued, the user should be set so that it is available as the requester in automate. Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1546375 app/controllers/api/vms_controller.rb | 28 +++++++++++++++++++++------- spec/requests/vms_spec.rb | 32 +++++++++++++++++++++++++++++++- 2 files changed, 52 insertions(+), 8 deletions(-)
Verified in 5.10.0.2