It would be good to have support for standard string expression resolving for the properties that you enter when configuring repositories.
Some context
Moreover, it's useful to be able to use variables from the environment in the same manner as can be done with the application.yml file.
What I think would help
From a quick look around within the code base, it seems that something along the lines of the code below could be utilised to expand the values read from an "STRepositoryInfo" instance.
If using the crude code below, that would mean applying "serverUrlExpand" and "pwdExpand" to respective property just before attempting to connect to the repository, or perhaps when reading the value from the STRepositoryInfo-instance?
@Value("${my.local.expand.serverurl:false}")
private boolean expandServerUrl;
@Value("${my.local.expand.password:false}")
private boolean expandPassword;
@Autowired
private ConfigurableEnvironment environment;
public class ConnectionDetailExpander {
private final boolean expandServerUrl;
private final boolean expandPassword;
private final PropertyResolver propertyResolver;
public ConnectionDetailExpander(final boolean expandServerUrl, final boolean expandPassword, final PropertyResolver propertyResolver) {
this.expandServerUrl = expandServerUrl;
this.expandPassword = expandPassword;
this.propertyResolver = propertyResolver;
}
public String expandServerUrl(final String url) {
if (url != null && expandServerUrl) {
return propertyResolver.resolvePlaceholders(url);
}
return url;
}
public String expandPassword(final String password) {
if (password != null && expandPassword) {
return propertyResolver.resolvePlaceholders(password);
}
return password;
}
}
final ConnectionDetailExpander expander = new ConnectionDetailExpander(expandServerUrl, expandPassword, environment);
final Function<String, String> serverUrlExpand = expander::expandServerUrl;
final Function<String, String> pwdExpand = expander::
expandPassword ;