-
Notifications
You must be signed in to change notification settings - Fork 447
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
Token Mechanism #2453
Token Mechanism #2453
Conversation
that is considered cryptographically secure. This required adding the random_compat library (MIT License) to provide support for PHP versions before 7.
Add script that will delete expired tokens once a day
…d when team is created
The design of this was documented under "Token Generation" and "Token Usage" here: https://boinc.berkeley.edu/trac/wiki/RightToErasure#TokenGeneration (which is the full design document for issue #2447 ) |
PHP provides a function for making crypto-secure random strings: |
This code uses http://php.net/manual/en/function.random-bytes.php which is also a PHP function and is recommended as superior to openssl-random-psuedo-bytes.php. The inclusion of https://github.com/paragonie/random_compat is recommended on the php.net website with this comment under the description of random-bytes again see http://php.net/manual/en/function.random-bytes.php
There are lots of recommendations that direct people to use random-bytes.php as preferred over openssl-random-psuedo-bytes.php |
@davidpanderson - do you have any other objections or can you go ahead and merge this? |
Looks good; sorry for the delay. Small note: at some point I started using "double" for unix timestamps because of 2038. |
Sorry for being late. You allow |
@JuhaSointusalo - Yes - I wanted to allow for tokens that do not expire. |
@TheAspens Ok, thanks for explaining. I'm not sure if looking up valid non-expiring tokens works but I suppose that can wait until the more urgent stuff is done. |
This pull request updates the method for creating random strings (tokens) to use cryptographically secure functions and it adds a token table and functions for interacting with the table. This will be used by both issue #2447 and issue #2451