Skip to content

Commit 7ba284f

Browse files
committed
Obfuscate Doppler token for doppler configure --all
1 parent 2537224 commit 7ba284f

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

pkg/cmd/configure.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ var configureCmd = &cobra.Command{
3737
jsonFlag := utils.OutputJSON
3838

3939
if all {
40-
printer.Configs(configuration.AllConfigs(), jsonFlag)
40+
printer.Configs(configuration.AllConfigs(), jsonFlag, true)
4141
return
4242
}
4343

pkg/printer/config.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ func ScopedConfigValues(conf models.ScopedOptions, args []string, values map[str
133133
}
134134

135135
// Configs print configs
136-
func Configs(configs map[string]models.FileScopedOptions, jsonFlag bool) {
136+
func Configs(configs map[string]models.FileScopedOptions, jsonFlag bool, obfuscateToken bool) {
137137
if jsonFlag {
138138
JSON(configs)
139139
return
@@ -145,6 +145,10 @@ func Configs(configs map[string]models.FileScopedOptions, jsonFlag bool) {
145145

146146
for name, value := range pairs {
147147
if value != "" {
148+
if obfuscateToken && name == models.ConfigToken.String() {
149+
value = utils.RedactAuthToken(value)
150+
}
151+
148152
translatedName := configuration.TranslateConfigOption(name)
149153
rows = append(rows, []string{translatedName, value, scope})
150154
}

0 commit comments

Comments
 (0)