Skip to content

Conversation

@ryanemerson
Copy link
Contributor

@ryanemerson ryanemerson commented Nov 26, 2025

Closes #1237

I have kept it simple for now and only reused credentials per create-users invocation. The reason for this is that the unique-credential-count ultimately determines the password, so storing and reloading the credentials in the DB means that we then need to handle unique-credential-count changing.

Passwords can be calcuated using: password-$(i % unique-credential-count) where i is the user number.

Quick local benchmark:

4s ./dataset/dataset-import.sh -a create-users -u 10000 -U 100 -l http://localhost:8080/realms/master/dataset

vs

45s ./dataset/dataset-import.sh -a create-users -u 10000 -l http://localhost:8080/realms/master/dataset

I haven't added any docs yet, as I wasn't sure if this was functionality we want to advertise or are happy keeping it hidden for our own needs. Let me know if we require docs.

@ryanemerson ryanemerson force-pushed the 1237/configurable_unique_password_count branch from af93f47 to bc2782a Compare November 26, 2025 15:56
@ryanemerson ryanemerson marked this pull request as ready for review November 26, 2025 16:12
@ryanemerson ryanemerson requested review from ahus1 and pruivo November 26, 2025 16:12
Copy link
Contributor

@ahus1 ahus1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the pull request, looks good to me.

+1 for adding a minimal set of docs. I think it will come in handy for those who want to test millions of users. It is open source, and we shouldn't hide this gem in the code but make it useful for everyone.

Would be updating Gatling be part if this issue, or a follow-up issue? I'm ok to make it a follow-up issue.

@ryanemerson
Copy link
Contributor Author

I have added the docs and gatling benchmark logic, I also updated the keycloak-create-dataset workflow to include an input for this configuration.

I didn't update any of the benchmark workflows as they already have the max number of inputs (10) and I figured if we do want to execute these tests (semi-)regularly, we probably would have a dedicated cron workflow.

@ahus1 ahus1 self-assigned this Nov 27, 2025
Copy link
Member

@pruivo pruivo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Tested the create-realm and benchmark run with 1 unique password, and it worked.
I'll let @ahus1 review the docs :)

Signed-off-by: Alexander Schwartz <[email protected]>
Copy link
Contributor

@ahus1 ahus1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the code changes and the docs. Approving!

@ahus1 ahus1 merged commit f311058 into keycloak:main Nov 28, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Allow the dataset to generate users with a limited number of unique passwords

3 participants