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 users-exports endpoint #340

Merged

Conversation

arjenvanderende
Copy link
Contributor

@arjenvanderende arjenvanderende commented Mar 6, 2019

Changes

This PR implements the /api/v2/jobs/users-exports endpoint.

Instead of the approach in #319 this PR uses Auth0RestClient and RetryRestClient which results in a much shorter implementation (i.e. with retry if the rate limit is hit and the management API returns a HTTP 429 response).

References

Fixes #318

Testing

To test the changes in this PR:

  • Checkout this branch

  • Create file test.js in the root directory of this branch with the following contents:

    const src = require("./src");
    const auth0 = new src.ManagementClient({
      "domain": "<domain>",
      "clientId": "<clientId>",
      "clientSecret": "<clientSecret>",
      "scope": "read:users"
    });
    return auth0.exportUsers({ format: "csv", })
      .then(console.log)
      .catch(console.error);

    Make sure to fill out the domain, clientId and clientSecret.

  • Run node test.js

  • Verify that the console output shows a JSON response of a created export job.

  • This change adds unit test coverage

  • This change adds integration test coverage

Checklist

@luisrudge
Copy link
Contributor

Thanks for the PR! 🎉

@luisrudge luisrudge merged commit c7a3745 into auth0:master Mar 9, 2019
@luisrudge luisrudge changed the title Implement users exports endpoint Add users-exports endpoint Mar 9, 2019
@luisrudge luisrudge added this to the v2.14.1 milestone Mar 11, 2019
@arjenvanderende arjenvanderende deleted the implement-users-exports-endpoint branch August 16, 2019 12:49
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.

None yet

2 participants