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

No method to get all resource servers #154

Closed
6 tasks done
philomory opened this issue Jan 15, 2019 · 3 comments
Closed
6 tasks done

No method to get all resource servers #154

philomory opened this issue Jan 15, 2019 · 3 comments
Milestone

Comments

@philomory
Copy link
Contributor

Description

There's no method in the gem to get a list of all resource servers (e.g. to call GET /api/v2/resource-servers); corresponding methods exist for other endpoints such as Clients.

I have a PR ready to implement this change, but the contributing guidelines instruct to open an issue first, so, that's what I'm doing.

Prerequisites

Environment

Please provide the following:

  • Ruby Auth0 version: 4.6.0
  • Ruby version: 2.4.4p296
  • Rails version (if applicable): N/A
  • Browser version (if applicable): N/A
  • Additional gems that might be affecting your instance: N/A

Reproduction

irb(main):001:0> connection = Auth0::Client.new(...)
irb(main):002:0> apis = connection.resource_servers
NoMethodError: undefined method `resource_servers' for #<Auth0::Client:0x0000000002e740a8>
Did you mean? resource_server
@joshcanhelp
Copy link
Contributor

Thank you @philomory! We'd be glad to accept a PR for this. A few things to keep in mind when you put this together:

  • Unit tests should be included, go ahead and use one of the other endpoints as a template for that.
  • Integration tests are appreciated but not required. If you do tackle integration tests, you'll need to uncomment this line so VCR can make an HTTP recording. Once everything is working and passing, comment it out again and run the tests once more to make sure no HTTP connections are made.

@philomory
Copy link
Contributor Author

So, I've written unit tests based on the existing tests for other endpoints, and I've written what I believe will be appropriate integration tests, but as far as I can tell it's impossible for me to successfully run the integration tests without some configuration data that isn't available to me (specifically I think it's the info needed to access the auth0-sdk-tests account). Is there any documentation on running the integration tests? When I run bundle exec rake integration they all fail, across the board.

@joshcanhelp
Copy link
Contributor

@philomory - I really need to have some contribution docs in here ... again, apologies for the gap there.

All you need is a .env file in the gem folder with:

  • DOMAIN
  • CLIENT_ID
  • CLIENT_SECRET
  • MASTER_JWT

... for a test Application that is authorized for the Management API. All the other tests will use HTTP recordings but your tests will run live.

That said, feel free to just put through the PR and let CI run the tests for you with our stored credentials!

Thanks again!

@philomory philomory mentioned this issue Jan 19, 2019
8 tasks
@joshcanhelp joshcanhelp added this to the v4.7.0 milestone Jan 23, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants