Skip to content
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

Merged
merged 3 commits into from
Aug 2, 2022
Merged

show warning for old livemode values #919

merged 3 commits into from
Aug 2, 2022

Conversation

etsai-stripe
Copy link
Contributor

@etsai-stripe etsai-stripe commented Jul 22, 2022

Reviewers

r? @vcheung-stripe
cc @stripe/developer-products

Summary

Copy link
Collaborator

@vcheung-stripe vcheung-stripe left a 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))
Copy link
Collaborator

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?

Copy link
Contributor Author

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()
Copy link
Collaborator

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?

Copy link
Contributor Author

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

@etsai-stripe etsai-stripe merged commit 8697518 into master Aug 2, 2022
@etsai-stripe etsai-stripe deleted the etsai/dx7559 branch September 6, 2022 16:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants