From 105605854364a2bfb160ffccd04030eb7af98177 Mon Sep 17 00:00:00 2001 From: Gabe Lyons Date: Thu, 9 Dec 2021 16:51:29 -0800 Subject: [PATCH 1/5] encode square brackets (#3709) --- datahub-web-react/src/app/entity/shared/utils.ts | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/datahub-web-react/src/app/entity/shared/utils.ts b/datahub-web-react/src/app/entity/shared/utils.ts index 3f27d734e89284..ad0d107cf8c4ae 100644 --- a/datahub-web-react/src/app/entity/shared/utils.ts +++ b/datahub-web-react/src/app/entity/shared/utils.ts @@ -1,5 +1,14 @@ export function urlEncodeUrn(urn: string) { - return urn && urn.replace(/%/g, '%25').replace(/\//g, '%2F').replace(/\?/g, '%3F').replace(/#/g, '%23'); + return ( + urn && + urn + .replace(/%/g, '%25') + .replace(/\//g, '%2F') + .replace(/\?/g, '%3F') + .replace(/#/g, '%23') + .replace(/\[/g, '%5B') + .replace(/\]/g, '%5D') + ); } export function notEmpty(value: TValue | null | undefined): value is TValue { From b00fe8426e47420753bf25acdb514bc78240893c Mon Sep 17 00:00:00 2001 From: Dexter Lee Date: Fri, 10 Dec 2021 14:31:33 +0900 Subject: [PATCH 2/5] fix(datahub-upgrade): Fix Spring injection issue with datahub-upgrade (#3688) --- .../upgrade/UpgradeCliApplication.java | 5 ++--- .../common/steps/GMSDisableWriteModeStep.java | 4 ++-- .../common/steps/GMSEnableWriteModeStep.java | 4 ++-- .../common/steps/GMSQualificationStep.java | 19 ++++++++++++++++--- .../upgrade/config/NoCodeUpgradeConfig.java | 3 +-- .../upgrade/config/RestoreBackupConfig.java | 18 ++++++------------ .../datahub/upgrade/nocode/NoCodeUpgrade.java | 9 +++++---- .../upgrade/restorebackup/RestoreBackup.java | 8 +++----- .../restoreindices/RestoreIndices.java | 2 -- 9 files changed, 37 insertions(+), 35 deletions(-) diff --git a/datahub-upgrade/src/main/java/com/linkedin/datahub/upgrade/UpgradeCliApplication.java b/datahub-upgrade/src/main/java/com/linkedin/datahub/upgrade/UpgradeCliApplication.java index b2bfcdabf22809..774140e11632ea 100644 --- a/datahub-upgrade/src/main/java/com/linkedin/datahub/upgrade/UpgradeCliApplication.java +++ b/datahub-upgrade/src/main/java/com/linkedin/datahub/upgrade/UpgradeCliApplication.java @@ -7,9 +7,8 @@ @SuppressWarnings("checkstyle:HideUtilityClassConstructor") -@SpringBootApplication(exclude = {RestClientAutoConfiguration.class}, scanBasePackages = { - "com.linkedin.gms.factory.common", "com.linkedin.gms.factory.kafka", "com.linkedin.gms.factory.search", - "com.linkedin.datahub.upgrade.config", "com.linkedin.gms.factory.entity"}) +@SpringBootApplication(exclude = {RestClientAutoConfiguration.class}, scanBasePackages = {"com.linkedin.gms.factory", + "com.linkedin.datahub.upgrade.config"}) public class UpgradeCliApplication { public static void main(String[] args) { new SpringApplicationBuilder(UpgradeCliApplication.class, UpgradeCli.class).web(WebApplicationType.NONE).run(args); diff --git a/datahub-upgrade/src/main/java/com/linkedin/datahub/upgrade/common/steps/GMSDisableWriteModeStep.java b/datahub-upgrade/src/main/java/com/linkedin/datahub/upgrade/common/steps/GMSDisableWriteModeStep.java index e8f4fe4fd7a42b..e205fd2f5c20e2 100644 --- a/datahub-upgrade/src/main/java/com/linkedin/datahub/upgrade/common/steps/GMSDisableWriteModeStep.java +++ b/datahub-upgrade/src/main/java/com/linkedin/datahub/upgrade/common/steps/GMSDisableWriteModeStep.java @@ -5,7 +5,7 @@ import com.linkedin.datahub.upgrade.UpgradeStep; import com.linkedin.datahub.upgrade.UpgradeStepResult; import com.linkedin.datahub.upgrade.impl.DefaultUpgradeStepResult; -import com.linkedin.entity.client.EntityClient; +import com.linkedin.entity.client.RestliEntityClient; import java.util.function.Function; import lombok.RequiredArgsConstructor; @@ -14,7 +14,7 @@ public class GMSDisableWriteModeStep implements UpgradeStep { private final Authentication _systemAuthentication; - private final EntityClient _entityClient; + private final RestliEntityClient _entityClient; @Override public String id() { diff --git a/datahub-upgrade/src/main/java/com/linkedin/datahub/upgrade/common/steps/GMSEnableWriteModeStep.java b/datahub-upgrade/src/main/java/com/linkedin/datahub/upgrade/common/steps/GMSEnableWriteModeStep.java index cb45e72b781822..270eff8df227c8 100644 --- a/datahub-upgrade/src/main/java/com/linkedin/datahub/upgrade/common/steps/GMSEnableWriteModeStep.java +++ b/datahub-upgrade/src/main/java/com/linkedin/datahub/upgrade/common/steps/GMSEnableWriteModeStep.java @@ -5,7 +5,7 @@ import com.linkedin.datahub.upgrade.UpgradeStep; import com.linkedin.datahub.upgrade.UpgradeStepResult; import com.linkedin.datahub.upgrade.impl.DefaultUpgradeStepResult; -import com.linkedin.entity.client.EntityClient; +import com.linkedin.entity.client.RestliEntityClient; import java.util.function.Function; import lombok.RequiredArgsConstructor; @@ -14,7 +14,7 @@ public class GMSEnableWriteModeStep implements UpgradeStep { private final Authentication _systemAuthentication; - private final EntityClient _entityClient; + private final RestliEntityClient _entityClient; @Override public String id() { diff --git a/datahub-upgrade/src/main/java/com/linkedin/datahub/upgrade/common/steps/GMSQualificationStep.java b/datahub-upgrade/src/main/java/com/linkedin/datahub/upgrade/common/steps/GMSQualificationStep.java index 75336a9b1f6da9..6513e4b58e834e 100644 --- a/datahub-upgrade/src/main/java/com/linkedin/datahub/upgrade/common/steps/GMSQualificationStep.java +++ b/datahub-upgrade/src/main/java/com/linkedin/datahub/upgrade/common/steps/GMSQualificationStep.java @@ -2,6 +2,7 @@ import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.databind.node.ObjectNode; import com.linkedin.datahub.upgrade.UpgradeContext; import com.linkedin.datahub.upgrade.UpgradeStep; import com.linkedin.datahub.upgrade.UpgradeStepResult; @@ -12,11 +13,16 @@ import java.io.InputStreamReader; import java.net.URL; import java.net.URLConnection; +import java.util.Map; import java.util.function.Function; +import lombok.RequiredArgsConstructor; +@RequiredArgsConstructor public class GMSQualificationStep implements UpgradeStep { + private final Map configToMatch; + private static String convertStreamToString(InputStream is) { BufferedReader reader = new BufferedReader(new InputStreamReader(is)); @@ -39,8 +45,6 @@ private static String convertStreamToString(InputStream is) { return sb.toString(); } - public GMSQualificationStep() { } - @Override public String id() { return "GMSQualificationStep"; @@ -51,6 +55,15 @@ public int retryCount() { return 2; } + private boolean isEligible(ObjectNode configJson) { + for (String key : configToMatch.keySet()) { + if (!configJson.has(key) || !configJson.get(key).asText().equals(configToMatch.get(key))) { + return false; + } + } + return true; + } + @Override public Function executable() { return (context) -> { @@ -65,7 +78,7 @@ public Function executable() { ObjectMapper mapper = new ObjectMapper(); JsonNode configJson = mapper.readTree(responseString); - if (configJson.get("noCode").asBoolean()) { + if (isEligible((ObjectNode) configJson)) { return new DefaultUpgradeStepResult( id(), UpgradeStepResult.Result.SUCCEEDED); diff --git a/datahub-upgrade/src/main/java/com/linkedin/datahub/upgrade/config/NoCodeUpgradeConfig.java b/datahub-upgrade/src/main/java/com/linkedin/datahub/upgrade/config/NoCodeUpgradeConfig.java index 9465314a10adb4..39b3daa73b78f7 100644 --- a/datahub-upgrade/src/main/java/com/linkedin/datahub/upgrade/config/NoCodeUpgradeConfig.java +++ b/datahub-upgrade/src/main/java/com/linkedin/datahub/upgrade/config/NoCodeUpgradeConfig.java @@ -2,7 +2,6 @@ import com.datahub.authentication.Authentication; import com.linkedin.datahub.upgrade.nocode.NoCodeUpgrade; - import com.linkedin.entity.client.RestliEntityClient; import com.linkedin.metadata.entity.EntityService; import com.linkedin.metadata.models.registry.EntityRegistry; @@ -22,7 +21,7 @@ public class NoCodeUpgradeConfig { ApplicationContext applicationContext; @Bean(name = "noCodeUpgrade") - @DependsOn({"ebeanServer", "entityService", "systemAuthentication", "javaEntityClient", "entityRegistry"}) + @DependsOn({"ebeanServer", "entityService", "systemAuthentication", "restliEntityClient", "entityRegistry"}) @Nonnull public NoCodeUpgrade createInstance() { final EbeanServer ebeanServer = applicationContext.getBean(EbeanServer.class); diff --git a/datahub-upgrade/src/main/java/com/linkedin/datahub/upgrade/config/RestoreBackupConfig.java b/datahub-upgrade/src/main/java/com/linkedin/datahub/upgrade/config/RestoreBackupConfig.java index 2fef27fcc97902..ebff7f4b899adf 100644 --- a/datahub-upgrade/src/main/java/com/linkedin/datahub/upgrade/config/RestoreBackupConfig.java +++ b/datahub-upgrade/src/main/java/com/linkedin/datahub/upgrade/config/RestoreBackupConfig.java @@ -2,8 +2,7 @@ import com.datahub.authentication.Authentication; import com.linkedin.datahub.upgrade.restorebackup.RestoreBackup; -import com.linkedin.entity.client.EntityClient; -import com.linkedin.entity.client.JavaEntityClient; +import com.linkedin.entity.client.RestliEntityClient; import com.linkedin.metadata.entity.EntityService; import com.linkedin.metadata.graph.GraphService; import com.linkedin.metadata.models.registry.EntityRegistry; @@ -23,24 +22,19 @@ public class RestoreBackupConfig { ApplicationContext applicationContext; @Bean(name = "restoreBackup") - @DependsOn({"ebeanServer", "entityService", "systemAuthentication", "javaEntityClient", "graphService", "searchService", "entityRegistry"}) + @DependsOn({"ebeanServer", "entityService", "systemAuthentication", "restliEntityClient", "graphService", + "searchService", "entityRegistry"}) @Nonnull public RestoreBackup createInstance() { final EbeanServer ebeanServer = applicationContext.getBean(EbeanServer.class); final EntityService entityService = applicationContext.getBean(EntityService.class); final Authentication systemAuthentication = applicationContext.getBean(Authentication.class); - final EntityClient entityClient = applicationContext.getBean(JavaEntityClient.class); + final RestliEntityClient entityClient = applicationContext.getBean(RestliEntityClient.class); final GraphService graphClient = applicationContext.getBean(GraphService.class); final EntitySearchService searchClient = applicationContext.getBean(EntitySearchService.class); final EntityRegistry entityRegistry = applicationContext.getBean(EntityRegistry.class); - return new RestoreBackup( - ebeanServer, - entityService, - entityRegistry, - systemAuthentication, - entityClient, - graphClient, - searchClient); + return new RestoreBackup(ebeanServer, entityService, entityRegistry, systemAuthentication, entityClient, + graphClient, searchClient); } } diff --git a/datahub-upgrade/src/main/java/com/linkedin/datahub/upgrade/nocode/NoCodeUpgrade.java b/datahub-upgrade/src/main/java/com/linkedin/datahub/upgrade/nocode/NoCodeUpgrade.java index 512054d9d98486..3efc0882f5a0d0 100644 --- a/datahub-upgrade/src/main/java/com/linkedin/datahub/upgrade/nocode/NoCodeUpgrade.java +++ b/datahub-upgrade/src/main/java/com/linkedin/datahub/upgrade/nocode/NoCodeUpgrade.java @@ -1,12 +1,13 @@ package com.linkedin.datahub.upgrade.nocode; import com.datahub.authentication.Authentication; +import com.google.common.collect.ImmutableMap; import com.linkedin.datahub.upgrade.Upgrade; import com.linkedin.datahub.upgrade.UpgradeCleanupStep; import com.linkedin.datahub.upgrade.UpgradeStep; import com.linkedin.datahub.upgrade.common.steps.GMSEnableWriteModeStep; import com.linkedin.datahub.upgrade.common.steps.GMSQualificationStep; -import com.linkedin.entity.client.EntityClient; +import com.linkedin.entity.client.RestliEntityClient; import com.linkedin.metadata.entity.EntityService; import com.linkedin.metadata.models.registry.EntityRegistry; import io.ebean.EbeanServer; @@ -30,7 +31,7 @@ public NoCodeUpgrade( final EntityService entityService, final EntityRegistry entityRegistry, final Authentication systemAuthentication, - final EntityClient entityClient) { + final RestliEntityClient entityClient) { _steps = buildUpgradeSteps( server, entityService, @@ -64,10 +65,10 @@ private List buildUpgradeSteps( final EntityService entityService, final EntityRegistry entityRegistry, final Authentication systemAuthentication, - final EntityClient entityClient) { + final RestliEntityClient entityClient) { final List steps = new ArrayList<>(); steps.add(new RemoveAspectV2TableStep(server)); - steps.add(new GMSQualificationStep()); + steps.add(new GMSQualificationStep(ImmutableMap.of("noCode", "true"))); steps.add(new UpgradeQualificationStep(server)); steps.add(new CreateAspectTableStep(server)); steps.add(new DataMigrationStep(server, entityService, entityRegistry)); diff --git a/datahub-upgrade/src/main/java/com/linkedin/datahub/upgrade/restorebackup/RestoreBackup.java b/datahub-upgrade/src/main/java/com/linkedin/datahub/upgrade/restorebackup/RestoreBackup.java index 9f70f8de817a01..a9dfa948c7873d 100644 --- a/datahub-upgrade/src/main/java/com/linkedin/datahub/upgrade/restorebackup/RestoreBackup.java +++ b/datahub-upgrade/src/main/java/com/linkedin/datahub/upgrade/restorebackup/RestoreBackup.java @@ -9,8 +9,7 @@ import com.linkedin.datahub.upgrade.common.steps.ClearSearchServiceStep; import com.linkedin.datahub.upgrade.common.steps.GMSDisableWriteModeStep; import com.linkedin.datahub.upgrade.common.steps.GMSEnableWriteModeStep; -import com.linkedin.datahub.upgrade.common.steps.GMSQualificationStep; -import com.linkedin.entity.client.EntityClient; +import com.linkedin.entity.client.RestliEntityClient; import com.linkedin.metadata.entity.EntityService; import com.linkedin.metadata.graph.GraphService; import com.linkedin.metadata.models.registry.EntityRegistry; @@ -29,7 +28,7 @@ public RestoreBackup( final EntityService entityService, final EntityRegistry entityRegistry, final Authentication systemAuthentication, - final EntityClient entityClient, + final RestliEntityClient entityClient, final GraphService graphClient, final EntitySearchService searchClient) { _steps = buildSteps(server, entityService, entityRegistry, systemAuthentication, entityClient, graphClient, searchClient); @@ -50,11 +49,10 @@ private List buildSteps( final EntityService entityService, final EntityRegistry entityRegistry, final Authentication systemAuthentication, - final EntityClient entityClient, + final RestliEntityClient entityClient, final GraphService graphClient, final EntitySearchService searchClient) { final List steps = new ArrayList<>(); - steps.add(new GMSQualificationStep()); steps.add(new GMSDisableWriteModeStep(systemAuthentication, entityClient)); steps.add(new ClearSearchServiceStep(searchClient, true)); steps.add(new ClearGraphServiceStep(graphClient, true)); diff --git a/datahub-upgrade/src/main/java/com/linkedin/datahub/upgrade/restoreindices/RestoreIndices.java b/datahub-upgrade/src/main/java/com/linkedin/datahub/upgrade/restoreindices/RestoreIndices.java index dfb22df9cca65c..d5aa5a0078296a 100644 --- a/datahub-upgrade/src/main/java/com/linkedin/datahub/upgrade/restoreindices/RestoreIndices.java +++ b/datahub-upgrade/src/main/java/com/linkedin/datahub/upgrade/restoreindices/RestoreIndices.java @@ -6,7 +6,6 @@ import com.linkedin.datahub.upgrade.UpgradeStep; import com.linkedin.datahub.upgrade.common.steps.ClearGraphServiceStep; import com.linkedin.datahub.upgrade.common.steps.ClearSearchServiceStep; -import com.linkedin.datahub.upgrade.common.steps.GMSQualificationStep; import com.linkedin.metadata.entity.EntityService; import com.linkedin.metadata.graph.GraphService; import com.linkedin.metadata.models.registry.EntityRegistry; @@ -42,7 +41,6 @@ private List buildSteps(final EbeanServer server, final EntityServi final EntityRegistry entityRegistry, final EntitySearchService entitySearchService, final GraphService graphService) { final List steps = new ArrayList<>(); - steps.add(new GMSQualificationStep()); steps.add(new ClearSearchServiceStep(entitySearchService, false)); steps.add(new ClearGraphServiceStep(graphService, false)); steps.add(new SendMAEStep(server, entityService, entityRegistry)); From 1e97ac6cf703f0a16693076eddc8c449e66bba77 Mon Sep 17 00:00:00 2001 From: Aseem Bansal Date: Fri, 10 Dec 2021 11:02:09 +0530 Subject: [PATCH 3/5] docs(guide): add example for adding user in DataHub (#3682) --- docs-website/sidebars.js | 11 +++-- docs/how/add-user-data.md | 92 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 100 insertions(+), 3 deletions(-) create mode 100644 docs/how/add-user-data.md diff --git a/docs-website/sidebars.js b/docs-website/sidebars.js index e31505f76edc40..e20d407991eaba 100644 --- a/docs-website/sidebars.js +++ b/docs-website/sidebars.js @@ -100,6 +100,14 @@ module.exports = { "docs/lineage/sample_code", ], }, + { + Guides: [ + "metadata-ingestion/adding-source", + "docs/how/add-custom-ingestion-source", + "docs/how/add-custom-data-platform", + "docs/how/add-user-data", + ], + }, ], "Metadata Modeling": [ "docs/modeling/metadata-model", @@ -184,7 +192,6 @@ module.exports = { // TODO: the titles of these should not be in question form in the sidebar "docs/developers", "docs/docker/development", - "metadata-ingestion/adding-source", { type: "doc", label: "Ingesting files from S3", @@ -206,8 +213,6 @@ module.exports = { "docs/how/delete-metadata", "datahub-web-react/src/app/analytics/README", "metadata-ingestion/developing", - "docs/how/add-custom-data-platform", - "docs/how/add-custom-ingestion-source", { "Module READMEs": [ "datahub-web-react/README", diff --git a/docs/how/add-user-data.md b/docs/how/add-user-data.md new file mode 100644 index 00000000000000..4452d342c8c1fc --- /dev/null +++ b/docs/how/add-user-data.md @@ -0,0 +1,92 @@ +# Adding user in DataHub + +This guide shares how you can add user metadata in DataHub. Usually you would want to use one of our sources for ingesting user metadata. But if there is no connector for your use case then you would want to use this guide. + +:::note + +This does not allow you add new users for Authentication. If you want to add a new user in DataHub for Login please refer to [JaaS Authentication](./auth/jaas.md) + +::: + +You can look at all aspects supported for users in [CorpUserAspect](../../metadata-models/src/main/pegasus/com/linkedin/metadata/aspect/CorpUserAspect.pdl) + +## Using File-Based Ingestion Recipe + +Define a JSON File containing your user +```my-user.json +[ + { + "auditHeader": null, + "proposedSnapshot": { + "com.linkedin.pegasus2avro.metadata.snapshot.CorpUserSnapshot": { + "urn": "urn:li:corpuser:aseem.bansal", + "aspects": [ + { + "com.linkedin.pegasus2avro.identity.CorpUserInfo": { + "active": true, + "displayName": { + "string": "Aseem Bansal" + }, + "email": "aseem+examples@acryl.io", + "title": { + "string": "Software Engineer" + }, + "managerUrn": null, + "departmentId": null, + "departmentName": null, + "firstName": null, + "lastName": null, + "fullName": { + "string": "Aseem Bansal" + }, + "countryCode": null + } + } + ] + } + } + } +] +``` + +Define an [ingestion recipe](https://datahubproject.io/docs/metadata-ingestion/#recipes) + +``` +--- +# see https://datahubproject.io/docs/metadata-ingestion/source_docs/file for complete documentation +source: + type: "file" + config: + filename: "./my-user.json" + +# see https://datahubproject.io/docs/metadata-ingestion/sink_docs/datahub for complete documentation +sink: + ... + +``` + +Use [DataHub CLI](../cli.md) to do the ingestion. + +## Using Rest.li API + +``` +curl 'http://localhost:8080/entities?action=ingest' -X POST --data '{ + "entity": { + "value": { + "com.linkedin.metadata.snapshot.CorpUserSnapshot": { + "urn": "urn:li:corpuser:aseem.bansal", + "aspects": [{ + "com.linkedin.identity.CorpUserInfo": { + "active": true, + "displayName": "Aseem Bansal", + "email": "aseem+example@acryl.io", + "title": "Software Engineer", + "fullName": "Aseem Bansal" + } + }] + } + } + } +}' +``` + From 1f1467aac2867942df9df15c879500e969ca5a75 Mon Sep 17 00:00:00 2001 From: Dexter Lee Date: Fri, 10 Dec 2021 15:51:06 +0900 Subject: [PATCH 4/5] fix(home): Change docs count to not count removed datasets (#3711) --- .../EntitySearchAggregationSource.java | 10 ---------- .../candidatesource/TopPlatformsSource.java | 7 ++----- .../candidatesource/TopTagsSource.java | 9 ++------- .../candidatesource/TopTermsSource.java | 9 ++------- .../search/elasticsearch/query/ESSearchDAO.java | 3 +-- .../query/request/SearchRequestHandler.java | 2 +- ...EntitySearchAggregationCandidateSourceTest.java | 6 ++---- .../TopPlatformsCandidateSourceFactory.java | 14 ++------------ .../TopTagsCandidateSourceFactory.java | 14 ++------------ .../TopTermsCandidateSourceFactory.java | 14 ++------------ 10 files changed, 16 insertions(+), 72 deletions(-) diff --git a/metadata-io/src/main/java/com/linkedin/metadata/recommendation/candidatesource/EntitySearchAggregationSource.java b/metadata-io/src/main/java/com/linkedin/metadata/recommendation/candidatesource/EntitySearchAggregationSource.java index d228bd7a1f281b..9fb0c18f1b6215 100644 --- a/metadata-io/src/main/java/com/linkedin/metadata/recommendation/candidatesource/EntitySearchAggregationSource.java +++ b/metadata-io/src/main/java/com/linkedin/metadata/recommendation/candidatesource/EntitySearchAggregationSource.java @@ -2,7 +2,6 @@ import com.google.common.collect.ImmutableList; import com.linkedin.common.urn.Urn; -import com.linkedin.metadata.models.registry.EntityRegistry; import com.linkedin.metadata.query.filter.Criterion; import com.linkedin.metadata.query.filter.CriterionArray; import com.linkedin.metadata.recommendation.ContentParams; @@ -11,7 +10,6 @@ import com.linkedin.metadata.recommendation.RecommendationRequestContext; import com.linkedin.metadata.recommendation.SearchParams; import com.linkedin.metadata.search.EntitySearchService; -import com.linkedin.metadata.search.cache.NonEmptyEntitiesCache; import io.opentelemetry.extension.annotations.WithSpan; import java.net.URISyntaxException; import java.util.Collections; @@ -28,7 +26,6 @@ import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.tuple.Pair; -import org.springframework.cache.CacheManager; /** @@ -39,13 +36,6 @@ @RequiredArgsConstructor public abstract class EntitySearchAggregationSource implements RecommendationSource { private final EntitySearchService _entitySearchService; - private final NonEmptyEntitiesCache _nonEmptyEntitiesCache; - - protected EntitySearchAggregationSource(EntitySearchService entitySearchService, EntityRegistry entityRegistry, - CacheManager cacheManager) { - _entitySearchService = entitySearchService; - _nonEmptyEntitiesCache = new NonEmptyEntitiesCache(entityRegistry, entitySearchService, cacheManager); - } /** * Field to aggregate on diff --git a/metadata-io/src/main/java/com/linkedin/metadata/recommendation/candidatesource/TopPlatformsSource.java b/metadata-io/src/main/java/com/linkedin/metadata/recommendation/candidatesource/TopPlatformsSource.java index 797aa70bb942b4..5a6422246f6881 100644 --- a/metadata-io/src/main/java/com/linkedin/metadata/recommendation/candidatesource/TopPlatformsSource.java +++ b/metadata-io/src/main/java/com/linkedin/metadata/recommendation/candidatesource/TopPlatformsSource.java @@ -4,14 +4,12 @@ import com.linkedin.data.template.RecordTemplate; import com.linkedin.dataplatform.DataPlatformInfo; import com.linkedin.metadata.entity.EntityService; -import com.linkedin.metadata.models.registry.EntityRegistry; import com.linkedin.metadata.recommendation.RecommendationRenderType; import com.linkedin.metadata.recommendation.RecommendationRequestContext; import com.linkedin.metadata.recommendation.ScenarioType; import com.linkedin.metadata.search.EntitySearchService; import javax.annotation.Nonnull; import lombok.extern.slf4j.Slf4j; -import org.springframework.cache.CacheManager; @Slf4j @@ -20,9 +18,8 @@ public class TopPlatformsSource extends EntitySearchAggregationSource { private static final String PLATFORM = "platform"; - public TopPlatformsSource(EntityService entityService, EntitySearchService entitySearchService, - EntityRegistry entityRegistry, CacheManager cacheManager) { - super(entitySearchService, entityRegistry, cacheManager); + public TopPlatformsSource(EntityService entityService, EntitySearchService entitySearchService) { + super(entitySearchService); _entityService = entityService; } diff --git a/metadata-io/src/main/java/com/linkedin/metadata/recommendation/candidatesource/TopTagsSource.java b/metadata-io/src/main/java/com/linkedin/metadata/recommendation/candidatesource/TopTagsSource.java index 81cff5eeac8522..6563ea7dc4f917 100644 --- a/metadata-io/src/main/java/com/linkedin/metadata/recommendation/candidatesource/TopTagsSource.java +++ b/metadata-io/src/main/java/com/linkedin/metadata/recommendation/candidatesource/TopTagsSource.java @@ -1,14 +1,12 @@ package com.linkedin.metadata.recommendation.candidatesource; import com.linkedin.common.urn.Urn; -import com.linkedin.metadata.models.registry.EntityRegistry; import com.linkedin.metadata.recommendation.RecommendationRenderType; import com.linkedin.metadata.recommendation.RecommendationRequestContext; import com.linkedin.metadata.recommendation.ScenarioType; import com.linkedin.metadata.search.EntitySearchService; import javax.annotation.Nonnull; import lombok.extern.slf4j.Slf4j; -import org.springframework.cache.CacheManager; @Slf4j @@ -16,11 +14,8 @@ public class TopTagsSource extends EntitySearchAggregationSource { private static final String TAGS = "tags"; - public TopTagsSource( - EntitySearchService entitySearchService, - EntityRegistry entityRegistry, - CacheManager cacheManager) { - super(entitySearchService, entityRegistry, cacheManager); + public TopTagsSource(EntitySearchService entitySearchService) { + super(entitySearchService); } @Override diff --git a/metadata-io/src/main/java/com/linkedin/metadata/recommendation/candidatesource/TopTermsSource.java b/metadata-io/src/main/java/com/linkedin/metadata/recommendation/candidatesource/TopTermsSource.java index 0872881c664971..e885208a8b6dbe 100644 --- a/metadata-io/src/main/java/com/linkedin/metadata/recommendation/candidatesource/TopTermsSource.java +++ b/metadata-io/src/main/java/com/linkedin/metadata/recommendation/candidatesource/TopTermsSource.java @@ -1,14 +1,12 @@ package com.linkedin.metadata.recommendation.candidatesource; import com.linkedin.common.urn.Urn; -import com.linkedin.metadata.models.registry.EntityRegistry; import com.linkedin.metadata.recommendation.RecommendationRenderType; import com.linkedin.metadata.recommendation.RecommendationRequestContext; import com.linkedin.metadata.recommendation.ScenarioType; import com.linkedin.metadata.search.EntitySearchService; import javax.annotation.Nonnull; import lombok.extern.slf4j.Slf4j; -import org.springframework.cache.CacheManager; @Slf4j @@ -16,11 +14,8 @@ public class TopTermsSource extends EntitySearchAggregationSource { private static final String TERMS = "glossaryTerms"; - public TopTermsSource( - EntitySearchService entitySearchService, - EntityRegistry entityRegistry, - CacheManager cacheManager) { - super(entitySearchService, entityRegistry, cacheManager); + public TopTermsSource(EntitySearchService entitySearchService) { + super(entitySearchService); } @Override diff --git a/metadata-io/src/main/java/com/linkedin/metadata/search/elasticsearch/query/ESSearchDAO.java b/metadata-io/src/main/java/com/linkedin/metadata/search/elasticsearch/query/ESSearchDAO.java index 23089d0199efe0..36ce910023edb6 100644 --- a/metadata-io/src/main/java/com/linkedin/metadata/search/elasticsearch/query/ESSearchDAO.java +++ b/metadata-io/src/main/java/com/linkedin/metadata/search/elasticsearch/query/ESSearchDAO.java @@ -24,7 +24,6 @@ import org.elasticsearch.client.RequestOptions; import org.elasticsearch.client.RestHighLevelClient; import org.elasticsearch.client.core.CountRequest; -import org.elasticsearch.index.query.QueryBuilders; /** @@ -41,7 +40,7 @@ public class ESSearchDAO { public long docCount(@Nonnull String entityName) { EntitySpec entitySpec = entityRegistry.getEntitySpec(entityName); CountRequest countRequest = - new CountRequest(indexConvention.getIndexName(entitySpec)).query(QueryBuilders.matchAllQuery()); + new CountRequest(indexConvention.getIndexName(entitySpec)).query(SearchRequestHandler.getFilterQuery(null)); try (Timer.Context ignored = MetricUtils.timer(this.getClass(), "docCount").time()) { return client.count(countRequest, RequestOptions.DEFAULT).getCount(); } catch (IOException e) { diff --git a/metadata-io/src/main/java/com/linkedin/metadata/search/elasticsearch/query/request/SearchRequestHandler.java b/metadata-io/src/main/java/com/linkedin/metadata/search/elasticsearch/query/request/SearchRequestHandler.java index 548c20057e1fa9..55799330fe0e9e 100644 --- a/metadata-io/src/main/java/com/linkedin/metadata/search/elasticsearch/query/request/SearchRequestHandler.java +++ b/metadata-io/src/main/java/com/linkedin/metadata/search/elasticsearch/query/request/SearchRequestHandler.java @@ -98,7 +98,7 @@ private Set getDefaultQueryFieldNames() { .collect(Collectors.toSet()); } - private static BoolQueryBuilder getFilterQuery(@Nullable Filter filter) { + public static BoolQueryBuilder getFilterQuery(@Nullable Filter filter) { BoolQueryBuilder filterQuery = ESUtils.buildFilterQuery(filter); // Filter out entities that are marked "removed" filterQuery.mustNot(QueryBuilders.matchQuery("removed", true)); diff --git a/metadata-io/src/test/java/com/linkedin/metadata/recommendation/candidatesource/EntitySearchAggregationCandidateSourceTest.java b/metadata-io/src/test/java/com/linkedin/metadata/recommendation/candidatesource/EntitySearchAggregationCandidateSourceTest.java index 2d3fac8b608e1e..0dc517eaf0d1c9 100644 --- a/metadata-io/src/test/java/com/linkedin/metadata/recommendation/candidatesource/EntitySearchAggregationCandidateSourceTest.java +++ b/metadata-io/src/test/java/com/linkedin/metadata/recommendation/candidatesource/EntitySearchAggregationCandidateSourceTest.java @@ -10,7 +10,6 @@ import com.linkedin.metadata.recommendation.RecommendationRequestContext; import com.linkedin.metadata.recommendation.ScenarioType; import com.linkedin.metadata.search.EntitySearchService; -import com.linkedin.metadata.search.cache.NonEmptyEntitiesCache; import java.util.Collections; import java.util.List; import javax.annotation.Nonnull; @@ -31,7 +30,6 @@ public class EntitySearchAggregationCandidateSourceTest { private EntitySearchService _entitySearchService = Mockito.mock(EntitySearchService.class); - private NonEmptyEntitiesCache _nonEmptyEntitiesCache = Mockito.mock(NonEmptyEntitiesCache.class); private EntitySearchAggregationSource _valueBasedCandidateSource; private EntitySearchAggregationSource _urnBasedCandidateSource; @@ -41,13 +39,13 @@ public class EntitySearchAggregationCandidateSourceTest { @BeforeMethod public void setup() { - Mockito.reset(_entitySearchService, _nonEmptyEntitiesCache); + Mockito.reset(_entitySearchService); _valueBasedCandidateSource = buildCandidateSource("testValue", false); _urnBasedCandidateSource = buildCandidateSource("testUrn", true); } private EntitySearchAggregationSource buildCandidateSource(String identifier, boolean isValueUrn) { - return new EntitySearchAggregationSource(_entitySearchService, _nonEmptyEntitiesCache) { + return new EntitySearchAggregationSource(_entitySearchService) { @Override protected String getSearchFieldName() { return identifier; diff --git a/metadata-service/factories/src/main/java/com/linkedin/gms/factory/recommendation/candidatesource/TopPlatformsCandidateSourceFactory.java b/metadata-service/factories/src/main/java/com/linkedin/gms/factory/recommendation/candidatesource/TopPlatformsCandidateSourceFactory.java index 12221ff0828624..fc04bbcce31ee3 100644 --- a/metadata-service/factories/src/main/java/com/linkedin/gms/factory/recommendation/candidatesource/TopPlatformsCandidateSourceFactory.java +++ b/metadata-service/factories/src/main/java/com/linkedin/gms/factory/recommendation/candidatesource/TopPlatformsCandidateSourceFactory.java @@ -1,23 +1,20 @@ package com.linkedin.gms.factory.recommendation.candidatesource; import com.linkedin.gms.factory.entity.EntityServiceFactory; -import com.linkedin.gms.factory.entityregistry.EntityRegistryFactory; import com.linkedin.gms.factory.search.EntitySearchServiceFactory; import com.linkedin.metadata.entity.EntityService; -import com.linkedin.metadata.models.registry.EntityRegistry; import com.linkedin.metadata.recommendation.candidatesource.TopPlatformsSource; import com.linkedin.metadata.search.EntitySearchService; import javax.annotation.Nonnull; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Qualifier; -import org.springframework.cache.CacheManager; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Import; @Configuration -@Import({EntityServiceFactory.class, EntitySearchServiceFactory.class, EntityRegistryFactory.class}) +@Import({EntityServiceFactory.class, EntitySearchServiceFactory.class}) public class TopPlatformsCandidateSourceFactory { @Autowired @@ -28,16 +25,9 @@ public class TopPlatformsCandidateSourceFactory { @Qualifier("entitySearchService") private EntitySearchService entitySearchService; - @Autowired - @Qualifier("entityRegistry") - private EntityRegistry entityRegistry; - - @Autowired - private CacheManager cacheManager; - @Bean(name = "topPlatformsCandidateSource") @Nonnull protected TopPlatformsSource getInstance() { - return new TopPlatformsSource(entityService, entitySearchService, entityRegistry, cacheManager); + return new TopPlatformsSource(entityService, entitySearchService); } } diff --git a/metadata-service/factories/src/main/java/com/linkedin/gms/factory/recommendation/candidatesource/TopTagsCandidateSourceFactory.java b/metadata-service/factories/src/main/java/com/linkedin/gms/factory/recommendation/candidatesource/TopTagsCandidateSourceFactory.java index 14a149ca2b2a26..857a788454c34a 100644 --- a/metadata-service/factories/src/main/java/com/linkedin/gms/factory/recommendation/candidatesource/TopTagsCandidateSourceFactory.java +++ b/metadata-service/factories/src/main/java/com/linkedin/gms/factory/recommendation/candidatesource/TopTagsCandidateSourceFactory.java @@ -1,37 +1,27 @@ package com.linkedin.gms.factory.recommendation.candidatesource; -import com.linkedin.gms.factory.entityregistry.EntityRegistryFactory; import com.linkedin.gms.factory.search.EntitySearchServiceFactory; -import com.linkedin.metadata.models.registry.EntityRegistry; import com.linkedin.metadata.recommendation.candidatesource.TopTagsSource; import com.linkedin.metadata.search.EntitySearchService; import javax.annotation.Nonnull; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Qualifier; -import org.springframework.cache.CacheManager; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Import; @Configuration -@Import({EntitySearchServiceFactory.class, EntityRegistryFactory.class}) +@Import({EntitySearchServiceFactory.class}) public class TopTagsCandidateSourceFactory { @Autowired @Qualifier("entitySearchService") private EntitySearchService entitySearchService; - @Autowired - @Qualifier("entityRegistry") - private EntityRegistry entityRegistry; - - @Autowired - private CacheManager cacheManager; - @Bean(name = "topTagsCandidateSource") @Nonnull protected TopTagsSource getInstance() { - return new TopTagsSource(entitySearchService, entityRegistry, cacheManager); + return new TopTagsSource(entitySearchService); } } diff --git a/metadata-service/factories/src/main/java/com/linkedin/gms/factory/recommendation/candidatesource/TopTermsCandidateSourceFactory.java b/metadata-service/factories/src/main/java/com/linkedin/gms/factory/recommendation/candidatesource/TopTermsCandidateSourceFactory.java index 867247aa71c6ef..b8d50169e49ab7 100644 --- a/metadata-service/factories/src/main/java/com/linkedin/gms/factory/recommendation/candidatesource/TopTermsCandidateSourceFactory.java +++ b/metadata-service/factories/src/main/java/com/linkedin/gms/factory/recommendation/candidatesource/TopTermsCandidateSourceFactory.java @@ -1,37 +1,27 @@ package com.linkedin.gms.factory.recommendation.candidatesource; -import com.linkedin.gms.factory.entityregistry.EntityRegistryFactory; import com.linkedin.gms.factory.search.EntitySearchServiceFactory; -import com.linkedin.metadata.models.registry.EntityRegistry; import com.linkedin.metadata.recommendation.candidatesource.TopTermsSource; import com.linkedin.metadata.search.EntitySearchService; import javax.annotation.Nonnull; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Qualifier; -import org.springframework.cache.CacheManager; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Import; @Configuration -@Import({EntitySearchServiceFactory.class, EntityRegistryFactory.class}) +@Import({EntitySearchServiceFactory.class}) public class TopTermsCandidateSourceFactory { @Autowired @Qualifier("entitySearchService") private EntitySearchService entitySearchService; - @Autowired - @Qualifier("entityRegistry") - private EntityRegistry entityRegistry; - - @Autowired - private CacheManager cacheManager; - @Bean(name = "topTermsCandidateSource") @Nonnull protected TopTermsSource getInstance() { - return new TopTermsSource(entitySearchService, entityRegistry, cacheManager); + return new TopTermsSource(entitySearchService); } } From d651040c85a839287a4c493838c846da9a3507e1 Mon Sep 17 00:00:00 2001 From: Fredrik Sannholm Date: Fri, 10 Dec 2021 20:07:55 +0200 Subject: [PATCH 5/5] Fix vulnderability (#3716) --- metadata-dao-impl/kafka-producer/build.gradle | 9 +++++++++ metadata-events/mxe-registration/build.gradle | 9 +++++++++ metadata-events/mxe-utils-avro-1.7/build.gradle | 9 +++++++++ metadata-ingestion-examples/common/build.gradle | 9 +++++++++ metadata-ingestion-examples/kafka-etl/build.gradle | 9 +++++++++ metadata-ingestion-examples/mce-cli/build.gradle | 10 ++++++++++ metadata-io/build.gradle | 9 +++++++++ metadata-service/restli-servlet-impl/build.gradle | 9 +++++++++ .../metadata-models-test-utils/build.gradle | 9 +++++++++ metadata-testing/metadata-test-utils/build.gradle | 9 +++++++++ metadata-utils/build.gradle | 10 ++++++++++ 11 files changed, 101 insertions(+) diff --git a/metadata-dao-impl/kafka-producer/build.gradle b/metadata-dao-impl/kafka-producer/build.gradle index d2577159f17ddd..9c29164e6c1340 100644 --- a/metadata-dao-impl/kafka-producer/build.gradle +++ b/metadata-dao-impl/kafka-producer/build.gradle @@ -15,4 +15,13 @@ dependencies { annotationProcessor externalDependency.lombok testCompile externalDependency.mockito + + constraints { + implementation("org.apache.logging.log4j:log4j-core:2.15.0") { + because("previous versions are vulnerable to CVE-2021-44228") + } + implementation("org.apache.logging.log4j:log4j-api:2.15.0") { + because("previous versions are vulnerable to CVE-2021-44228") + } + } } \ No newline at end of file diff --git a/metadata-events/mxe-registration/build.gradle b/metadata-events/mxe-registration/build.gradle index 9160bbeb294126..c6d9bafc2372f0 100644 --- a/metadata-events/mxe-registration/build.gradle +++ b/metadata-events/mxe-registration/build.gradle @@ -13,6 +13,15 @@ dependencies { testCompile project(':metadata-testing:metadata-test-utils') avroOriginal project(path: ':metadata-models', configuration: 'avroSchema') + + constraints { + implementation("org.apache.logging.log4j:log4j-core:2.15.0") { + because("previous versions are vulnerable to CVE-2021-44228") + } + implementation("org.apache.logging.log4j:log4j-api:2.15.0") { + because("previous versions are vulnerable to CVE-2021-44228") + } + } } // copy original MXE avro schema from metadata-models to resources diff --git a/metadata-events/mxe-utils-avro-1.7/build.gradle b/metadata-events/mxe-utils-avro-1.7/build.gradle index 80f37a4ddfad3d..0352700b630f3a 100644 --- a/metadata-events/mxe-utils-avro-1.7/build.gradle +++ b/metadata-events/mxe-utils-avro-1.7/build.gradle @@ -7,6 +7,15 @@ dependencies { testCompile externalDependency.gmaDaoApi testCompile project(':metadata-testing:metadata-test-utils') + + constraints { + implementation("org.apache.logging.log4j:log4j-core:2.15.0") { + because("previous versions are vulnerable to CVE-2021-44228") + } + implementation("org.apache.logging.log4j:log4j-api:2.15.0") { + because("previous versions are vulnerable to CVE-2021-44228") + } + } } // copy original MXE avro schema from metadata-events to resources diff --git a/metadata-ingestion-examples/common/build.gradle b/metadata-ingestion-examples/common/build.gradle index 7f59e1384b2293..d31f75d607f8e3 100644 --- a/metadata-ingestion-examples/common/build.gradle +++ b/metadata-ingestion-examples/common/build.gradle @@ -17,4 +17,13 @@ dependencies { annotationProcessor externalDependency.lombok runtime externalDependency.logbackClassic + + constraints { + implementation("org.apache.logging.log4j:log4j-core:2.15.0") { + because("previous versions are vulnerable to CVE-2021-44228") + } + implementation("org.apache.logging.log4j:log4j-api:2.15.0") { + because("previous versions are vulnerable to CVE-2021-44228") + } + } } diff --git a/metadata-ingestion-examples/kafka-etl/build.gradle b/metadata-ingestion-examples/kafka-etl/build.gradle index 63ad976ca0c408..c00cabb9fbf746 100644 --- a/metadata-ingestion-examples/kafka-etl/build.gradle +++ b/metadata-ingestion-examples/kafka-etl/build.gradle @@ -20,6 +20,15 @@ dependencies { annotationProcessor externalDependency.lombok runtime externalDependency.logbackClassic + + constraints { + implementation("org.apache.logging.log4j:log4j-core:2.15.0") { + because("previous versions are vulnerable to CVE-2021-44228") + } + implementation("org.apache.logging.log4j:log4j-api:2.15.0") { + because("previous versions are vulnerable to CVE-2021-44228") + } + } } bootJar { diff --git a/metadata-ingestion-examples/mce-cli/build.gradle b/metadata-ingestion-examples/mce-cli/build.gradle index abab1e51b673e3..f384afe747363d 100644 --- a/metadata-ingestion-examples/mce-cli/build.gradle +++ b/metadata-ingestion-examples/mce-cli/build.gradle @@ -26,6 +26,16 @@ dependencies { annotationProcessor externalDependency.lombok annotationProcessor externalDependency.picocli + + constraints { + implementation("org.apache.logging.log4j:log4j-core:2.15.0") { + because("previous versions are vulnerable to CVE-2021-44228") + } + implementation("org.apache.logging.log4j:log4j-api:2.15.0") { + because("previous versions are vulnerable to CVE-2021-44228") + } + } + } bootJar { diff --git a/metadata-io/build.gradle b/metadata-io/build.gradle index d0605353d69f17..39b193b6c2da81 100644 --- a/metadata-io/build.gradle +++ b/metadata-io/build.gradle @@ -45,6 +45,15 @@ dependencies { testCompile project(':test-models') testAnnotationProcessor externalDependency.lombok + + constraints { + implementation("org.apache.logging.log4j:log4j-core:2.15.0") { + because("previous versions are vulnerable to CVE-2021-44228") + } + implementation("org.apache.logging.log4j:log4j-api:2.15.0") { + because("previous versions are vulnerable to CVE-2021-44228") + } + } } test { diff --git a/metadata-service/restli-servlet-impl/build.gradle b/metadata-service/restli-servlet-impl/build.gradle index 90835b258c0047..512ca3e51bfa05 100644 --- a/metadata-service/restli-servlet-impl/build.gradle +++ b/metadata-service/restli-servlet-impl/build.gradle @@ -23,6 +23,15 @@ configurations { } dependencies { + constraints { + implementation("org.apache.logging.log4j:log4j-core:2.15.0") { + because("previous versions are vulnerable to CVE-2021-44228") + } + implementation("org.apache.logging.log4j:log4j-api:2.15.0") { + because("previous versions are vulnerable to CVE-2021-44228") + } + } + compile project(':metadata-service:restli-api') compile project(path: ':metadata-service:restli-api', configuration: 'dataTemplate') compile project(':li-utils') diff --git a/metadata-testing/metadata-models-test-utils/build.gradle b/metadata-testing/metadata-models-test-utils/build.gradle index 5ea742a61ef5e9..7ea27afddb67e9 100644 --- a/metadata-testing/metadata-models-test-utils/build.gradle +++ b/metadata-testing/metadata-models-test-utils/build.gradle @@ -10,4 +10,13 @@ dependencies { compile externalDependency.jacksonDataBind compile externalDependency.lombok compile externalDependency.neo4jHarness + + constraints { + implementation("org.apache.logging.log4j:log4j-core:2.15.0") { + because("previous versions are vulnerable to CVE-2021-44228") + } + implementation("org.apache.logging.log4j:log4j-api:2.15.0") { + because("previous versions are vulnerable to CVE-2021-44228") + } + } } diff --git a/metadata-testing/metadata-test-utils/build.gradle b/metadata-testing/metadata-test-utils/build.gradle index c47b015d04dfc2..f337f1016647dd 100644 --- a/metadata-testing/metadata-test-utils/build.gradle +++ b/metadata-testing/metadata-test-utils/build.gradle @@ -9,4 +9,13 @@ dependencies { compile externalDependency.jacksonDataBind compile externalDependency.lombok compile externalDependency.neo4jHarness + + constraints { + implementation("org.apache.logging.log4j:log4j-core:2.15.0") { + because("previous versions are vulnerable to CVE-2021-44228") + } + implementation("org.apache.logging.log4j:log4j-api:2.15.0") { + because("previous versions are vulnerable to CVE-2021-44228") + } + } } diff --git a/metadata-utils/build.gradle b/metadata-utils/build.gradle index 7fff6d930afc30..2f6566aef677ba 100644 --- a/metadata-utils/build.gradle +++ b/metadata-utils/build.gradle @@ -26,4 +26,14 @@ dependencies { testCompile project(':test-models') testCompile project(':metadata-testing:metadata-test-utils') + + constraints { + implementation("org.apache.logging.log4j:log4j-core:2.15.0") { + because("previous versions are vulnerable to CVE-2021-44228") + } + implementation("org.apache.logging.log4j:log4j-api:2.15.0") { + because("previous versions are vulnerable to CVE-2021-44228") + } + } + } \ No newline at end of file