adorsys / keycloak-config-cli

Import YAML/JSON-formatted configuration files into Keycloak - Configuration as Code for Keycloak.
Apache License 2.0
778 stars 140 forks source link

Add a way to import localizations message bundles #945

Closed antikalk closed 6 months ago

antikalk commented 11 months ago

Problem Statement

As far as I know there is currently no way to import the localization message bundles with keycloak-config-cli.

You are able to enable internationalization, set the supported locales and default locale, but providing custom message bundles is not possible. This would be a cool feature to add.

Proposed Solution

Support a new property messageBundles in the realm json which could look like this:

{
  ...
  "messageBundles": {
    "de": {
      "hello": "Hallo",
      "world": "Welt"
      ...
    },
    "en": {
      "hello": "Hello",
      "world": "World"
      ...
    }
  }
}

For each locale in messageBundles post the content of the object to the corresponding locale endpoint, e.g.: POST realms/$realm/localization/de Body:

{
  "hello": "Hallo",
  "world": "Welt"
  ...
}

and POST realms/$realm/localization/en Body:

{
  "hello": "Hello",
  "world": "World"
  ...
}

Environment

Additional information

No response

Acceptance Criteria

No response

antikalk commented 6 months ago

@st3v0rr sorry for bothering you, but is there any chance we could get that feature in? I created a PR some time ago, that allows for adding localization message bundles with keycloak config-cli.

Only issue I faced is, I could not get the 18.0.2 build running. Mostly because I had to introduce a legacy file already for kc pre 22. And then below version 20, the behavior changed again. But as keycloak-config-cli claims to support only the latest four keycloak releases, it might make sure to drop the support for versions below 20 anyway...

st3v0rr commented 6 months ago

Hello @antikalk , if we apply this change we would break with the Red Hat SSO compatibility. So for now I need some more feedback of potential Red Hat SSO users. I think the reason @thomasdarimont wanted to keep it was because there are still projects that are dependent on this version.

There is also no new announcement from Red Hat on their new Keycloak product that would help us with the other pinned issue. https://github.com/adorsys/keycloak-config-cli/issues/992

antikalk commented 6 months ago

@st3v0rr Thanks for your response! I did just have another look at my PR and found a way to enable support for KC18.