2021-08-01 14:27:44 -07:00
|
|
|
/*
|
2021-12-01 12:46:28 +05:30
|
|
|
* Copyright 2021 Collate
|
|
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
* you may not use this file except in compliance with the License.
|
|
|
|
* You may obtain a copy of the License at
|
2021-08-01 14:27:44 -07:00
|
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
* See the License for the specific language governing permissions and
|
|
|
|
* limitations under the License.
|
|
|
|
*/
|
|
|
|
|
2022-09-14 23:14:02 -07:00
|
|
|
package org.openmetadata.service;
|
2021-08-01 14:27:44 -07:00
|
|
|
|
|
|
|
import com.fasterxml.jackson.annotation.JsonProperty;
|
|
|
|
import io.dropwizard.Configuration;
|
|
|
|
import io.dropwizard.db.DataSourceFactory;
|
2021-12-16 07:13:50 -08:00
|
|
|
import io.dropwizard.health.conf.HealthConfiguration;
|
2021-08-01 14:27:44 -07:00
|
|
|
import io.federecio.dropwizard.swagger.SwaggerBundleConfiguration;
|
2024-05-27 00:19:35 +05:30
|
|
|
import java.util.LinkedHashMap;
|
2021-08-01 14:27:44 -07:00
|
|
|
import javax.validation.Valid;
|
|
|
|
import javax.validation.constraints.NotNull;
|
2022-02-06 10:18:37 -08:00
|
|
|
import lombok.Getter;
|
|
|
|
import lombok.Setter;
|
2024-02-13 07:02:09 +01:00
|
|
|
import org.openmetadata.schema.api.configuration.dataQuality.DataQualityConfiguration;
|
2022-09-14 23:14:02 -07:00
|
|
|
import org.openmetadata.schema.api.configuration.events.EventHandlerConfiguration;
|
2023-02-07 16:30:42 +01:00
|
|
|
import org.openmetadata.schema.api.configuration.pipelineServiceClient.PipelineServiceClientConfiguration;
|
2022-09-14 23:14:02 -07:00
|
|
|
import org.openmetadata.schema.api.fernet.FernetConfiguration;
|
|
|
|
import org.openmetadata.schema.api.security.AuthenticationConfiguration;
|
|
|
|
import org.openmetadata.schema.api.security.AuthorizerConfiguration;
|
|
|
|
import org.openmetadata.schema.api.security.jwt.JWTTokenConfiguration;
|
2024-07-01 14:59:25 +05:30
|
|
|
import org.openmetadata.schema.configuration.LimitsConfiguration;
|
2023-03-03 19:10:01 +01:00
|
|
|
import org.openmetadata.schema.security.secrets.SecretsManagerConfiguration;
|
2023-01-09 21:42:01 -08:00
|
|
|
import org.openmetadata.schema.service.configuration.elasticsearch.ElasticSearchConfiguration;
|
2023-08-18 17:48:17 +05:30
|
|
|
import org.openmetadata.service.config.OMWebConfiguration;
|
2022-09-14 23:14:02 -07:00
|
|
|
import org.openmetadata.service.migration.MigrationConfiguration;
|
2022-11-28 17:45:18 +01:00
|
|
|
import org.openmetadata.service.monitoring.EventMonitorConfiguration;
|
2021-08-01 14:27:44 -07:00
|
|
|
|
2022-07-22 00:42:44 +05:30
|
|
|
@Getter
|
|
|
|
@Setter
|
2022-09-17 11:35:45 -07:00
|
|
|
public class OpenMetadataApplicationConfig extends Configuration {
|
2022-07-22 00:42:44 +05:30
|
|
|
@JsonProperty("database")
|
2022-02-06 10:18:37 -08:00
|
|
|
@NotNull
|
|
|
|
@Valid
|
2021-12-16 07:13:50 -08:00
|
|
|
private DataSourceFactory dataSourceFactory;
|
|
|
|
|
2022-07-22 00:42:44 +05:30
|
|
|
@JsonProperty("swagger")
|
2021-12-16 07:13:50 -08:00
|
|
|
private SwaggerBundleConfiguration swaggerBundleConfig;
|
|
|
|
|
2022-07-22 00:42:44 +05:30
|
|
|
@JsonProperty("authorizerConfiguration")
|
2021-12-16 07:13:50 -08:00
|
|
|
private AuthorizerConfiguration authorizerConfiguration;
|
|
|
|
|
2022-07-22 00:42:44 +05:30
|
|
|
@JsonProperty("authenticationConfiguration")
|
2021-12-16 07:13:50 -08:00
|
|
|
private AuthenticationConfiguration authenticationConfiguration;
|
|
|
|
|
2022-07-22 00:42:44 +05:30
|
|
|
@JsonProperty("jwtTokenConfiguration")
|
2022-05-05 03:02:33 -07:00
|
|
|
private JWTTokenConfiguration jwtTokenConfiguration;
|
|
|
|
|
2022-07-22 00:42:44 +05:30
|
|
|
@JsonProperty("elasticsearch")
|
2021-12-16 07:13:50 -08:00
|
|
|
private ElasticSearchConfiguration elasticSearchConfiguration;
|
|
|
|
|
2022-07-22 00:42:44 +05:30
|
|
|
@JsonProperty("eventHandlerConfiguration")
|
2021-12-16 07:13:50 -08:00
|
|
|
private EventHandlerConfiguration eventHandlerConfiguration;
|
|
|
|
|
2023-02-07 16:30:42 +01:00
|
|
|
@JsonProperty("pipelineServiceClientConfiguration")
|
|
|
|
private PipelineServiceClientConfiguration pipelineServiceClientConfiguration;
|
2021-12-16 07:13:50 -08:00
|
|
|
|
2024-05-27 00:19:35 +05:30
|
|
|
private static final String CERTIFICATE_PATH = "certificatePath";
|
|
|
|
|
|
|
|
public PipelineServiceClientConfiguration getPipelineServiceClientConfiguration() {
|
2025-02-26 08:23:08 +01:00
|
|
|
if (pipelineServiceClientConfiguration != null) {
|
|
|
|
LinkedHashMap<String, String> temporarySSLConfig =
|
|
|
|
(LinkedHashMap<String, String>) pipelineServiceClientConfiguration.getSslConfig();
|
|
|
|
if (temporarySSLConfig != null && temporarySSLConfig.containsKey(CERTIFICATE_PATH)) {
|
|
|
|
temporarySSLConfig.put("caCertificate", temporarySSLConfig.get(CERTIFICATE_PATH));
|
|
|
|
temporarySSLConfig.remove(CERTIFICATE_PATH);
|
|
|
|
}
|
|
|
|
pipelineServiceClientConfiguration.setSslConfig(temporarySSLConfig);
|
2024-05-27 00:19:35 +05:30
|
|
|
}
|
|
|
|
return pipelineServiceClientConfiguration;
|
|
|
|
}
|
|
|
|
|
2022-07-22 00:42:44 +05:30
|
|
|
@JsonProperty("migrationConfiguration")
|
2022-02-06 10:18:37 -08:00
|
|
|
@NotNull
|
2022-02-01 08:31:34 +01:00
|
|
|
private MigrationConfiguration migrationConfiguration;
|
|
|
|
|
2022-07-22 00:42:44 +05:30
|
|
|
@JsonProperty("fernetConfiguration")
|
2022-02-08 09:50:39 +01:00
|
|
|
private FernetConfiguration fernetConfiguration;
|
|
|
|
|
2022-07-22 00:42:44 +05:30
|
|
|
@JsonProperty("health")
|
2022-02-06 10:18:37 -08:00
|
|
|
@NotNull
|
|
|
|
@Valid
|
2021-12-16 07:13:50 -08:00
|
|
|
private HealthConfiguration healthConfiguration = new HealthConfiguration();
|
|
|
|
|
2022-07-22 00:42:44 +05:30
|
|
|
@JsonProperty("secretsManagerConfiguration")
|
2022-07-13 20:49:27 +02:00
|
|
|
private SecretsManagerConfiguration secretsManagerConfiguration;
|
|
|
|
|
2022-11-28 17:45:18 +01:00
|
|
|
@JsonProperty("eventMonitoringConfiguration")
|
|
|
|
private EventMonitorConfiguration eventMonitorConfiguration;
|
|
|
|
|
2022-08-09 09:00:43 +02:00
|
|
|
@JsonProperty("clusterName")
|
|
|
|
private String clusterName;
|
|
|
|
|
2023-04-05 07:50:12 -07:00
|
|
|
@Valid
|
|
|
|
@NotNull
|
|
|
|
@JsonProperty("web")
|
2023-08-18 17:48:17 +05:30
|
|
|
private OMWebConfiguration webConfiguration = new OMWebConfiguration();
|
2023-04-05 07:50:12 -07:00
|
|
|
|
2024-02-13 07:02:09 +01:00
|
|
|
@JsonProperty("dataQualityConfiguration")
|
|
|
|
private DataQualityConfiguration dataQualityConfiguration;
|
|
|
|
|
2024-07-01 14:59:25 +05:30
|
|
|
@JsonProperty("limits")
|
|
|
|
private LimitsConfiguration limitsConfiguration;
|
|
|
|
|
2021-12-16 07:13:50 -08:00
|
|
|
@Override
|
|
|
|
public String toString() {
|
|
|
|
return "catalogConfig{"
|
|
|
|
+ ", dataSourceFactory="
|
|
|
|
+ dataSourceFactory
|
|
|
|
+ ", swaggerBundleConfig="
|
|
|
|
+ swaggerBundleConfig
|
|
|
|
+ ", authorizerConfiguration="
|
|
|
|
+ authorizerConfiguration
|
|
|
|
+ '}';
|
|
|
|
}
|
2021-08-01 14:27:44 -07:00
|
|
|
}
|