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

Adding authorization for results and users api #85

Merged
merged 5 commits into from Mar 8, 2022
Merged

Conversation

johnugeorge
Copy link
Contributor

Added authorisation checks for results and users api

@github-actions
Copy link
Contributor

github-actions bot commented Mar 7, 2022

MLCommons CLA bot All contributors have signed the MLCommons CLA ✍️ ✅

Copy link
Contributor

@aristizabal95 aristizabal95 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Permissions look good. I had a doubt regarding the users GET views. Swagger shows that responses include password, but it is not included (thankfully) as part of the response. Do you know why the discrepancy there?

@johnugeorge
Copy link
Contributor Author

johnugeorge commented Mar 7, 2022

@aristizabal95 password field is write only and hence it won't be retrieved on any read.
https://github.com/mlcommons/medperf/blob/main/server/user/serializers.py#L12

Regarding swagger views, it looks like swagger package has the limitation - axnsan12/drf-yasg#70
Related: https://stackoverflow.com/questions/51285717/drf-write-only-true-displays-in-response-schema

We can work with another swagger generator in the future - https://github.com/tfranzel/drf-spectacular

@aristizabal95 aristizabal95 merged commit 4e1a49b into main Mar 8, 2022
@github-actions github-actions bot locked and limited conversation to collaborators Mar 8, 2022
@aristizabal95 aristizabal95 deleted the apiauth branch May 13, 2022 14:20
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants