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

User profile endpoint returns information for non-logged in user when authenticating via a token. #794

Open
pgulley opened this issue Sep 23, 2024 · 3 comments
Assignees
Labels
api Issues or improvements related to the backend api medium medium priority

Comments

@pgulley
Copy link
Member

pgulley commented Sep 23, 2024

As written in the title- invoking user_profile (which hits '/auth/profile' returns a functionally null response instead of the full user profile information.

import mediacloud.api token = ################ search_api = mediacloud.api.SearchApi(token) print(search_api.user_profile())
>> {'isActive': False}

It returns this value whether or not the provided token is valid.

@pgulley pgulley added medium medium priority api Issues or improvements related to the backend api labels Sep 23, 2024
@Evan-Leon
Copy link
Contributor

I believe @rahulbot raised some concerns #763 (comment) about potential security risks, but I am open to making it more functional

@pgulley
Copy link
Member Author

pgulley commented Sep 23, 2024

The use-case is that we want to be able to identify what permissions a user has based on their token- so some kind of id and all of the user permissions should be able to be returned here!
Getting the email would be nice too- I'd like to be able to auto-populate user emails for sous-chef, but that's easy enough to have users provide themselves, since I think there is legitimate concern about that.

Per @rahulbot's concerns though, I do agree that everything else should be kept back.

@philbudne
Copy link
Contributor

philbudne commented Sep 23, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api Issues or improvements related to the backend api medium medium priority
Projects
None yet
Development

No branches or pull requests

3 participants