Skip to content

Commit

Permalink
handle empty live keys (#1040)
Browse files Browse the repository at this point in the history
  • Loading branch information
etsai-stripe committed Feb 28, 2023
1 parent 9e49354 commit bcd1a90
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions pkg/config/profile.go
Original file line number Diff line number Diff line change
Expand Up @@ -367,6 +367,11 @@ func (p *Profile) redactAllLivemodeValues() {
// if the config file has expires at date, then it is using the new livemode key storage
if viper.IsSet(p.GetConfigField(LiveModeAPIKeyName)) {
key := viper.GetString(p.GetConfigField(LiveModeAPIKeyName))
if key == "" || len(key) < 12 {
p.DeleteConfigField(LiveModeAPIKeyName)
return
}

if !isRedactedAPIKey(key) {
fmt.Println(color.Yellow(`
(!) Livemode value found for the field '` + LiveModeAPIKeyName + `' in your config file.
Expand Down

0 comments on commit bcd1a90

Please sign in to comment.