Package org.keycloak.policy
Class BlacklistPasswordPolicyProviderFactory.FileBasedPasswordBlacklist
- java.lang.Object
-
- org.keycloak.policy.BlacklistPasswordPolicyProviderFactory.FileBasedPasswordBlacklist
-
- All Implemented Interfaces:
BlacklistPasswordPolicyProviderFactory.PasswordBlacklist
- Enclosing class:
- BlacklistPasswordPolicyProviderFactory
public static class BlacklistPasswordPolicyProviderFactory.FileBasedPasswordBlacklist extends Object implements BlacklistPasswordPolicyProviderFactory.PasswordBlacklist
ABlacklistPasswordPolicyProviderFactory.FileBasedPasswordBlacklist
uses password-blacklist files as to construct aBlacklistPasswordPolicyProviderFactory.PasswordBlacklist
.This implementation uses a dynamically sized
BloomFilter
with a provided default false positive probability.- See Also:
BloomFilter
-
-
Constructor Summary
Constructors Constructor Description FileBasedPasswordBlacklist(Path blacklistBasePath, String name)
FileBasedPasswordBlacklist(Path blacklistBasePath, String name, double falsePositiveProbability)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
contains(String password)
Checks whether a givenpassword
is contained in thisBlacklistPasswordPolicyProviderFactory.PasswordBlacklist
.double
getFalsePositiveProbability()
String
getName()
protected void
insertPasswordsInto(com.google.common.hash.BloomFilter<String> filter)
-
-
-
Constructor Detail
-
FileBasedPasswordBlacklist
public FileBasedPasswordBlacklist(Path blacklistBasePath, String name)
Creates a newBlacklistPasswordPolicyProviderFactory.FileBasedPasswordBlacklist
withBlacklistPasswordPolicyProviderFactory.DEFAULT_FALSE_POSITIVE_PROBABILITY
.- Parameters:
blacklistBasePath
- folder containing the blacklistsname
- name of blacklist file
-
-
Method Detail
-
getName
public String getName()
- Specified by:
getName
in interfaceBlacklistPasswordPolicyProviderFactory.PasswordBlacklist
- Returns:
- the logical name of the
BlacklistPasswordPolicyProviderFactory.PasswordBlacklist
-
getFalsePositiveProbability
public double getFalsePositiveProbability()
-
contains
public boolean contains(String password)
Description copied from interface:BlacklistPasswordPolicyProviderFactory.PasswordBlacklist
Checks whether a givenpassword
is contained in thisBlacklistPasswordPolicyProviderFactory.PasswordBlacklist
.- Specified by:
contains
in interfaceBlacklistPasswordPolicyProviderFactory.PasswordBlacklist
- Returns:
-
insertPasswordsInto
protected void insertPasswordsInto(com.google.common.hash.BloomFilter<String> filter) throws IOException
- Throws:
IOException
-
-