Comments (11)
They are generated using:
random_str = base64.urlsafe_b64encode(os.urandom(9)).decode('ascii')
from ngshare.
@aalmanza1998 can you remind me of how random strings look like?
from ngshare.
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.
from ngshare.
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.
from ngshare.
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.
from ngshare.
What would that ID consist of?
from ngshare.
uuid is a good choice
from ngshare.
From python help:
# make a random UUID
>>> uuid.uuid4() # doctest: +SKIP
UUID('16fd2706-8baf-433b-82eb-8c7fada847da')
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.
from ngshare.
@Lawrence37 are you having issues with notebook_hash
or make_unique_key
or are you just looking at alternatives?
from ngshare.
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.
from ngshare.
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.
from ngshare.
Related Issues (20)
- Review ecs193-final-report HOT 3
- When to release a new version HOT 3
- PostgreSQL support HOT 6
- Travis deployment failing HOT 3
- ngshare v0.5.2 deployment specification error HOT 6
- ngshare Pends Forever? HOT 17
- Isolate helm chart from ngshare app
- Documentation on Multiple Graders using ngshare? HOT 4
- Question:ngshare in Docker? HOT 2
- Cannot launch pod in GKE: ReadWriteMany not supported HOT 2
- ngshare blocks and restarts when accessed HOT 2
- Travis CI seems scuffed
- Readiness probe failed on deploying in same namespace HOT 3
- Checkpoint File Caused ngshare Error and No nbgrader Warnings
- Is this still be developed or supported? HOT 1
- Help: endpoint is deprecated HOT 6
- Compatibility with nbgrader 0.7.1 HOT 2
- Help:Adding Multiple Students to the Couse Api not accepting the body. HOT 3
- Proposed JupyterHub 3.0 Singleuser Dockerfile HOT 1
- ngshare is ignoring c.CourseDirectory.ignore? HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ngshare.