startup, welcome, and cli handling of bootstrap-admin user#30054
Conversation
Unreported flaky test detectedIf the flaky tests below are affected by the changes, please review and update the changes accordingly. Otherwise, a maintainer should report the flaky tests prior to merging the PR. org.keycloak.testsuite.oauth.TokenIntrospectionTest#testUnsupportedToken |
|
@vmuzikar this is roughly what we talked about. I wasn't sure if we even need to have an env option for bootstrap-admin user username - we can have just the direct --username input, just --username:env, or allow either. I left it initially as just the direct --username input under the assumption that it's much less of a security concern that it appears on the cli. Also do we want a password confirmation prompt? |
It'd allow either. Plus, if someone doesn't specify neither, they will be prompted.
Sounds like a good idea. |
Ok, this now supports either --username or --username:env
Added a confirmation prompt as well. I still have not removed the old env / sys handling - that will come later. The expiration logic was left in place, it's just hidden. |
|
@vmuzikar adding bootstrap-admin service account handling as well. Some additional thoughts / questions:
|
vmuzikar
left a comment
There was a problem hiding this comment.
@shawkins Thank you for the PR and sorry for the late review. I think the changes are a good start.
Added some comments.
Noticed also help is a bit misbehaving with list of commands:
kc.sh bootstrap-admin --help
...
Commands:
service Add an admin user with a password
service Add an admin user with a password
- if the user specifies both the env variable for the admin user and service, should we create both or just prefer one?
As a user, I'd expected both.
- it could further simplify things if we dropped accepting the password / client secret at all from the cli - and instead just use a generated one that we can show on the console or put into a temp file.
CLI is required for automated scenarios without using env vars, e.g. the test framework.
This appears to be due to our HelpFactory - it doesn't work well with multiple sub commands.
Ok, I'll remove the TODO.
Are we going to be testing the bootstrap-admin user and service cli in this way? I was thinking the cli options were only a hard requirement for the initial bootstrapping. |
bd66c44 to
2b1ec8a
Compare
|
The help should be fixed now. Also starting the operator support. |
Yes, the CLI options are a requirement for bootstrapping server in general for the new test framework.
Nice! I'd suggest splitting that to a separate PR. This PR is getting quite big. :) |
Discussed offline and there is still a desire to let users specify the recover password / client secret.
Yes, it will be separate once this one is out of draft. |
|
@shawkins I think we can move forward with the PR, I don't have any additional comments at the moment. |
Ok, I'll add some service account tests, then remove the operator draft stuff before moving this out of draft. |
0dd98af to
dd1fd19
Compare
|
Using the service account is still failing. |
8e737b6 to
2b2eff0
Compare
closes: keycloak#29324, keycloak#30002, keycloak#30003 Signed-off-by: Steve Hawkins <shawkins@redhat.com>
|
@shawkins Created shawkins#13. I broke a few tests by my previous PR. |
Addresses #29324, #30002, #30003, and the non-ui parts of #30010.
The old hanlding of env variables KEYCLOAK_ADMIN and KEYCLOAK_ADMIN_PASSWORD were left in place so that we can decouple this pr from the operator work. We can come back and deprecate or remove that as a cleanup.
The only thing that looks a little of on the cli is the help for no-prompt - it shows it as taking a value even if I specify arity 0. Not sure that's worth addressing.
The actual handling for temporary / expriation will be deferred to the other issues.
cc @vmuzikar