From 3f5d84c06586449f523e252b0b7f7b2391d53931 Mon Sep 17 00:00:00 2001 From: Oprea Alexandru Date: Thu, 11 Jul 2024 22:20:34 +0300 Subject: [PATCH 1/8] fixed compilation on MacOS --- Source/ConfigCat/Private/ConfigCatSha.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/Source/ConfigCat/Private/ConfigCatSha.cpp b/Source/ConfigCat/Private/ConfigCatSha.cpp index 19b98a5..dd460c8 100644 --- a/Source/ConfigCat/Private/ConfigCatSha.cpp +++ b/Source/ConfigCat/Private/ConfigCatSha.cpp @@ -3,6 +3,7 @@ #include "ConfigCatSha.h" #include +#include std::string configcat::sha1(const std::string& input) { From ae895306ad36761d2f50b081bf1f152039a63c83 Mon Sep 17 00:00:00 2001 From: Oprea Alexandru Date: Thu, 11 Jul 2024 22:20:44 +0300 Subject: [PATCH 2/8] version bump + engine version bump --- ConfigCat.uplugin | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ConfigCat.uplugin b/ConfigCat.uplugin index 915dc39..7e366b3 100644 --- a/ConfigCat.uplugin +++ b/ConfigCat.uplugin @@ -1,7 +1,7 @@ { "FileVersion": 3, - "VersionName": "2.1.0", - "EngineVersion": "5.3", + "VersionName": "2.1.1", + "EngineVersion": "5.4", "FriendlyName": "ConfigCat", "Description": "ConfigCat is a hosted service for feature flag and configuration management. It lets you decouple feature releases from code deployments.", "Category": "FeatureFlags", From 53dfb21538f8e01843c8ab72d9968f6a7e61f73d Mon Sep 17 00:00:00 2001 From: Oprea Alexandru Date: Fri, 12 Jul 2024 10:50:03 +0300 Subject: [PATCH 3/8] compilation fixes for 5.4 --- Source/ConfigCat/Private/ConfigCatNetworkAdapter.cpp | 1 + Source/ConfigCat/Private/ConfigCatSha.cpp | 3 ++- Source/ConfigCat/Public/ConfigCatSha.h | 2 ++ 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/Source/ConfigCat/Private/ConfigCatNetworkAdapter.cpp b/Source/ConfigCat/Private/ConfigCatNetworkAdapter.cpp index 4ec97f9..0a6fa8a 100644 --- a/Source/ConfigCat/Private/ConfigCatNetworkAdapter.cpp +++ b/Source/ConfigCat/Private/ConfigCatNetworkAdapter.cpp @@ -8,6 +8,7 @@ #include #include #include +#include #include "ConfigCatLog.h" diff --git a/Source/ConfigCat/Private/ConfigCatSha.cpp b/Source/ConfigCat/Private/ConfigCatSha.cpp index dd460c8..a22f14f 100644 --- a/Source/ConfigCat/Private/ConfigCatSha.cpp +++ b/Source/ConfigCat/Private/ConfigCatSha.cpp @@ -2,8 +2,9 @@ #include "ConfigCatSha.h" +#include +#include #include -#include std::string configcat::sha1(const std::string& input) { diff --git a/Source/ConfigCat/Public/ConfigCatSha.h b/Source/ConfigCat/Public/ConfigCatSha.h index 48e08bb..b00d594 100644 --- a/Source/ConfigCat/Public/ConfigCatSha.h +++ b/Source/ConfigCat/Public/ConfigCatSha.h @@ -2,6 +2,8 @@ #pragma once +#include + namespace configcat { From 31508bbe57b63cd34508ec6ed78abdd136a1d766 Mon Sep 17 00:00:00 2001 From: Oprea Alexandru Date: Fri, 12 Jul 2024 11:09:40 +0300 Subject: [PATCH 4/8] more includes for compilation fixes --- Source/ConfigCat/Private/ConfigCatSha.cpp | 1 + Source/ConfigCat/Private/ConfigCatSubsystem.cpp | 1 + Source/ConfigCatWrappers/Public/ConfigCatUserWrapper.h | 1 + 3 files changed, 3 insertions(+) diff --git a/Source/ConfigCat/Private/ConfigCatSha.cpp b/Source/ConfigCat/Private/ConfigCatSha.cpp index a22f14f..4b5cb9d 100644 --- a/Source/ConfigCat/Private/ConfigCatSha.cpp +++ b/Source/ConfigCat/Private/ConfigCatSha.cpp @@ -3,6 +3,7 @@ #include "ConfigCatSha.h" #include +#include #include #include diff --git a/Source/ConfigCat/Private/ConfigCatSubsystem.cpp b/Source/ConfigCat/Private/ConfigCatSubsystem.cpp index f1638d7..77116d1 100644 --- a/Source/ConfigCat/Private/ConfigCatSubsystem.cpp +++ b/Source/ConfigCat/Private/ConfigCatSubsystem.cpp @@ -11,6 +11,7 @@ #include #include #include +#include #include "ConfigCat.h" #include "ConfigCatLog.h" diff --git a/Source/ConfigCatWrappers/Public/ConfigCatUserWrapper.h b/Source/ConfigCatWrappers/Public/ConfigCatUserWrapper.h index 3fd8903..c22c7c1 100644 --- a/Source/ConfigCatWrappers/Public/ConfigCatUserWrapper.h +++ b/Source/ConfigCatWrappers/Public/ConfigCatUserWrapper.h @@ -4,6 +4,7 @@ #include +#include #include #include "ConfigCatUserWrapper.generated.h" From 2cf6fa8a7685dc13f74d84a9161cf01211ccba59 Mon Sep 17 00:00:00 2001 From: Oprea Alexandru Date: Fri, 12 Jul 2024 11:22:35 +0300 Subject: [PATCH 5/8] version bump for compilation fixes --- ConfigCat.uplugin | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ConfigCat.uplugin b/ConfigCat.uplugin index 7e366b3..523a8ee 100644 --- a/ConfigCat.uplugin +++ b/ConfigCat.uplugin @@ -1,6 +1,6 @@ { "FileVersion": 3, - "VersionName": "2.1.1", + "VersionName": "2.1.2", "EngineVersion": "5.4", "FriendlyName": "ConfigCat", "Description": "ConfigCat is a hosted service for feature flag and configuration management. It lets you decouple feature releases from code deployments.", From f5bbbc3eaa74e75435edf7200192ef5d6120d0f6 Mon Sep 17 00:00:00 2001 From: Oprea Alexandru Date: Thu, 18 Jul 2024 09:07:33 +0300 Subject: [PATCH 6/8] added hash-library third party back --- .github/workflows/plugin-cd.yml | 15 ++++++++++----- .github/workflows/plugin-ci.yml | 3 ++- ConfigCat.uplugin | 2 +- Extras/licenses/hash-library/LICENSE | 10 ++++++++++ README.md | 2 +- Source/ConfigCat/ConfigCat.Build.cs | 5 +---- 6 files changed, 25 insertions(+), 12 deletions(-) create mode 100644 Extras/licenses/hash-library/LICENSE diff --git a/.github/workflows/plugin-cd.yml b/.github/workflows/plugin-cd.yml index a1be719..3eda698 100644 --- a/.github/workflows/plugin-cd.yml +++ b/.github/workflows/plugin-cd.yml @@ -21,13 +21,14 @@ jobs: git clone https://github.com/microsoft/vcpkg build/vcpkg git -C build/vcpkg checkout ${{ env.VCPKG_COMMIT_HASH }} ./build/vcpkg/bootstrap-vcpkg.bat - ./build/vcpkg/vcpkg install configcat[core] --triplet x64-windows + ./build/vcpkg/vcpkg install configcat[core, sha] --triplet x64-windows - uses: actions/upload-artifact@v3 with: name: Win64 path: | ./build/vcpkg/installed/*/lib/configcat.lib + ./build/vcpkg/installed/*/lib/hash-library.lib build-android: runs-on: windows-latest @@ -40,13 +41,14 @@ jobs: git clone https://github.com/microsoft/vcpkg build/vcpkg git -C build/vcpkg checkout ${{ env.VCPKG_COMMIT_HASH }} ./build/vcpkg/bootstrap-vcpkg.bat - ./build/vcpkg/vcpkg install configcat[core] --triplet arm64-android + ./build/vcpkg/vcpkg install configcat[core, sha] --triplet arm64-android - uses: actions/upload-artifact@v3 with: name: Android path: | ./build/vcpkg/installed/*/lib/libconfigcat.a + ./build/vcpkg/installed/*/lib/libhash-library.a build-macos: runs-on: macos-latest @@ -59,13 +61,14 @@ jobs: git clone https://github.com/microsoft/vcpkg build/vcpkg git -C build/vcpkg checkout ${{ env.VCPKG_COMMIT_HASH }} ./build/vcpkg/bootstrap-vcpkg.sh - ./build/vcpkg/vcpkg install configcat[core] --triplet universal-osx-unreal --overlay-triplets "$GITHUB_WORKSPACE/Extras/triplets" + ./build/vcpkg/vcpkg install configcat[core, sha] --triplet universal-osx-unreal --overlay-triplets "$GITHUB_WORKSPACE/Extras/triplets" - uses: actions/upload-artifact@v3 with: name: MacOS path: | ./build/vcpkg/installed/*/lib/libconfigcat.a + ./build/vcpkg/installed/*/lib/libhash-library.a build-ios: runs-on: macos-latest @@ -78,13 +81,14 @@ jobs: git clone https://github.com/microsoft/vcpkg build/vcpkg git -C build/vcpkg checkout ${{ env.VCPKG_COMMIT_HASH }} ./build/vcpkg/bootstrap-vcpkg.sh - ./build/vcpkg/vcpkg install configcat[core] --triplet arm64-ios-unreal --overlay-triplets "$GITHUB_WORKSPACE/Extras/triplets" + ./build/vcpkg/vcpkg install configcat[core, sha] --triplet arm64-ios-unreal --overlay-triplets "$GITHUB_WORKSPACE/Extras/triplets" - uses: actions/upload-artifact@v3 with: name: iOS path: | ./build/vcpkg/installed/*/lib/libconfigcat.a + ./build/vcpkg/installed/*/lib/libhash-library.a build-linux: runs-on: ubuntu-latest @@ -102,13 +106,14 @@ jobs: export CC=clang export CXX=clang++ - ./build/vcpkg/vcpkg install configcat[core] --triplet x64-linux-unreal --overlay-triplets "$GITHUB_WORKSPACE/Extras/triplets" + ./build/vcpkg/vcpkg install configcat[core, sha] --triplet x64-linux-unreal --overlay-triplets "$GITHUB_WORKSPACE/Extras/triplets" - uses: actions/upload-artifact@v3 with: name: Linux path: | ./build/vcpkg/installed/*/lib/libconfigcat.a + ./build/vcpkg/installed/*/lib/libhash-library.a publish-engine-plugin: runs-on: ubuntu-latest diff --git a/.github/workflows/plugin-ci.yml b/.github/workflows/plugin-ci.yml index 617ac8c..a789204 100644 --- a/.github/workflows/plugin-ci.yml +++ b/.github/workflows/plugin-ci.yml @@ -28,12 +28,13 @@ jobs: export CC=clang export CXX=clang++ - ./build/vcpkg/vcpkg install configcat[core] --triplet x64-linux-unreal --overlay-triplets "$GITHUB_WORKSPACE/Extras/triplets" + ./build/vcpkg/vcpkg install configcat[core, sha] --triplet x64-linux-unreal --overlay-triplets "$GITHUB_WORKSPACE/Extras/triplets" - name: Copy binaries run: | mkdir -p ${{ github.workspace }}/Source/ThirdParty/ConfigCatCppSDK/Binaries/Linux/x64-linux-unreal/ cp ${{ github.workspace }}/build/vcpkg/installed/x64-linux-unreal/lib/libconfigcat.a ${{ github.workspace }}/Source/ThirdParty/ConfigCatCppSDK/Binaries/Linux/x64-linux-unreal/libconfigcat.a + cp ${{ github.workspace }}/build/vcpkg/installed/x64-linux-unreal/lib/libhash-library.a ${{ github.workspace }}/Source/ThirdParty/ConfigCatCppSDK/Binaries/Linux/x64-linux-unreal/libhash-library.a rm -r ./build/* diff --git a/ConfigCat.uplugin b/ConfigCat.uplugin index 523a8ee..77a5071 100644 --- a/ConfigCat.uplugin +++ b/ConfigCat.uplugin @@ -1,6 +1,6 @@ { "FileVersion": 3, - "VersionName": "2.1.2", + "VersionName": "2.1.3", "EngineVersion": "5.4", "FriendlyName": "ConfigCat", "Description": "ConfigCat is a hosted service for feature flag and configuration management. It lets you decouple feature releases from code deployments.", diff --git a/Extras/licenses/hash-library/LICENSE b/Extras/licenses/hash-library/LICENSE new file mode 100644 index 0000000..e540da6 --- /dev/null +++ b/Extras/licenses/hash-library/LICENSE @@ -0,0 +1,10 @@ +zlib License + +Copyright (c) 2014,2015 Stephan Brumme + +This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software. +Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions: +1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. + If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. diff --git a/README.md b/README.md index d594893..917f779 100644 --- a/README.md +++ b/README.md @@ -7,4 +7,4 @@ ConfigCat is a feature flag and configuration management service that lets you s ConfigCat is a hosted feature flag service. Manage feature toggles across frontend, backend, mobile, desktop apps. Alternative to LaunchDarkly. Management app + feature flag SDKs. ## External Libraries -The underlying ConfigCat C++ SDK uses these wonderful libraries: [nlohmann-json](https://github.com/nlohmann/json), [z4kn4fein-semver](https://github.com/z4kn4fein/cpp-semver). \ No newline at end of file +The underlying ConfigCat C++ SDK uses these wonderful libraries: [hash-library](https://create.stephan-brumme.com/hash-library), [nlohmann-json](https://github.com/nlohmann/json), [z4kn4fein-semver](https://github.com/z4kn4fein/cpp-semver). \ No newline at end of file diff --git a/Source/ConfigCat/ConfigCat.Build.cs b/Source/ConfigCat/ConfigCat.Build.cs index f72eda0..111cf10 100644 --- a/Source/ConfigCat/ConfigCat.Build.cs +++ b/Source/ConfigCat/ConfigCat.Build.cs @@ -13,12 +13,9 @@ public ConfigCat(ReadOnlyTargetRules Target) : base(Target) "DeveloperSettings", "Projects", "Engine", - "HTTP", - "OpenSSL" + "HTTP" }); - AddEngineThirdPartyPrivateStaticDependencies(Target, "OpenSSL"); - PrivateDependencyModuleNames.AddRange(new[] { "ConfigCatWrappers", From e42dd09de6968c9ce584da43657b5f55cc2c6c9f Mon Sep 17 00:00:00 2001 From: Oprea Alexandru Date: Thu, 18 Jul 2024 09:10:32 +0300 Subject: [PATCH 7/8] fixed vcpkg path --- .github/workflows/plugin-cd.yml | 10 +++++----- .github/workflows/plugin-ci.yml | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/plugin-cd.yml b/.github/workflows/plugin-cd.yml index 3eda698..94ac268 100644 --- a/.github/workflows/plugin-cd.yml +++ b/.github/workflows/plugin-cd.yml @@ -21,7 +21,7 @@ jobs: git clone https://github.com/microsoft/vcpkg build/vcpkg git -C build/vcpkg checkout ${{ env.VCPKG_COMMIT_HASH }} ./build/vcpkg/bootstrap-vcpkg.bat - ./build/vcpkg/vcpkg install configcat[core, sha] --triplet x64-windows + ./build/vcpkg/vcpkg install configcat[core,sha] --triplet x64-windows - uses: actions/upload-artifact@v3 with: @@ -41,7 +41,7 @@ jobs: git clone https://github.com/microsoft/vcpkg build/vcpkg git -C build/vcpkg checkout ${{ env.VCPKG_COMMIT_HASH }} ./build/vcpkg/bootstrap-vcpkg.bat - ./build/vcpkg/vcpkg install configcat[core, sha] --triplet arm64-android + ./build/vcpkg/vcpkg install configcat[core,sha] --triplet arm64-android - uses: actions/upload-artifact@v3 with: @@ -61,7 +61,7 @@ jobs: git clone https://github.com/microsoft/vcpkg build/vcpkg git -C build/vcpkg checkout ${{ env.VCPKG_COMMIT_HASH }} ./build/vcpkg/bootstrap-vcpkg.sh - ./build/vcpkg/vcpkg install configcat[core, sha] --triplet universal-osx-unreal --overlay-triplets "$GITHUB_WORKSPACE/Extras/triplets" + ./build/vcpkg/vcpkg install configcat[core,sha] --triplet universal-osx-unreal --overlay-triplets "$GITHUB_WORKSPACE/Extras/triplets" - uses: actions/upload-artifact@v3 with: @@ -81,7 +81,7 @@ jobs: git clone https://github.com/microsoft/vcpkg build/vcpkg git -C build/vcpkg checkout ${{ env.VCPKG_COMMIT_HASH }} ./build/vcpkg/bootstrap-vcpkg.sh - ./build/vcpkg/vcpkg install configcat[core, sha] --triplet arm64-ios-unreal --overlay-triplets "$GITHUB_WORKSPACE/Extras/triplets" + ./build/vcpkg/vcpkg install configcat[core,sha] --triplet arm64-ios-unreal --overlay-triplets "$GITHUB_WORKSPACE/Extras/triplets" - uses: actions/upload-artifact@v3 with: @@ -106,7 +106,7 @@ jobs: export CC=clang export CXX=clang++ - ./build/vcpkg/vcpkg install configcat[core, sha] --triplet x64-linux-unreal --overlay-triplets "$GITHUB_WORKSPACE/Extras/triplets" + ./build/vcpkg/vcpkg install configcat[core,sha] --triplet x64-linux-unreal --overlay-triplets "$GITHUB_WORKSPACE/Extras/triplets" - uses: actions/upload-artifact@v3 with: diff --git a/.github/workflows/plugin-ci.yml b/.github/workflows/plugin-ci.yml index a789204..c4392de 100644 --- a/.github/workflows/plugin-ci.yml +++ b/.github/workflows/plugin-ci.yml @@ -28,7 +28,7 @@ jobs: export CC=clang export CXX=clang++ - ./build/vcpkg/vcpkg install configcat[core, sha] --triplet x64-linux-unreal --overlay-triplets "$GITHUB_WORKSPACE/Extras/triplets" + ./build/vcpkg/vcpkg install configcat[core,sha] --triplet x64-linux-unreal --overlay-triplets "$GITHUB_WORKSPACE/Extras/triplets" - name: Copy binaries run: | From 0e20ab9255be51e4b8a5ee004f2fe5ca56babba5 Mon Sep 17 00:00:00 2001 From: Oprea Alexandru Date: Thu, 18 Jul 2024 09:21:25 +0300 Subject: [PATCH 8/8] removed sha implementation --- Source/ConfigCat/Private/ConfigCatSha.cpp | 41 ----------------------- Source/ConfigCat/Public/ConfigCatSha.h | 16 --------- 2 files changed, 57 deletions(-) delete mode 100644 Source/ConfigCat/Private/ConfigCatSha.cpp delete mode 100644 Source/ConfigCat/Public/ConfigCatSha.h diff --git a/Source/ConfigCat/Private/ConfigCatSha.cpp b/Source/ConfigCat/Private/ConfigCatSha.cpp deleted file mode 100644 index 4b5cb9d..0000000 --- a/Source/ConfigCat/Private/ConfigCatSha.cpp +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) ConfigCat 2024. All Rights Reserved. - -#include "ConfigCatSha.h" - -#include -#include -#include -#include - -std::string configcat::sha1(const std::string& input) -{ - TArray BytesArrayToHash; - BytesArrayToHash.Append(reinterpret_cast(input.data()), input.size()); - - FSHAHash const Hash = FSHA1::HashBuffer(BytesArrayToHash.GetData(), BytesArrayToHash.Num()); - FString FinalString; - for (int i = 0; i < 20; i++) - { - FinalString += FString::Printf(TEXT("%02x"), Hash.Hash[i]); - } - - return TCHAR_TO_UTF8(*FinalString); -} - -std::string configcat::sha256(const std::string& input) -{ - TArray> Digest; - Digest.AddUninitialized(SHA256_DIGEST_LENGTH); - SHA256_CTX sha256; - SHA256_Init(&sha256); - SHA256_Update(&sha256, input.c_str(), input.size()); - SHA256_Final(Digest.GetData(), &sha256); - - FString FinalString; - for (int i = 0; i < SHA256_DIGEST_LENGTH; i++) - { - FinalString += FString::Printf(TEXT("%02x"), Digest[i]); - } - - return TCHAR_TO_UTF8(*FinalString); -} \ No newline at end of file diff --git a/Source/ConfigCat/Public/ConfigCatSha.h b/Source/ConfigCat/Public/ConfigCatSha.h deleted file mode 100644 index b00d594..0000000 --- a/Source/ConfigCat/Public/ConfigCatSha.h +++ /dev/null @@ -1,16 +0,0 @@ -// Copyright (c) ConfigCat 2024. All Rights Reserved. - -#pragma once - -#include - -namespace configcat -{ - - /** - * Implementation of the configcat hashing functions for Sha1 & Sha256 - * @note This is done to avoid the extra dependency on hash-node library for the Unreal Engine SDK - */ - std::string sha1(const std::string& input); - std::string sha256(const std::string& input); -} \ No newline at end of file