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
Allow admin to create users without password by sending mail automatic… #8856
Conversation
throw new OCSException('To send a password link to the user an email address is required.', 108); | ||
} | ||
|
||
$password = $this->secureRandom->generate(30); |
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.
30?!? Don't overcomplicate things 😅
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.
But... that is only 1532495540865888858358347027150309183618739122183602176 possibilities!
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.
X)
Do we want to be secure or not!!?? :D
7559c7d
to
73682c2
Compare
Codecov Report
@@ Coverage Diff @@
## master #8856 +/- ##
============================================
- Coverage 51.88% 6.85% -45.03%
- Complexity 25269 25273 +4
============================================
Files 1603 1603
Lines 94878 94899 +21
Branches 1388 1388
============================================
- Hits 49229 6508 -42721
- Misses 45649 88391 +42742
|
73682c2
to
3bba48d
Compare
47bae0c
to
c3f9c7e
Compare
|
||
$password = $this->secureRandom->generate(10); | ||
// Make sure we pass the password_policy | ||
$password .= $this->secureRandom->generate(2, '$!.,;:-~+*[]{}()'); |
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.
well this is only 'kind of' true. We don't know if this will pass the password policy test because we don't know what it is set to.
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.
Nothing you can fix here. But still
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.
I used old code, so I'm to blame here :D
To be fair, the goal is to create a secure password that no one will know about since the user will receive a mail to reset it. I suggest we remove the special char part and only use a 15 length generation.
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.
Then this might fail hard when using the password_policy app ;) But like I said fine by me. Lets do this for now.
* @param array $groups | ||
* @return DataResponse | ||
* @throws OCSException | ||
*/ | ||
public function addUser(string $userid, string $password, array $groups = []): DataResponse { | ||
public function addUser(string $userid, string $password = '', $email='', array $groups = []): DataResponse { |
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.
string $email = ''
02f1087
to
bcca3e0
Compare
…ally Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
bcca3e0
to
41b690e
Compare
I think the failure is unrelated! |
…ally
Required by #8824