You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by "Stefan Seifert (Jira)" <ji...@apache.org> on 2021/12/16 17:07:00 UTC
[jira] [Commented] (SLING-9898) Support interpolation in Context-Aware Configuration
[ https://issues.apache.org/jira/browse/SLING-9898?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17460885#comment-17460885 ]
Stefan Seifert commented on SLING-9898:
---------------------------------------
here is an example of using the already existing OsgiConfigurationOverrideProvider to apply caconfig via environment variables using placeholders via the felix interpolation:
{{org.apache.sling.caconfig.impl.override.OsgiConfigurationOverrideProvider~siteconfig.cfg.json}}
{code:json}
{
"description": "Author/Publish hostnames for URL externalization",
"overrides": [
"io.wcm.handler.url.SiteConfig={\"siteUrlAuthor\":\"$[env:CMS_AEM_AUTHOR_URL;default=]\",\"siteUrl\":\"$[env:CMS_AEM_PUBLISH_URL;default=]\"}"
],
"enabled": true
}
{code}
i'm very hesitant adding interpolation support directly to caconfig. this get's really complex for non-string data types, and we have to introduce a failsafe and backward-compatible placeholder (and fallback) syntax. this is another level of inheritance and fallback which makes caconfig itself even complexer (and it's already a bit over-complex). so, i'm fine with the current solution of "separated concerns" - interpolation from env variables is only supported in osgi config, and we can chain that together with and override provider.
> Support interpolation in Context-Aware Configuration
> ----------------------------------------------------
>
> Key: SLING-9898
> URL: https://issues.apache.org/jira/browse/SLING-9898
> Project: Sling
> Issue Type: New Feature
> Affects Versions: Context-Aware Configuration Impl 1.5.0
> Reporter: Konrad Windszus
> Priority: Major
> Fix For: Context-Aware Configuration Impl 1.6.0
>
>
> Similar to https://issues.apache.org/jira/browse/SLING-7768 and https://github.com/apache/felix-dev/blob/master/configadmin-plugins/interpolation/README.md Context-Aware configurations should support interpolating values from at least environment variables.
> Although a similar behaviour could probably be achieved with a new Override Provider (https://sling.apache.org/documentation/bundles/context-aware-configuration/context-aware-configuration-override.html#built-in-override-providers), it would require a level of indirection.
> This feature is about directly referencing external values inside the Context-Aware Configuration.
--
This message was sent by Atlassian Jira
(v8.20.1#820001)