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

Add missing User Management API endpoints #169

Merged
merged 3 commits into from
Jun 26, 2019

Conversation

joshcanhelp
Copy link
Contributor

@joshcanhelp joshcanhelp commented Jun 11, 2019

Changes

Adds all missing User endpoints:

  • Auth0::Api::V2::Users.get_roles
  • Auth0::Api::V2::Users.remove_roles
  • Auth0::Api::V2::Users.add_roles
  • Auth0::Api::V2::Users.get_enrollments
  • Auth0::Api::V2::Users.get_permissions
  • Auth0::Api::V2::Users.remove_permissions
  • Auth0::Api::V2::Users.add_permissions
  • Auth0::Api::V2::Users.generate_recovery_code
  • Auth0::Api::V2::Users.invalidate_browsers

Testing

Will add integration tests in another PR after Roles

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

Checklist

  • All existing and new tests complete without errors
  • Rubocop passes on all added/modified files
  • All active GitHub checks have passed

@joshcanhelp joshcanhelp added this to the v4.8.0 milestone Jun 11, 2019
@joshcanhelp joshcanhelp force-pushed the add-missing-user-endpoints branch from 6b1d8c0 to c5276bb Compare June 24, 2019 19:34
@joshcanhelp joshcanhelp requested a review from a team June 24, 2019 22:28
@joshcanhelp joshcanhelp marked this pull request as ready for review June 24, 2019 22:28
Copy link
Contributor

@damieng damieng left a comment

Choose a reason for hiding this comment

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

Minor naming nitpicks in the source doc comments.

# @see https://auth0.com/docs/api/management/v2#!/Users/delete_permissions
#
# @param user_id [string] The user_id of the permissions to remove.
# @param permissions [array] An array of Permissions to remove.
Copy link
Contributor

Choose a reason for hiding this comment

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

Random uppercase P on permissions.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

"Permissions" here refers to the struct I made for this PR.

lib/auth0/api/v2/users.rb Outdated Show resolved Hide resolved
lib/auth0/api/v2/users.rb Outdated Show resolved Hide resolved

# Check a permissions array
def validate_permissions_array(permissions)
raise Auth0::InvalidParameter, 'Must supply an array of Permissions' unless permissions.kind_of?(Array)
Copy link
Contributor

Choose a reason for hiding this comment

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

Capitalized Permissions here too should be permissions.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

👆

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants