Closed wheeler7 closed 8 years ago
If you look a the next few lines, you'll see that the aggregated result is set to false if the numCharacteristics property has not been met.
If you still believe we have a bug, please attach a unit test that demonstrates. Thanks.
Hi dfish3r,
thank you for your reply and I'm sorry because I think i have missunderstood the idea of CharacterCharacteristicsRule
treating is a container that will check if all sub rules are valid and yet some characteristic.
Sorry and thank you
Best regards
Hi,
I'm using passay library:
I've got a problem with
CharacterCharacteristicsRule
. When one of the sub rules, aggregated byCharacterCharacteristicsRule
, finds given password to be invalid thenRuleResult
returned byCharacterCharacteristicsRule
has "valid" flag still set to true.The case is that when I define four
CharacterRule
classes:Then I'm adding them to
CharacterCharacteristicsRule
and I set up that at least 3 characteristics should be met.Assuming that password would be "1Abc!xyz" then three characteristics are met but
CharacterRule
for digits is not met.Looking at code of method
validate()
in CharacterCharacteristicsRule class:You can see that when sub rule is not valid then details are aggregated to
result
object but "valid" flag ofresult
object is not updated to false. So finaly I'm receivingRuleResult
object with "valid" flag set to true and no items on "details" list, beacuse they are not aggregated invalidate()
method ofPasswordValidator
class.Best regards