Add more characters with Nethserver::password

With Nethserver::password you cannot set the number of characters of your password. I need more than 16 characters :slight_smile:

The developer should be able to decide how much long must be his password.

Hi @stephdl, there is plenty of options in the object constructor, length included :blush:

yep but nothing to use it with something like that

my $password = NethServer::Password::store(‘mysql’,‘length’=>‘64’);

Or I can go to sleep :wink:

Grab this line

And add the second argument for new()

new('mysql', { length => 24 })
1 Like

perldoc :slight_smile:

I gladly accept Pull Requests tonight :kissing_closed_eyes:

1 Like

Ok, I will test it firstly, I will have other questions later about users authentication. With the two authentication methods I have a bit lost my Latin language.

Even When I reset the password by removing the older in /var/lib/nethserver/secrets/blowfishsecret I have all the time a new password set to 16 characters :frowning:

Odd ?

I cannot check it now, please be patient :pray:

Could you share a code snippet?

1 Like
if (("$multiaccess" eq "enabled"))
  {
  $OUT .="\$cfg['Servers'][\$i]['auth_type'] = 'cookie';\n";
    my $blowfishsecret = NethServer::Password::store('blowfishsecret', { 'length' => 128 } ) || die('Could not generate blowfishsecret!');
    $OUT .="\$cfg['blowfish_secret'] = '$blowfishsecret';\n";
  }

See you tomorrow

As said above, use new() not store()

NethServer::Password->new( 'blowfishsecret', { 'length' => 64 }) ->save()->getAscii()

Yep it works, something more simple could be welcome, or at least a perldoc complete page

Merci en tout cas (Thank a lot)

Agree! That call seems voodoo to me … :open_mouth:

1 Like

Mate, don’t you appreciate self-documenting method chaining? :nerd:

a bit of perldoc done

3 Likes