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

Validate client configuration parameters #907

Merged
merged 1 commit into from
Apr 1, 2020

Conversation

ob-stripe
Copy link
Contributor

r? @remi-stripe
cc @stripe/api-libraries

Validate the $config parameter passed to StripeClient's constructor:

  • validates that it's either a string or an array
  • validates that the values in the array have the expected type (right now all values either strings, or nullable strings)
  • do more advanced validation for the API key
  • validate that there are no unexpected keys in the array

I'm not a huge fan of this sort of runtime type checking, but I think it's helpful for the StripeClient constructor to ensure users set a valid configuration.

@stripe-ci stripe-ci assigned ob-stripe and unassigned remi-stripe Apr 1, 2020
@ob-stripe ob-stripe merged commit 95a1cf8 into integration-services Apr 1, 2020
@ob-stripe ob-stripe deleted the ob-validate-client-config branch April 1, 2020 01:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants