-
Notifications
You must be signed in to change notification settings - Fork 572
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
API key validation #1520
API key validation #1520
Conversation
@ob-stripe I don't think we should limit to alphanumeric and underscore. The current ongoing project internally actively considered adding a dash or another character to the API key. We ended up not doing it, but we might in the future and we don't want stripe-dotnet to be extremely strict on that front. |
12506e3
to
c246826
Compare
I've updated the validation to only check for whitespace characters. ptal @remi-stripe |
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.
Minor comments but feel free to self-approve/merge
c246826
to
40a4237
Compare
@ob-stripe Added a comment, feel free to self-approve |
8069bd3
to
7f5f789
Compare
40a4237
to
c2fc649
Compare
5a3595f
to
130a982
Compare
c2fc649
to
4822ced
Compare
012aff1
to
c2d568c
Compare
bb4cef5
to
6ea5e97
Compare
@remi-stripe Sorry for the back and forth here, but mind taking another look at this PR? I've updated it to be consistent with what we do in stripe-ruby (https://github.com/stripe/stripe-ruby/blob/65cc6998329cfff8c7ae3df1090116fd6764699a/lib/stripe/stripe_client.rb#L236-L251). I think it's better this way since we only need to check the key in one place. |
6ea5e97
to
fb63eb1
Compare
r? @remi-stripe
Validates API keys that are passed to
StripeConfiguration.ApiKey = key;
,new SomeService(key)
andnew RequestOptions { ApiKey = key }
. If the key contains invalid characters (anything other than alphanumeric characters or underscores), an exception is raised.Partially fixes #1507.