-
Notifications
You must be signed in to change notification settings - Fork 7.9k
fix: ensuring placeholders can be used with --import-realm #33589
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -95,6 +95,7 @@ public boolean isImportMasterIncludedAtStartup(String dir) { | |
| if (dir == null) { | ||
| throw new IllegalStateException("Import not enabled"); | ||
| } | ||
| ExportImportConfig.setReplacePlaceholders(true); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This looks like an odd place to set configuration. Can't this be moved somewhere else (maybe the
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Do you mean you want to get rid of the ExportImportConfig class? That has the responsibility currently of handling all of these system properties.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Another alternative is to default to always replacing placeholders. I think we didn't do that before just to limit the scope of the changes, but as long as the core folks agree then we can remove both of these calls.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
No, I meant that I don't think we should be calling
That might be a bit out of scope for now.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
No, it's not great. It's similar to the issues raised in the TODO about undoing the static state changes. We can move it up, but it's not ideal in KeycloakApplication either.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. TBH, it makes more sense to me if it was in
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Let's just resolve this in a follow-up: #33596 - ideally we should be encapsulating as much as possible the usage of static ExportImportConfig logic.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ok, let's do it as a follow-up. |
||
|
|
||
| return getStartupImportProviders(dir).map(Supplier::get).anyMatch(provider -> { | ||
| try { | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We're not explicitly testing if the realm is enabled in the
ImportAtStartupDistTestbut it should be fine as the import would fail if placeholders were disabled.