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

Allow to pass nil to client_id arg of device_credentials #321

Merged
merged 2 commits into from
Mar 4, 2022

Conversation

shibayu36
Copy link
Contributor

@shibayu36 shibayu36 commented Mar 3, 2022

closes #319

Changes

I changed to allow to pass nil to client_id arg of device_credentials, related to discussions in #319

We can use device_credentials method like the following

client.device_credentials # Fetch all device_credentials on the specified tenant
client.device_credentials('client_id') # Fetch device_credentials related to specified client_id
client.device_credentials(nil, user_id: 'user_id') # Fetch device_credentials related to specified user_id

I considered to change the interface like Auth0::Api::V2::Grants#grants, but it will break backwards compatibility, and it is the refactoring issue. So I only changed to allow client_id to receive nil.

References

#319

Testing

Please describe how this can be tested by reviewers. Be specific about anything not tested and reasons why. If this library has unit and/or integration testing, tests should be added for new functionality and existing tests should complete without errors.

  • This change adds unit test coverage
  • This change adds integration test coverage
  • This change has been tested on the latest version of Ruby

Checklist

  • I have read the Auth0 general contribution guidelines
  • I have read the Auth0 Code of Conduct
  • All existing and new tests complete without errors
  • Rubocop passes on all added/modified files
    • I found some offenses by rubocop in lib/auth0/api/v2/device_credentials.rb and spec/lib/auth0/api/v2/device_credentials_spec.rb. But I left it at that because there were originally many offenses
  • All active GitHub checks have passed

Copy link
Contributor

@stevehobbsdev stevehobbsdev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good - thanks again for your contribution!

@stevehobbsdev stevehobbsdev added this to the vNext milestone Mar 4, 2022
@stevehobbsdev stevehobbsdev enabled auto-merge (squash) March 4, 2022 10:17
@stevehobbsdev stevehobbsdev merged commit 321066a into auth0:master Mar 4, 2022
@stevehobbsdev stevehobbsdev mentioned this pull request Mar 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants