cli icon indicating copy to clipboard operation
cli copied to clipboard

Config store helper

Open gregod-com opened this issue 2 years ago • 0 comments

This MR allows to define a local executable via the flag --config-helper or EnvVar RANCHER_CONFIG_HELPER to store the rancher config.

The methods to load and write the config are intercepted and by default keep the existing method of storing the config as file on the filesystem. (~/.rancher/cli2.json) If the flag --config-helper is set to a other values than built-in, the method invokes a call to the defined executable with the argument get to load the config and store to persist the config.

An example config-helper could look like this:

rancher-helper

#!/bin/zsh

case "$1" in
    get)   gopass show -o -y rancher-config ;;
    store) echo $2 | gopass insert -f rancher-config ;;
esac

The motivation for this MR is to allow a secure storage of the credentials found in the rancher config.

gregod-com avatar Dec 20 '22 21:12 gregod-com