From 955aba1d319c7ae75cd49e25a32fa139efdcfd73 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mat=C4=9Bj=20Groman?= <32076344+Matej4545@users.noreply.github.com> Date: Mon, 3 Jun 2024 13:27:33 +0200 Subject: [PATCH] [Snyk] Security upgrade Kentico.Xperience.Libraries from 13.0.73 to 13.0.137 (#35) * fix: src/Kentico.Xperience.AlgoliaSearch.csproj to reduce vulnerabilities The following vulnerabilities are fixed with an upgrade: - https://snyk.io/vuln/SNYK-DOTNET-MICROSOFTIDENTITYMODELJSONWEBTOKENS-6148656 - https://snyk.io/vuln/SNYK-DOTNET-SYSTEMDATASQLCLIENT-6149433 - https://snyk.io/vuln/SNYK-DOTNET-SYSTEMIDENTITYMODELTOKENSJWT-6148655 * fix(AlgoliaClient): manually clear and update data instead of replace * update(tests): project version --------- Co-authored-by: snyk-bot Co-authored-by: bkapustik <82807109+bkapustik@users.noreply.github.com> --- src/Kentico.Xperience.AlgoliaSearch.csproj | 2 +- src/Services/Implementations/DefaultAlgoliaClient.cs | 3 ++- tests/Kentico.Xperience.AlgoliaSearch.Tests.csproj | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/Kentico.Xperience.AlgoliaSearch.csproj b/src/Kentico.Xperience.AlgoliaSearch.csproj index ca6aa93..870236f 100644 --- a/src/Kentico.Xperience.AlgoliaSearch.csproj +++ b/src/Kentico.Xperience.AlgoliaSearch.csproj @@ -38,7 +38,7 @@ - + diff --git a/src/Services/Implementations/DefaultAlgoliaClient.cs b/src/Services/Implementations/DefaultAlgoliaClient.cs index 2c4187a..ee37340 100644 --- a/src/Services/Implementations/DefaultAlgoliaClient.cs +++ b/src/Services/Implementations/DefaultAlgoliaClient.cs @@ -181,7 +181,8 @@ public void Rebuild(string indexName) var dataToUpsert = new List(); indexedNodes.ForEach(node => dataToUpsert.AddRange(GetDataToUpsert(new AlgoliaQueueItem(node, AlgoliaTaskType.CREATE, algoliaIndex.IndexName)))); var searchIndex = algoliaIndexService.InitializeIndex(algoliaIndex.IndexName); - searchIndex.ReplaceAllObjects(dataToUpsert); + searchIndex.ClearObjects(); + searchIndex.SaveObjects(dataToUpsert); } diff --git a/tests/Kentico.Xperience.AlgoliaSearch.Tests.csproj b/tests/Kentico.Xperience.AlgoliaSearch.Tests.csproj index 6e41408..018e539 100644 --- a/tests/Kentico.Xperience.AlgoliaSearch.Tests.csproj +++ b/tests/Kentico.Xperience.AlgoliaSearch.Tests.csproj @@ -9,7 +9,7 @@ - +