crowdAI / crowdai

Fighting for Open Science with Open Data
https://www.crowdai.org
GNU Affero General Public License v3.0
149 stars 32 forks source link

API key validation requirements #327

Closed scarroll32 closed 6 years ago

scarroll32 commented 7 years ago

Transferred from Slack

There are three calls needed for the grader.

GET - /api/external_graders/dev_api_key - individual developer auth: organizer API key OR crowdAI API key params: dev_api_key returns: participant_id + 200

GET - /api/external_graders/dev_api_key - team member auth: organizer API key OR crowdAI API key params: team_api_key returns: team leader participant_id + 200

POST - /api/external_graders/ auth: organizer API key params:

returns:

PATCH - /api/external_graders/ auth: organizer API key

When a submission is regraded the original created_at date is considered. https://github.com/crowdAI/crowdai/issues/332

(media fields: they are all populated or none are populated - otherwise there will be an error)

returns:

Error messages

Aside from the HTTP status, there will be a message if there is an error:

"HTTP Token: Access denied." "The API key did not match any participant record." "The Challenge Client Name string did not match any challenge." "Grading status must be one of (graded|failed)" "Submission ID is invalid." "The participant has no submission slots remaining for today." "Grading message must be provided if grading = failed"

scarroll32 commented 7 years ago

@spMohanty please confirm or correct when you have time.

spMohanty commented 7 years ago

yeah the challenge_config would be beneficial.

Also, in the GET - /api/external_graders/dev_api_key call, I think you will also have to think how you can respond back in case of teams, etc. But that can be dealt with, in terms of implementation, later.

For now the rest of the stuff looks great, and we can go ahead with it. 👍

scarroll32 commented 7 years ago

Regarding teams: https://github.com/crowdAI/crowdai/issues/325

As a team has it's own API key, then the user can either submit as an individual using their own key or under the team key. A team key is treated as a participant key, and in effect, the results are stored against the team leader's account.

scarroll32 commented 7 years ago

Linked issue https://github.com/crowdAI/crowdai/issues/272

scarroll32 commented 6 years ago

TODO - need to discuss the passing of the S3 key / url @spMohanty let's discuss next week.

scarroll32 commented 6 years ago

https://github.com/crowdAI/crowdai/issues/325

scarroll32 commented 6 years ago

Ready

scarroll32 commented 6 years ago

Implemented.