If using D2PAEP::LDAP, and show_errors is enabled in D2 (for example, if using the 'development' environment), the bindpw is displayed on the error page if a 500 error occurs. Other passwords from the config file will show "'Hidden (looks potentially sensitive)',".
It looks like D2 uses the following to determine if it should hide the password:
elsif ( $key =~ /(pass|card?num|pan|secret)/i )
Note that this occurs not because D2 is dumping the object, but because it is dumping the information from the configuration file(s).
I can submit a PR for this if you like. My thought is that the best solution is:
- Create a new attribute of 'bindpass'.
- Change bindpw to lazy build (just make it $self->bindpass)
I think this will allow bindpass to gracefully replace bindpw (that is to say, it won't break backwards compatibility.
I will probably open a ticket against Dancer2, asking for 'bindpw' to be added to that list as well.
Let me know your thoughts. Thank you.