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

GetUser method should handle params #8

Closed
Seraf opened this issue Aug 8, 2016 · 2 comments
Closed

GetUser method should handle params #8

Seraf opened this issue Aug 8, 2016 · 2 comments
Assignees

Comments

@Seraf
Copy link
Member

Seraf commented Aug 8, 2016

Hello,

On auth0 API specs, there's some fields to pass through the params to return a subset of users : https://auth0.com/docs/api/management/v2#!/Users/get_users

The GetUser method should handle an optional params map to be able to filter the users returned

@xlr-8 xlr-8 self-assigned this Aug 8, 2016
@Seraf Seraf changed the title GetUser method should handle a body GetUser method should handle params Aug 8, 2016
@xlr-8
Copy link
Contributor

xlr-8 commented Aug 10, 2016

The GetUsers method already take a params variable: https://github.com/cycloidio/goat/blob/develop/auth0/users.go#L30-L32. However I don't think it is tested yet, so should be added.

@xlr-8
Copy link
Contributor

xlr-8 commented Aug 10, 2016

I think indeed the BuildParamsURL function is incorrect, I think it should looks like something like this:

-   for _, val := range params {
-       params_url += "?" + val
+   for key, val := range params {
+       params_url += "?" + key + "=" + val

Seraf added a commit that referenced this issue Sep 23, 2016
The old method wasn't injecting key into the url and wasn't handling multiple parameters.
By using the net/url library, we can encode correctly a map of parameters and craft the right url.

This commit fix #8
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