Password4j/password4j

There is no option to disable console printBanner.

Closed this issue · 4 comments

There is currently no way of disabling the printBanner from showing in console without using a properties file.
To Reproduce
Instantiate password4j classes without a psw4j.properties.
Expected behavior
A way of disabling the printBanner without creating a psw4j.properties.

Environment:

  • OS: MACOS 13
  • JDK 17
    image

thanks!

Hi @drnkwati,

can you give me some context on your application? If you are unable to create a .properties file then an environment variable would be more feasible?

Hi @firaja
Is the printBanner a necessity?
Why not disable it by default or provide an option to disable it after the instantiation.
Regarding context, I am testing in a console app. I usually develop my applications as reusable components or libraries. Password4j is a dependency.
Some developers like myself generally prefer configurations using classes and annotations instead of xml files.

There's no instantiation as it is processed by the classloader, so it's quite hard to do it with an API that makes sense.
If you are developing a console application you can still pack the .properties file in your jar.
The banner, in addition to helping advertise the project, shows which algorithms are supported by the current JDK (e.g. not all the HmacSHA algorithms are equally supported by vendors).

@firaja
I already indicated where to make the change in the picture above. The if statement default can be changed to false. Developers can enable it in the properties file if required.
Unless you insist leaving it is good marketing. I did not star the project because of the existing banner and I believe other developers will agree.
This issue is not a bug fix so I suggest we close it instead of going around in circles.

image

Thanks