Skip to content

Commit

Permalink
Credhub CLI no longer writes credentials to terminal during the
Browse files Browse the repository at this point in the history
regenerate operation

[#157789350] CredHub CLI does not write credentials to terminal during regenerate operation

Signed-off-by: Chhavi Kankaria <[email protected]>
  • Loading branch information
Mo Lambo authored and chhhavi committed May 31, 2018
1 parent 0669050 commit c360e74
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions commands/regenerate.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ func (c *RegenerateCommand) Execute([]string) error {
return err
}

credential.Value = "<redacted>"
printCredential(c.OutputJSON, credential)

return nil
Expand Down
4 changes: 2 additions & 2 deletions commands/regenerate_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ var _ = Describe("Regenerate", func() {
Eventually(session).Should(Exit(0))
Eventually(session.Out).Should(Say("name: my-password-stuff"))
Eventually(session.Out).Should(Say("type: password"))
Eventually(session.Out).Should(Say("value: nu-potatoes"))
Eventually(session.Out).Should(Say("value: <redacted>"))

})

Expand All @@ -53,7 +53,7 @@ var _ = Describe("Regenerate", func() {
session := runCommand("regenerate", "--name", "my-password-stuffs", "--output-json")

Eventually(session).Should(Exit(0))
Expect(string(session.Out.Contents())).To(MatchJSON(fmt.Sprintf(STRING_CREDENTIAL_RESPONSE_JSON, "password", "my-password-stuffs", "nu-potatoes")))
Expect(string(session.Out.Contents())).To(MatchJSON(fmt.Sprintf(STRING_CREDENTIAL_RESPONSE_JSON, "password", "my-password-stuffs", "<redacted>")))
})

It("prints error when server returns an error", func() {
Expand Down

0 comments on commit c360e74

Please sign in to comment.