8000 WIP - Add support for configuration profiles by sguilhen · Pull Request #10429 · keycloak/keycloak · GitHub
[go: up one dir, main page]

Skip to content

WIP - Add support for configuration profiles - #10429

Closed
sguilhen wants to merge 1 commit into
keycloak:mainfrom
sguilhen:10226
Closed

sguilhen wants to merge 1 commit into
keycloak:mainfrom
sguilhen:10226

Conversation

@sguilhen
Copy link
Copy Markdown
Contributor

Closes #10226

Comment thread core/pom.xml Outdated
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Can we remove these 1.7 compiler limitations? If not it is not a big deal, really, but it would be awesome if we could get rid of those as there are several features, such as default methods, that have been introduced in later JDK versions and that are not available in 1.7.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

We cannot: e.g. EAP adapters have 1.7 as mandatory JDK and all the dependencies including core have to adhere to this.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Reverted

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I propose the introduction of this interface to allow the code that is initializing the instantiated factories to handle profiles only if the factory supports them, for efficiency reasons. But, of course, this can be changed.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

If the "inline" config is not empty, we assume it is trying to override one of the profiles with some area-specific needs, and thus we craft a componentId that conveys that.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

After I've finished implementing and testing this, I realized I can probably do without the "profile" scope altogether. So, instead of a config like this:

"mapStorage": {
    "jpa-map-storage": {
        "profile": {
             "xyz": {
             }
        }
    }
}

I could probably have just

"mapStorage": {
    "jpa-map-storage": {
         "xyz": {
         }
    }
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think this is not a good way forward - the default configuration keys would be indistinguishable and might interfere with profile name.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Good point, will stick with explicit profile scope scope.

Comment on lines 119 to 129
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks for providing an implementation here! Finally a way to iterate over the properties!
(resolve the comment)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Just caught my eye - this implementation needs updating: keys do not support addAll, see https://docs.oracle.com/javase/8/docs/api/java/util/HashMap.html#keySet--

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Thanks, I've completely missed that one. Fixed.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Where does this constant originate from?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Right now it is coming from the SPI name. For authorization the different areas are not currently separated, they are all initialized to use the same storage factory. I don't know if we will change that in the future so that the different authz models will be configurable independently with respect to the storage factory, but for now they all share the same so I decided to use the SPI name.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

If we won't be splitting the different authz models, then perhaps a better name for the authz storage would be simply authorization.

@sguilhen sguilhen added area/storage Storage layer — JPA entities, database schemas, Liquibase migrations, caching team/storage-sig kind/enhancement Categorizes a PR related to an enhancement labels Mar 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/storage Storage layer — JPA entities, database schemas, Liquibase migrations, caching kind/enhancement Categorizes a PR related to an enhancement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Map storage: components are unable to use the same storage with different configurations

3 participants

0