-
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Bugfix: set username to random string if missing in RestWrite #341
Bugfix: set username to random string if missing in RestWrite #341
Conversation
…rname to random string if missing
Can you add a test which checks this and makes 2 anon users? |
@steven-supersolid updated the pull request. |
I added a test but have a couple of questions on this:
|
Most of the existing tests are ported from older code, and while their location might have made sense at the time, they aren't necessarily using great conventions right now, so please don't feel obliged to stick to the existing convention. There was a bug where creating a second anonymous user would fail due the unique username check and them both having a username of |
@steven-supersolid updated the pull request. |
Bugfix: set username to random string if missing in RestWrite
var chars = ('ABCDEFGHIJKLMNOPQRSTUVWXYZ' + | ||
'abcdefghijklmnopqrstuvwxyz' + | ||
'0123456789'); | ||
var objectId = ''; | ||
var bytes = crypto.randomBytes(10); | ||
var bytes = crypto.randomBytes(size); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For the modulo bias, we could chars+chars+chars+chars + 8 random.
No description provided.