Method to access the requesting user from module/runner
RIght now the only way to get the username of the requestor is to instantiate the client and do client.salt_user (which only works in the runner). I know that the requestor is passed around in the payload_kwargs. Can we make that accessible in some sort of payload dict or something?
Not sure on this one. I'll get @thatch45 to comment. Thanks for the request.
where would you like to see this? It is in the job cache and this data should be getting fired ont he event bus, where else should we be able to get it?
Within the module itself. If i want to log (or post to some other tracking service) i'd like access to the username from within a salt module while it is executing.
I'd like to be able to access it similar to __salt__ and __pillar__, maybe have __payload__ ? or something like that. The difference would be that it would have to be set per call to the module-- which shouldn't be terribly difficult.
Looks like this is already available, just not documented
sudo salt hostname test.arg a b=1
[sudo] password for thjackso:
hostname:
----------
args:
- a
kwargs:
----------
__pub_arg:
- a
- b=1
__pub_fun:
test.arg
__pub_jid:
20130827173034843233
__pub_ret:
__pub_tgt:
hostname
__pub_tgt_type:
glob
__pub_user:
sudo_thjackso
b:
1
Where would be the correct place to document this?
@jacobhammons @jacksontj I am closing this ticket due to inactivity. If anyone feels that this feature needs more attention feel free to reopen it.
This still needs to be added to the docs, reopening.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
If this issue is closed prematurely, please leave a comment and we will gladly reopen the issue.