Add two new/updated apps for self-hosted (#392)

* Add two new/updated apps for self-hosted

* Fix potential NPE when template org dump has API datasources
This commit is contained in:
Shrikant Sharat Kandula 2020-08-21 14:37:35 +05:30 committed by GitHub
parent 9933464d1f
commit 87f27c9182
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4410 additions and 1632 deletions

View File

@ -704,8 +704,10 @@ public class DatabaseChangelog {
for (final Map<String, Object> datasource : datasources) {
datasource.put("pluginId", plugins.get(datasource.remove("$pluginPackageName")));
final Map authentication = (Map) ((Map) datasource.get("datasourceConfiguration")).get("authentication");
final String plainPassword = (String) authentication.get("password");
authentication.put("password", encryptionService.encryptString(plainPassword));
if (authentication != null) {
final String plainPassword = (String) authentication.get("password");
authentication.put("password", encryptionService.encryptString(plainPassword));
}
datasource.put(FieldName.ORGANIZATION_ID, organizationId);
datasource.put(FieldName.CREATED_AT, Instant.now());
final Map<String, Object> insertedDatasource = mongoTemplate.insert(datasource, mongoTemplate.getCollectionName(Datasource.class));