Add eauth flag (-a) to the salt-run (and salt-key?) CLI tools
'Cause sometimes non-root users want to run runners. (And it's already possible from the Python level so why not?)
Well, it can't be -a for salt-key. Just saying. ;)
:angry:
+1
That would be great. In the current state, it's not very intuitive that @runner in the external_auth would only work through the salt-api.
This currently works at Salt's Python API (which salt-api uses). If you need a temporary workaround before we can add this to core, you can create a wrapper script that instantiates RunnerClient or WheelClient and then call the cmd_sync function which respects the @runner eauth.
https://docs.saltstack.com/en/latest/ref/clients/
And of course, we'd very happily accept a port of this check in salt/cli/salt.py to salt/cli/run.py or salt/cli/key.py if anyone is so inclined. :smile:
ZD-812
Approved for Carbon 2016.9 on 6/16 by Tom
Both salt-run and salt-key are designed to work alone without calling master to do any job. salt-key directly looks up the key directories and moves/removes the key files. salt-run executes runners directly via SyncClientMixing.low(). The only thing the utilities do with master is sending notifications about their results.
To make it possible to use external_auth in salt-run it's needed to change the CLI tool to use RunnerClient cmd_sync and cmd_async functions that ask master to do the job instead of sync and async methods doing the job by theirself.
To make the same for salt-key it's needed to create a CrearFuncs method handling keys-related requests and send the requests from salt-key CLI via ReqChannel.
This will change the salt-run and salt-key behavior making them not working with salt-master stopped.
@whiteinge @cachedout @terminalmage Is this the goal of this task? Are the described changes expected and desired?
@DmitryKuzmenko yes, that is the goal. IIRC WheelClient already goes through ClearFuncs. If so, salt-key could make use of that since it also has cmd_sync and cmd_async methods.
That said, I'm not sure there's a 1-to-1 mapping between salt-key flags and key wheel functions. We may need to add functions or add arguments to existing functions.
@whiteinge thank you!
@DmitryKuzmenko are you unblocked here?
@meggiebot ah yes, sorry, forgot to change the status.
All the work here is done.