-
Notifications
You must be signed in to change notification settings - Fork 35
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
Added Configuration#validate_subscription! #190
Conversation
fb02d42
to
8089992
Compare
@bzwei First attempt. What do you think? |
@djberg96 since configuration constructor already validate tenant ID, client ID/key, why don't we include validation of subscription ID there without making it an explicitly call for user? |
@bzwei I'm ok with an up-front validation, but it does mean an extra http request they wouldn't otherwise need to make. |
I am voting for this solution because it makes the validation behaviors the same for all user provided IDs. |
9920f0b
to
b09ddae
Compare
b09ddae
to
bceda57
Compare
@bzwei I updated the code to validate the subscription in the constructor and updated the specs. |
bceda57
to
492d161
Compare
Automatically perform subscription_id validation in the constructor instead of making it a separate, optional method. Update spec_helper.rb to stub validate_subscription, and update subscription_id test.
492d161
to
9af45f1
Compare
Checked commit djberg96@9af45f1 with ruby 2.2.5, rubocop 0.37.2, and haml-lint 0.16.1 lib/azure/armrest/configuration.rb
|
This adds a Configuration#validate_subscription! method, and addresses #189.
The main issue is that the constructor effectively does a validation check for tenant ID, client ID and client key via the
fetch_providers
method, but it does not validate the subscription. This method allows users to explicitly validate the subscription and/or check to ensure that it's enabled.