salt icon indicating copy to clipboard operation
salt copied to clipboard

Add eauth flag (-a) to the salt-run (and salt-key?) CLI tools

Open whiteinge opened this issue 13 years ago • 13 comments

'Cause sometimes non-root users want to run runners. (And it's already possible from the Python level so why not?)

whiteinge avatar Nov 21 '13 03:11 whiteinge

Well, it can't be -a for salt-key. Just saying. ;)

basepi avatar Nov 21 '13 20:11 basepi

:angry:

whiteinge avatar Nov 22 '13 02:11 whiteinge

+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.

PierreR avatar Sep 09 '15 08:09 PierreR

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:

whiteinge avatar Sep 09 '15 17:09 whiteinge

ZD-812

rickh563 avatar Jun 16 '16 14:06 rickh563

Approved for Carbon 2016.9 on 6/16 by Tom

meggiebot avatar Jun 16 '16 16:06 meggiebot

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 avatar Jun 28 '16 13:06 DmitryKuzmenko

@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.

whiteinge avatar Jun 28 '16 19:06 whiteinge

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 avatar Jun 28 '16 19:06 whiteinge

@whiteinge thank you!

DmitryKuzmenko avatar Jun 29 '16 06:06 DmitryKuzmenko

@DmitryKuzmenko are you unblocked here?

meggiebot avatar Jul 08 '16 19:07 meggiebot

@meggiebot ah yes, sorry, forgot to change the status.

DmitryKuzmenko avatar Jul 18 '16 16:07 DmitryKuzmenko

All the work here is done.

DmitryKuzmenko avatar Aug 03 '16 10:08 DmitryKuzmenko