I'm using the passay library for validating password against a list of requirements:
<dependencies>
<dependency>
<groupId>org.passay</groupId>
<artifactId>passay</artifactId>
<version>1.4.0</version>
</dependency>
</dependencies>
One of my requirements is that a password must not have any sequence of characters immediately followed by the same sequence. For instance:
- apple: should be rejected because 'p' is followed by another 'p'.
- banana: should be rejected because 'an' is followed by 'an'.
- 123xy123: is ok because '123' is not immediately followed by '123'.
I tried using RepeatCharactersRule (javadocs), but that Rule is only for sequence of the same characters (it will find 'aaa', but not 'abab').
Does passay have any rule for doing this or will I have to write a custom rule?