]> source.dussan.org Git - gitblit.git/commit
Add a PasswordHash class as a central place to deal with password hashes.
authorFlorian Zschocke <florian.zschocke@devolo.de>
Tue, 5 Nov 2019 12:06:07 +0000 (13:06 +0100)
committerFlorian Zschocke <florian.zschocke@devolo.de>
Tue, 5 Nov 2019 12:06:07 +0000 (13:06 +0100)
commit4068b152e530305f588bd56e753045936e87ede0
treed564e1914b06a5f4ceaba4b8485722f39561646d
parentc7f75029fc4da931c16dfe24764656f28c2ca399
Add a PasswordHash class as a central place to deal with password hashes.

Instead of having to deal with the implementation details of hashing
and verifying passwords in multiple places, have a central unit
be responsible for it. Otherwise we need to edit three different places
when adding a new hashing scheme.
With this class adding a new hashing scheme just requires creating a
new subclass of `PasswordHash` and registering its type in the enum
`PasswordHash.Type`.
The rest of the code will use a common interface for all hashing
schemes and doesn't need to be changed when a new one is added.
src/main/java/com/gitblit/utils/PasswordHash.java [new file with mode: 0644]
src/test/java/com/gitblit/utils/PasswordHashTest.java [new file with mode: 0644]