fix: implement noop decryptConfig for external app pipeline generation (#23407)

This commit is contained in:
Teddy 2025-09-16 08:01:27 +02:00 committed by GitHub
parent e933089158
commit f54e902bfe
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -182,22 +182,28 @@ public class AbstractNativeApplication implements NativeApplication {
} }
} }
protected Map<String, Object> decryptConfiguration(Map<String, Object> appConfig) {
return appConfig;
}
private void updateAppConfig( private void updateAppConfig(
IngestionPipelineRepository repository, IngestionPipelineRepository repository,
Map<String, Object> appConfiguration, Map<String, Object> appConfiguration,
String updatedBy) { String updatedBy) {
Map<String, Object> decryptedConfig = decryptConfiguration(appConfiguration);
String fqn = FullyQualifiedName.add(SERVICE_NAME, this.getApp().getName()); String fqn = FullyQualifiedName.add(SERVICE_NAME, this.getApp().getName());
IngestionPipeline updated = repository.findByName(fqn, Include.NON_DELETED); IngestionPipeline updated = repository.findByName(fqn, Include.NON_DELETED);
ApplicationPipeline appPipeline = ApplicationPipeline appPipeline =
JsonUtils.convertValue(updated.getSourceConfig().getConfig(), ApplicationPipeline.class); JsonUtils.convertValue(updated.getSourceConfig().getConfig(), ApplicationPipeline.class);
IngestionPipeline original = JsonUtils.deepCopy(updated, IngestionPipeline.class); IngestionPipeline original = JsonUtils.deepCopy(updated, IngestionPipeline.class);
updated.setSourceConfig( updated.setSourceConfig(
updated.getSourceConfig().withConfig(appPipeline.withAppConfig(appConfiguration))); updated.getSourceConfig().withConfig(appPipeline.withAppConfig(decryptedConfig)));
repository.update(null, original, updated, updatedBy); repository.update(null, original, updated, updatedBy);
} }
private void createAndBindIngestionPipeline( private void createAndBindIngestionPipeline(
IngestionPipelineRepository ingestionPipelineRepository, Map<String, Object> config) { IngestionPipelineRepository ingestionPipelineRepository, Map<String, Object> config) {
Map<String, Object> decryptedConfig = decryptConfiguration(config);
MetadataServiceRepository serviceEntityRepository = MetadataServiceRepository serviceEntityRepository =
(MetadataServiceRepository) Entity.getEntityRepository(Entity.METADATA_SERVICE); (MetadataServiceRepository) Entity.getEntityRepository(Entity.METADATA_SERVICE);
EntityReference service = EntityReference service =
@ -216,7 +222,7 @@ public class AbstractNativeApplication implements NativeApplication {
.withConfig( .withConfig(
new ApplicationPipeline() new ApplicationPipeline()
.withSourcePythonClass(this.getApp().getSourcePythonClass()) .withSourcePythonClass(this.getApp().getSourcePythonClass())
.withAppConfig(config) .withAppConfig(decryptedConfig)
.withAppPrivateConfig(this.getApp().getPrivateConfiguration()))) .withAppPrivateConfig(this.getApp().getPrivateConfiguration())))
.withAirflowConfig( .withAirflowConfig(
new AirflowConfig() new AirflowConfig()