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

EUMAPI: User master api key in user resource (now only in users list) #15102

Closed
pcaro opened this issue Sep 23, 2019 · 3 comments · Fixed by #15107
Closed

EUMAPI: User master api key in user resource (now only in users list) #15102

pcaro opened this issue Sep 23, 2019 · 3 comments · Fixed by #15107
Assignees

Comments

@pcaro
Copy link

pcaro commented Sep 23, 2019

Context

Using EUMAPI to create and manage users on a external app control panel.

Steps to Reproduce

Now user api (field api_key) is present in user list results <org>.carto.com/u/<org_owner>/api/v2/organization/dev/users/ , but not in user detail <org>.carto.com/u/<org_owner>/api/v2/organization/dev/users/<user>/

We need to get that master key to get later other user api keys using Auth API or to fake the user to call /me due to #15101

We need to call users endpoind and search the user now, which is slow an error prone.

Please, include that field on user detail endpoint too.

@pcaro
Copy link
Author

pcaro commented Sep 23, 2019

@alrocar We talk about this too

@alrocar alrocar self-assigned this Sep 23, 2019
@alrocar
Copy link
Contributor

alrocar commented Sep 23, 2019

Actually, getting the master API key from the list endpoint is a bug in the first place 😱

Both methods index and show should return the same data, and that data does not include the user master api key.

See this piece of code. If you look at the show method, both delegate to UserPresenter to_eumapi_poro method.

Looks like the iterator in index is returning all the users data.

cc. @gonzaloriestra

@gonzaloriestra
Copy link
Contributor

Yep, that looks like a bug.

It should be .map instead of .each here:

presentations = @organization.users.each do |user|

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

Successfully merging a pull request may close this issue.

3 participants