mirror of
https://github.com/dbeaver/cloudbeaver.git
synced 2026-09-24 16:04:36 +08:00
CB-1467 fix: manually serialize authConfiguration in ConfigurationUtils.
This commit is contained in:
+42
-1
@@ -48,7 +48,7 @@ public class ConfigurationUtils {
|
||||
res.put(CBConstants.PARAM_RESOURCE_QUOTAS, resourceQuotas);
|
||||
}
|
||||
|
||||
Map<String, AuthProviderConfig> authProviders = appConfig.getAuthProviderConfigurations();
|
||||
Map<String, Object> authProviders = authConfigToMap(appConfig);
|
||||
if (!CommonUtils.isEmpty(authProviders)) {
|
||||
res.put(CBConstants.PARAM_AUTH_PROVIDERS, authProviders);
|
||||
}
|
||||
@@ -74,6 +74,47 @@ public class ConfigurationUtils {
|
||||
return res;
|
||||
}
|
||||
|
||||
public static Map<String, Object> authConfigToMap(@Nullable CBAppConfig appConfig) {
|
||||
Map<String, Object> res = new LinkedHashMap<>();
|
||||
if (appConfig == null) {
|
||||
return res;
|
||||
}
|
||||
|
||||
Map<String, AuthProviderConfig> authProviders = appConfig.getAuthProviderConfigurations();
|
||||
if (!CommonUtils.isEmpty(authProviders)) {
|
||||
authProviders.forEach((key, value) -> {
|
||||
Map<String, Object> authProviderConfig = new LinkedHashMap<>();
|
||||
authProviderConfig.computeIfAbsent(
|
||||
"provider",
|
||||
ignored -> value.getProvider()
|
||||
);
|
||||
authProviderConfig.computeIfAbsent(
|
||||
"displayName",
|
||||
ignored -> value.getDisplayName()
|
||||
);
|
||||
authProviderConfig.put(
|
||||
"disabled",
|
||||
value.isDisabled()
|
||||
);
|
||||
authProviderConfig.computeIfAbsent(
|
||||
"iconURL",
|
||||
ignored -> value.getIconURL()
|
||||
);
|
||||
authProviderConfig.computeIfAbsent(
|
||||
"description",
|
||||
ignored -> value.getDescription()
|
||||
);
|
||||
authProviderConfig.computeIfAbsent(
|
||||
"parameters",
|
||||
ignored -> value.getParameters()
|
||||
);
|
||||
res.put(key, authProviderConfig);
|
||||
});
|
||||
}
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
public static Map<String, Object> defaultNavigatorSettingsConfigToMap(@Nullable DBNBrowseSettings navSettings) {
|
||||
Map<String, Object> res = new LinkedHashMap<>();
|
||||
if (navSettings == null) {
|
||||
|
||||
Reference in New Issue
Block a user