Allow to pass registration code by stdin or file #176
Labels
enhancement
New feature or request
good first issue
Good for newcomers
help wanted
Extra attention is needed
SUSEConnect is a command line application that allows customers to access the repositories they are subscribed to in an easy way. In order to get these repositories for the first time on a given system, a customer is supposed to "register" the system to SCC (SUSE Customer Center) with a registration code (regcode from now on).
Since early iterations of SUSEConnect, regcodes are provided through the
-r
parameter (eg.:suseconnect -r 1234
). That being said, passing a regcode via command line is insecure as the regcode can be seen in the process list and is usually logged by host intrusion detection systems.Thus, following standard practices, we should support two new ways to pass regcodes:
-r -
: passing a dash means "the regcode can be read directly from stdin" (eg.:echo "1234" | suseconnect -r -
).-r @/file/path
: if the value starts with an '@' sign, then it means that the regcode is provided at the given file (e.g. a secret file created by a Docker container, eg.:suseconnect -r @/my/file
).In order to close this issue you would need to provide a PR that provides both these new ways to pass a regcode value, with their respective tests, and that follows Go's best practices.
The text was updated successfully, but these errors were encountered: