diff --git a/conf/openmetadata.yaml b/conf/openmetadata.yaml index df3a0d5c696..5465f38163e 100644 --- a/conf/openmetadata.yaml +++ b/conf/openmetadata.yaml @@ -327,3 +327,5 @@ web: changeEventConfig: omUri: ${OM_URI:- "http://localhost:8585"} #openmetadata in om uri for eg http://localhost:8585 +extensionConfiguration: + extensions: ${OM_EXTENSIONS:-[]} diff --git a/openmetadata-service/src/main/java/org/openmetadata/service/OpenMetadataApplication.java b/openmetadata-service/src/main/java/org/openmetadata/service/OpenMetadataApplication.java index 3059d8ec1e9..b78775e8a41 100644 --- a/openmetadata-service/src/main/java/org/openmetadata/service/OpenMetadataApplication.java +++ b/openmetadata-service/src/main/java/org/openmetadata/service/OpenMetadataApplication.java @@ -66,6 +66,8 @@ import org.jdbi.v3.core.Jdbi; import org.jdbi.v3.core.statement.SqlLogger; import org.jdbi.v3.core.statement.StatementContext; import org.jdbi.v3.sqlobject.SqlObjects; +import org.openmetadata.schema.api.configuration.extension.Extension; +import org.openmetadata.schema.api.configuration.extension.ExtensionConfiguration; import org.openmetadata.schema.api.security.AuthenticationConfiguration; import org.openmetadata.schema.api.security.AuthorizerConfiguration; import org.openmetadata.schema.auth.SSOAuthMechanism; @@ -76,6 +78,7 @@ import org.openmetadata.service.events.scheduled.ReportsHandler; import org.openmetadata.service.exception.CatalogGenericExceptionMapper; import org.openmetadata.service.exception.ConstraintViolationExceptionMapper; import org.openmetadata.service.exception.JsonMappingExceptionMapper; +import org.openmetadata.service.extension.OpenMetadataExtension; import org.openmetadata.service.fernet.Fernet; import org.openmetadata.service.jdbi3.CollectionDAO; import org.openmetadata.service.jdbi3.locator.ConnectionAwareAnnotationSqlLocator; @@ -209,6 +212,27 @@ public class OpenMetadataApplication extends Application getCollections() { Reflections reflections = new Reflections("org.openmetadata.service.resources"); + Reflections privateReflections = new Reflections("io.services.resources"); // Get classes marked with @Collection annotation Set> collectionClasses = reflections.getTypesAnnotatedWith(Collection.class); + // Get classes marked in other + collectionClasses.addAll(privateReflections.getTypesAnnotatedWith(Collection.class)); List collections = new ArrayList<>(); for (Class cl : collectionClasses) { CollectionDetails cd = getCollection(cl); diff --git a/openmetadata-spec/src/main/resources/json/schema/configuration/extensionConfiguration.json b/openmetadata-spec/src/main/resources/json/schema/configuration/extensionConfiguration.json new file mode 100644 index 00000000000..7e7cac13ddd --- /dev/null +++ b/openmetadata-spec/src/main/resources/json/schema/configuration/extensionConfiguration.json @@ -0,0 +1,40 @@ +{ + "$id": "https://open-metadata.org/schema/entity/configuration/extensionConfiguration.json", + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ExtensionConfiguration", + "description": "This schema defines the OpenMetadata Extensions Configuration.", + "type": "object", + "javaType": "org.openmetadata.schema.api.configuration.extension.ExtensionConfiguration", + "definitions": { + "extension": { + "javaType": "org.openmetadata.schema.api.configuration.extension.Extension", + "description": "Extension Class to Register in OM", + "type": "object", + "properties": { + "className": { + "description": "Class Name for the Extension Service.", + "type": "string" + }, + "parameters": { + "javaType": "org.openmetadata.schema.api.configuration.extension.ExtensionParameters", + "description": "Additional parameters for extension initialization.", + "type": "object", + "additionalProperties": { + ".{1,}": { "type": "string" } + } + } + }, + "required": ["className"], + "additionalProperties": false + } + }, + "properties": { + "extensions": { + "description": "Extension Class to Register in OM", + "type": "array", + "items": { + "$ref": "#/definitions/extension" + } + } + } +}