Merge pull request #7739 from hashicorp/fix_7728

apply logSecretFilter to output from ui.Say
This commit is contained in:
Adrien Delorme 2019-06-12 11:01:25 +02:00 committed by GitHub
commit f097deab3b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 0 deletions

View File

@ -238,6 +238,13 @@ func (rw *BasicUi) Say(message string) {
rw.l.Lock()
defer rw.l.Unlock()
// Use LogSecretFilter to scrub out sensitive variables
for s := range LogSecretFilter.s {
if s != "" {
message = strings.Replace(message, s, "<sensitive>", -1)
}
}
log.Printf("ui: %s", message)
_, err := fmt.Fprint(rw.Writer, message+"\n")
if err != nil {