-
Notifications
You must be signed in to change notification settings - Fork 17
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
Include random str in responses when listing submissions #10
Comments
@aalmanza1998 can you remind me of how random strings look like? |
They are generated using: |
Is the random string really necessary in ngshare? It seems like it's only used to prevent unauthorized access to submissions. ngshare should be able to do that without a random string. |
We may want to prevent the case that a student submits two requests at the same time and accidentally generates two submissions with the same timestamp (Though it is very likely, I think there is no guarantee that the timestamps will be always different). So adding a random string can decrease this possibility of collision further. |
The timestamp has microsecond precision, so it's extremely unlikely that there will be duplicate timestamps. If we are really so concerned about such a rare event, we should generate a unique submission ID for each submission and use that instead of a random number. |
What would that ID consist of? |
uuid is a good choice |
From python help:
It seems to be almost collision-free. e.g. https://softwareengineering.stackexchange.com/a/130298 I think you can first continue working with the current random string. Changing this should be easy in backend and require no work in frontend. |
@Lawrence37 are you having issues with |
Part of it is that retrieved submissions don't store the random string, and consequently, releasing feedback lacks the required random string. It would be great if we don't introduce a way to store the string in the filesystem so that we can maintain maximum compatibility with the current exchange. The other reason is to avoid unnecessary clutter in the API. |
I kind of understand. Can you demonstrate it more tomorrow during / after the meeting? If reasonable I think we can remove random str from API. |
We need to include the random str in the responses of
/api/submissions/<course_id>/<assignment_id>/<student_id>
andGET /api/submissions/<course_id>/<assignment_id>
The text was updated successfully, but these errors were encountered: