-
Notifications
You must be signed in to change notification settings - Fork 50
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow for custom max password length in 'Version' #28
Conversation
Pull Request Test Coverage Report for Build 213
💛 - Coveralls |
Hello, After playing with it a bit, I have some question. Why does the I think the length for the TruncateStrategy should not be tied to the Version. It should be independent. What do you think? |
Thats a good point. The problem is that the version identifier is not unique in my lib anymore. I will think about it
They are independent, they are just using it as configuration by default, which makes sense (why would you want a differnt lenght for those 2 properties?) |
I don't understand this sentence, sorry. Correct me if I'm wrong, but now the LongPasswordStrategies interface expects a public static LongPasswordStrategy truncate(BCrypt.Version version) {
return new LongPasswordStrategy.TruncateStrategy(Objects.requireNonNull(version).allowedMaxPwLength);
}
public static LongPasswordStrategy hashSha512(BCrypt.Version version) {
return new LongPasswordStrategy.Sha512DerivationStrategy(Objects.requireNonNull(version).allowedMaxPwLength);
}
|
Ah yes, you are absolutely right - to me it makes the most sense that the length is derived from the version. The developer is not tied to use the LongPasswordStrategies, he/she can implement them themselves. But I think about adding one with |
Ah, I can see your point. But I fear that it's not that obvious for everyone, and that it is not close to what one would expect. For instance in my case it wouldn't work. I use different libs that all needs to truncate to 72, but that vary by version (one is generating Yes it's really a mess. |
I'm afraid I don't really understand the problem. Current state:
|
Alright! Works for me 👍 |
Thanks @Indigo744 your input was very valuable for this release. 0.9.0 will be out in a couple of hours. |
refs #22