pre-compute password denylist Bloom filter to speed up server startup#48515
Open
kfaseela wants to merge 3 commits intokeycloak:mainfrom
Open
pre-compute password denylist Bloom filter to speed up server startup#48515kfaseela wants to merge 3 commits intokeycloak:mainfrom
kfaseela wants to merge 3 commits intokeycloak:mainfrom
Conversation
cf96091 to
58a49dc
Compare
Signed-off-by: Faseela K <[email protected]>
Signed-off-by: Faseela K <[email protected]>
Signed-off-by: Faseela K <[email protected]>
04a5e1c to
057864a
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #47356
Loading large password denylist files from plaintext on every server startup or reload rebuilds the Bloom filter from scratch, which can take several seconds for multi-million-line lists.
This PR introduces a pre-computed binary (.bloom) file that the server loads
instead of rebuilding from plaintext, significantly reducing startup and reload time.
Changes
kc.sh tools build-password-denylistcommand generates a.bloomfile alongside the plaintext denylist..bloomfile when present, falling back to plaintext if the file is missing or corrupt..bloomfile when present, so the server reloads correctly when the denylist is updated and re-precomputed.Usage
# Pre-compute the Bloom filter kc.sh tools build-password-denylist /path/to/denylist.txtThis generates denylist.txt.bloom in the same directory. Place both files in the password-blacklists folder and start the server as usual:
kc.sh start --spi-password-policy-password-blacklist-blacklists-path=/path/to/password-blacklistsThe server looks for .bloom alongside the configured plaintext file and loads it automatically if found. The plaintext file must remain present.
Naming note
New code intentionally uses
denylistinstead ofblacklist. Existing identifiers (class names, SPI config keys, folder names) are left unchanged to avoid a breaking change - a separate issue can be raised to track that cleanup.