-
Notifications
You must be signed in to change notification settings - Fork 389
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
show warning for old livemode values #919
Conversation
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.
LGTM! Just had a couple questions for clarity.
(!) Livemode value found for the field '` + LiveModeAPIKeyName + `' in your config file. | ||
Livemode values from the config file will be redacted and will not be used.`)) | ||
|
||
p.WriteConfigField(LiveModeAPIKeyName, RedactAPIKey(key)) |
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.
Should we redact LiveModePubKeyName too?
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.
i did that at first but tomer said we should leave out publishable key since its public facing, which makes sense
@@ -139,7 +139,8 @@ func (p *Profile) GetAPIKey(livemode bool) (string, error) { | |||
key = viper.GetString(p.GetConfigField(TestModeAPIKeyName)) | |||
} | |||
} else { | |||
key, err = p.RetrieveLivemodeValue(LiveModeAPIKeyName) | |||
p.redactAllLivemodeValues() |
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.
Would the values already be redacted by this point? Is this call defensive?
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.
yes its a defensive check in case user manually edits the config tom file again
Reviewers
r? @vcheung-stripe
cc @stripe/developer-products
Summary