Skip to content

Commit

Permalink
[#1354] add switch control default load security configs from nacos c…
Browse files Browse the repository at this point in the history
…onfig center
  • Loading branch information
chengyouling committed Aug 5, 2024
1 parent 9a05055 commit a8300e6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,9 @@ private void loadLabelRouterConfigs(CompositePropertySource composite, Environme
}

private void loadSecurityConfigs(CompositePropertySource composite, Environment env) {
if (!env.getProperty(NacosConfigConst.SECURITY_CONFIG_DEFAULT_LOAD_ENABLED, boolean.class, false)) {
return;
}
String group = "cse-app-security-group";
String dataId = buildIncludeServiceNameDataId(env, NacosConfigConst.SECURITY_CONFIG_DATA_ID_PREFIX);
loadNacosDataIfPresent(composite, dataId, group, NacosConfigConst.DEFAULT_CONFIG_FILE_EXTENSION, true);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,7 @@ public class NacosConfigConst {

public static final String ROUTER_CONFIG_DEFAULT_LOAD_ENABLED
= "spring.cloud.nacos.config.routerConfigDefaultLoadEnabled";

public static final String SECURITY_CONFIG_DEFAULT_LOAD_ENABLED
= "spring.cloud.nacos.config.securityConfigDefaultLoadEnabled";
}

0 comments on commit a8300e6

Please sign in to comment.