Create new user with a random password#1174
Conversation
Codecov Report
@@ Coverage Diff @@
## develop #1174 +/- ##
===========================================
- Coverage 28.77% 28.75% -0.03%
===========================================
Files 414 415 +1
Lines 12752 12760 +8
===========================================
- Hits 3670 3669 -1
- Misses 9082 9091 +9
Continue to review full report at Codecov.
|
|
|
||
| class BackdoorUser(PBA): | ||
| def __init__(self): | ||
| remote_user_pwd = get_random_password() |
There was a problem hiding this comment.
Would be more readable if called random_password, because that's what it is in this context. It's not a password of remote user yet and pwd is not consistent (also means print working directory), either ..._pass or ..._password
| @@ -0,0 +1,6 @@ | |||
| import secrets | |||
|
|
|||
There was a problem hiding this comment.
Create a constant here, called SECRET_BYTE_LENGTH and set it to 32. Then use this constant as a default parameter in get_random_password. 12 bytes is not enough.
Fixes #1169
PR Checklist
Was the documentation framework updated to reflect the changes?Testing Checklist
Added relevant unit tests?If applicable, add screenshots or log transcripts of the feature working