From 809143b08ff8bf49a022dc08c89a87a7219251b0 Mon Sep 17 00:00:00 2001 From: mohitdeuex <105265192+mohitdeuex@users.noreply.github.com> Date: Fri, 22 Jul 2022 00:42:44 +0530 Subject: [PATCH] Generated configs (#6167) * [Backend][Improvement] Using Generated Configurations files * [Backend][Improvement] Test failure * [Backend][Improvement] Update Descriptions * [Backend][Improvement] Config Resource Test Failure Fix * [Backend][Config] adding suggested comments --- .../catalog/CatalogApplicationConfig.java | 78 ++++--------------- 1 file changed, 17 insertions(+), 61 deletions(-) diff --git a/catalog-rest-service/src/main/java/org/openmetadata/catalog/CatalogApplicationConfig.java b/catalog-rest-service/src/main/java/org/openmetadata/catalog/CatalogApplicationConfig.java index 7d35581dc1d..c7cb3c81b70 100644 --- a/catalog-rest-service/src/main/java/org/openmetadata/catalog/CatalogApplicationConfig.java +++ b/catalog-rest-service/src/main/java/org/openmetadata/catalog/CatalogApplicationConfig.java @@ -35,101 +35,57 @@ import org.openmetadata.catalog.security.jwt.JWTTokenConfiguration; import org.openmetadata.catalog.slack.SlackPublisherConfiguration; import org.openmetadata.catalog.slackChat.SlackChatConfiguration; +@Getter +@Setter public class CatalogApplicationConfig extends Configuration { - private static final String DATABASE_CONFIG = "database"; - private static final String SWAGGER_CONFIG = "swagger"; - private static final String AUTHORIZER_CONFIG = "authorizerConfiguration"; - private static final String AUTHENTICATION_CONFIG = "authenticationConfiguration"; - private static final String JWT_CONFIG = "jwtTokenConfiguration"; - private static final String ELASTIC_CONFIG = "elasticsearch"; - private static final String EVENTHANDLER_CONFIG = "eventHandlerConfiguration"; - private static final String AIRFLOW_CONFIG = "airflowConfiguration"; - private static final String SLACK_CONFIG = "slackEventPublishers"; - private static final String FERNET_CONFIG = "fernetConfiguration"; - private static final String HEALTH_CONFIG = "health"; - private static final String MIGRATION_CONFIG = "migrationConfiguration"; - private static final String SANDBOXMODE_CONFIG = "sandboxModeEnabled"; - private static final String SLACK_CHAT_CONFIG = "slackChat"; - private static final String SECRET_MANAGER_CONFIG = "secretsManagerConfiguration"; - - @JsonProperty(DATABASE_CONFIG) + @JsonProperty("database") @NotNull @Valid - @Getter - @Setter private DataSourceFactory dataSourceFactory; - @JsonProperty(SWAGGER_CONFIG) - @Getter - @Setter + @JsonProperty("swagger") private SwaggerBundleConfiguration swaggerBundleConfig; - @JsonProperty(AUTHORIZER_CONFIG) - @Getter - @Setter + @JsonProperty("authorizerConfiguration") private AuthorizerConfiguration authorizerConfiguration; - @JsonProperty(AUTHENTICATION_CONFIG) - @Getter - @Setter + @JsonProperty("authenticationConfiguration") private AuthenticationConfiguration authenticationConfiguration; - @JsonProperty(JWT_CONFIG) - @Getter - @Setter + @JsonProperty("jwtTokenConfiguration") private JWTTokenConfiguration jwtTokenConfiguration; - @JsonProperty(ELASTIC_CONFIG) - @Getter - @Setter + @JsonProperty("elasticsearch") private ElasticSearchConfiguration elasticSearchConfiguration; - @JsonProperty(EVENTHANDLER_CONFIG) - @Getter - @Setter + @JsonProperty("eventHandlerConfiguration") private EventHandlerConfiguration eventHandlerConfiguration; - @JsonProperty(AIRFLOW_CONFIG) - @Getter - @Setter + @JsonProperty("airflowConfiguration") private AirflowConfiguration airflowConfiguration; - @JsonProperty(SLACK_CONFIG) - @Getter - @Setter + @JsonProperty("slackEventPublishers") private List slackEventPublishers; - @JsonProperty(MIGRATION_CONFIG) + @JsonProperty("migrationConfiguration") @NotNull - @Getter - @Setter private MigrationConfiguration migrationConfiguration; - @JsonProperty(FERNET_CONFIG) - @Getter - @Setter + @JsonProperty("fernetConfiguration") private FernetConfiguration fernetConfiguration; - @JsonProperty(HEALTH_CONFIG) + @JsonProperty("health") @NotNull @Valid - @Getter - @Setter private HealthConfiguration healthConfiguration = new HealthConfiguration(); - @JsonProperty(SANDBOXMODE_CONFIG) - @Getter - @Setter + @JsonProperty("sandboxModeEnabled") private boolean sandboxModeEnabled; - @JsonProperty(SLACK_CHAT_CONFIG) - @Getter - @Setter + @JsonProperty("slackChat") private SlackChatConfiguration slackChatConfiguration = new SlackChatConfiguration(); - @JsonProperty(SECRET_MANAGER_CONFIG) - @Getter - @Setter + @JsonProperty("secretsManagerConfiguration") private SecretsManagerConfiguration secretsManagerConfiguration; @Override