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

API key validation requirements #327

Closed
scarroll32 opened this issue Sep 28, 2017 · 8 comments
Closed

API key validation requirements #327

scarroll32 opened this issue Sep 28, 2017 · 8 comments
Assignees

Comments

@scarroll32
Copy link
Contributor

scarroll32 commented Sep 28, 2017

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:

  • dev_api_key
  • challenge_client_id
  • score
  • score_secondary (optional)
  • comment (markdown - optional - made by participant)
  • grading_status ('graded' | 'failed')
  • grading_message (required for grading_status = failed)

returns:

  • submission_id
  • submissions_remaining (today)
  • submission_reset_dttm (UTC - when the submission count starts again)
  • Admins sent an email

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

  • submission_id (required)
  • media_large
  • media_thumbnail
  • media_content_type
  • grading_status ('graded' | 'failed')
  • grading_message (required for grading_status = failed)

When a submission is regraded the original created_at date is considered. #332

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

returns:

  • submission_id
  • submissions_remaining (today)
  • submission_reset_dttm (UTC - when the submission count starts again)

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
Copy link
Contributor Author

@spMohanty please confirm or correct when you have time.

@spMohanty
Copy link
Member

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
Copy link
Contributor Author

Regarding teams: #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
Copy link
Contributor Author

Linked issue #272

@scarroll32
Copy link
Contributor Author

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

@scarroll32
Copy link
Contributor Author

#325

@scarroll32
Copy link
Contributor Author

Ready

@scarroll32
Copy link
Contributor Author

Implemented.

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

No branches or pull requests

2 participants