Cloud-CV / evalai-cli

:cloud: :rocket: Official EvalAI Command Line Tool
https://cli.eval.ai
BSD 3-Clause "New" or "Revised" License
55 stars 63 forks source link

Add token collation using server-obtained token #186

Open hkmatsumoto opened 4 years ago

hkmatsumoto commented 4 years ago

This pull request adds an auth token validation that collates with an input token with a token obtained from the server.

This pull request is made to finish the Google Code-in task (https://codein.withgoogle.com/dashboard/task-instances/5898939732066304/)

hkmatsumoto commented 4 years ago

I changed the way to validate the given token. Now set_token() sends a post request to /api/auth/user with the token in header, and if server replies back without errors set_token() assumes the given token is a valid token.

@vkartik97 Could I have your review? Thanks.

hkmatsumoto commented 4 years ago

Code coverage recovered.

yashdusing commented 4 years ago

LGTM 👍 !

hkmatsumoto commented 4 years ago

Thanks for your reviews! I am not in home now, so I will make those changes in 1-2 hours.

hkmatsumoto commented 4 years ago

@vkartik97 @yashdusing @Ram81 Do my changes look good?

hkmatsumoto commented 4 years ago

I am going to bed in a minute, so I create a new commit assuming I should put generate_random_string in evalai/utils/common.py.

pushkalkatara commented 4 years ago

Looks good to me. @vkartik97

hkmatsumoto commented 4 years ago

I made changes accordingly to your reviews. @RishabhJain2018 Please take a look.