As a CE Admin I don’t appear to have a way to set a default password configuration (I like to have 26 chars instead of 18, and remove of few of the difficult to read character classes) so I don’t have to set them each time. I understand as adin in Pro Edition you can do this.
I’m reporting this because until I observed how you did a typecase on instantiation of the object, you didn’t do it in this Model/Dto initialization code. When I added the bool and int typecasts (and my additional tweaks for a default) … it all works now.
I tried to report this in the github but you have to be a “collaborator” to do a pull request (which I am not at this time).
Here is my diff of the file I changed at:
/usr/share/php/passbolt/plugins/PassboltCe/PasswordPolicies/src/Model/Dto/PasswordGeneratorSettingsDto.php (nice!)
diff PasswordGeneratorSettingsDto.php.orig PasswordGeneratorSettingsDto.php
156,167c156,167
< ‘length’ => 18,
< ‘mask_upper’ => true,
< ‘mask_lower’ => true,
< ‘mask_digit’ => true,
< ‘mask_parenthesis’ => true,
< ‘mask_emoji’ => false,
< ‘mask_char1’ => true,
< ‘mask_char2’ => true,
< ‘mask_char3’ => true,
< ‘mask_char4’ => true,
< ‘mask_char5’ => true,
< ‘exclude_look_alike_chars’ => true,
'length' => (int)26, 'mask_upper' => (bool)true, 'mask_lower' => (bool)true, 'mask_digit' => (bool)true, 'mask_parenthesis' => (bool)false, 'mask_emoji' => (bool)false, 'mask_char1' => (bool)true, 'mask_char2' => (bool)false, 'mask_char3' => (bool)false, 'mask_char4' => (bool)true, 'mask_char5' => (bool)true, 'exclude_look_alike_chars' => (bool)true,
179,190c179,190
< ‘length’ => $this->length,
< ‘mask_upper’ => $this->mask_upper,
< ‘mask_lower’ => $this->mask_lower,
< ‘mask_digit’ => $this->mask_digit,
< ‘mask_parenthesis’ => $this->mask_parenthesis,
< ‘mask_emoji’ => $this->mask_emoji,
< ‘mask_char1’ => $this->mask_char1,
< ‘mask_char2’ => $this->mask_char2,
< ‘mask_char3’ => $this->mask_char3,
< ‘mask_char4’ => $this->mask_char4,
< ‘mask_char5’ => $this->mask_char5,
< ‘exclude_look_alike_chars’ => $this->exclude_look_alike_chars,
'length' => (int)$this->length, 'mask_upper' => (bool)$this->mask_upper, 'mask_lower' => (bool)$this->mask_lower, 'mask_digit' => (bool)$this->mask_digit, 'mask_parenthesis' => (bool)$this->mask_parenthesis, 'mask_emoji' => (bool)$this->mask_emoji, 'mask_char1' => (bool)$this->mask_char1, 'mask_char2' => (bool)$this->mask_char2, 'mask_char3' => (bool)$this->mask_char3, 'mask_char4' => (bool)$this->mask_char4, 'mask_char5' => (bool)$this->mask_char5, 'exclude_look_alike_chars' => (bool)$this->exclude_look_alike_chars,
Interested to see what you think and if you like I could add it to a pull request if you want to make the change to your source code (you probably don’t want to use my tweaks)