Add helper methods, basic tests, usage examples, and rubocop linting … #42
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
…rules. Lint/format all code. Update minimum ruby version and versions used for testing to current supported version list. Update and add missing dependencies for upcoming ruby changes.
Description
Methods added to cover all documented Duo API methods for AdminAPI, AccountsAPI, AuthAPI, and DeviceAPI.
Motivation and Context
This makes it at least slightly nicer to interact with Duo's API rather than crafting and handling raw HTTP requests/responses. These were deliberately written to care about statically required parameters only, simply passing through optional params, and let the bulk of the validation and error messaging to come from the API response. The goal was to make this as "future proof" as possible without having to make changes for every single minute change in the API.
How Has This Been Tested?
This was tested to not break existing use of request(), and a LOT of basic tests were added for all the newly added methods.
Many of the helpers were confirmed with testing against an actual Duo tenant, though it was not practical/feasible to test all of them in this way (e.g. I don't have an account with telephony credits, a directory sync, etc).
Types of Changes