-
Notifications
You must be signed in to change notification settings - Fork 92
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Looking to add a way for the client applications to get the Control Room credential from RCC #66
base: master
Are you sure you want to change the base?
Conversation
…oom credential from RCC - Only in `rcc conf credentials` with both flags `--json` and `--showSecrets` the output JSON will contain the un-smudged secret values - Making this a very deliberate command, so that user must know they are about to get the secrets that are by default always smudged to avoid accidental logging etc.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No real issues, just nitpicks, feel free to ignore as you see fit.
@@ -36,7 +36,7 @@ var credentialsCmd = &cobra.Command{ | |||
operations.VerifyAccounts(forceFlag) | |||
} | |||
if show && !deleteCredentialsFlag { | |||
operations.ListAccounts(jsonFlag) | |||
operations.ListAccounts(jsonFlag, secretsFlag) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor: I think I'd call this showSecretsFlag
to go along with the flag in the command line.
@@ -185,8 +185,14 @@ func smudgeSecrets(accounts accountList) accountList { | |||
return accounts | |||
} | |||
|
|||
func ListAccounts(json bool) { | |||
accounts := smudgeSecrets(findAccounts()) | |||
func ListAccounts(json bool, secrets bool) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Likewise here showSecrets
would be a better variable name.
accounts := findAccounts() | ||
|
||
// Smudge secrets by default, unless explicitly requested otherwise | ||
if !(json && secrets) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The condition is right, but reading it that way was a bit confusing the first time I read it.
I'd probably write it as: if !showSecrets || !json
to understand in both cases it'd enter it a bit easier.
rcc conf credentials
with both flags--json
and--showSecrets
the output JSON will contain the un-smudged secret values