From 1d1b74f7b2c2b839040678e97145bf3162c1314a Mon Sep 17 00:00:00 2001 From: sfc-gh-ext-simba-hx Date: Mon, 15 Apr 2024 14:05:05 -0700 Subject: [PATCH 1/6] redo arrow update 15.0.0 --- CMakeLists.txt | 9 ++++----- ci/_init.sh | 3 +-- scripts/_init.bat | 3 +-- scripts/build_arrow.bat | 4 ++-- scripts/build_arrow.sh | 4 ++-- scripts/build_awssdk.bat | 2 +- scripts/build_awssdk.sh | 2 +- scripts/build_azuresdk.bat | 2 +- scripts/build_azuresdk.sh | 2 +- scripts/build_boost_source.bat | 2 +- scripts/build_boost_source.sh | 2 +- scripts/build_cmocka.bat | 2 +- scripts/build_cmocka.sh | 2 +- scripts/build_curl.bat | 2 +- scripts/build_curl.sh | 2 +- scripts/build_oob.bat | 2 +- scripts/build_oob.sh | 2 +- scripts/build_openssl.bat | 2 +- scripts/build_openssl.sh | 2 +- scripts/build_uuid.sh | 2 +- scripts/build_zlib.bat | 2 +- scripts/build_zlib.sh | 2 +- 22 files changed, 27 insertions(+), 30 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index b5a9e5c06b..a9c23e211b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -70,15 +70,14 @@ set(CMAKE_VERBOSE_MAKEFILE ON) if (UNIX) # Linux and OSX set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c99 -std=gnu99 -g -fPIC -Werror -Wno-error=deprecated-declarations -D_LARGEFILE64_SOURCE ${MOCK_OBJECT_WRAPPER_FLAGS}") - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14 -std=gnu++14 -fPIC -Werror -Wno-error=deprecated-declarations ${MOCK_OBJECT_WRAPPER_FLAGS}") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++17 -std=gnu++17 -fPIC -Werror -Wno-error=deprecated-declarations ${MOCK_OBJECT_WRAPPER_FLAGS}") else() # Windows set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /ZH:SHA_256 /guard:cf /Qspectre /sdl") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /ZH:SHA_256 /guard:cf /Qspectre /sdl") -# comment out for later use when updating arrow to 15.x -# if ($ENV{ARROW_FROM_SOURCE}) -# set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /std:c++17 /D_SILENCE_STDEXT_ARR_ITERS_DEPRECATION_WARNING") -# endif () + if ($ENV{ARROW_FROM_SOURCE}) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /std:c++17 /D_SILENCE_STDEXT_ARR_ITERS_DEPRECATION_WARNING") + endif () endif () if (LINUX) # Linux. MacOS doesn't require pthread option diff --git a/ci/_init.sh b/ci/_init.sh index 11112ecf3f..cd09795659 100755 --- a/ci/_init.sh +++ b/ci/_init.sh @@ -15,8 +15,7 @@ fi export DRIVER_NAME=libsnowflakeclient # Build images -# We have build image version 2 with gcc8 already but stay on old one with gcc5 for now -BUILD_IMAGE_VERSION_X64=1 +BUILD_IMAGE_VERSION_X64=2 BUILD_IMAGE_VERSION_AARCH64=3 # Test Images diff --git a/scripts/_init.bat b/scripts/_init.bat index 4bbdd89e2b..69ad94a2af 100644 --- a/scripts/_init.bat +++ b/scripts/_init.bat @@ -14,8 +14,7 @@ if /I "%platform%"=="x64" set platform=x64 if /I "%platform%"=="x86" set platform=x86 set curdir=%cd% -:: use old arrow for now -::set ARROW_FROM_SOURCE=1 +set ARROW_FROM_SOURCE=1 if defined arch ( if not "%platform%"=="" ( diff --git a/scripts/build_arrow.bat b/scripts/build_arrow.bat index bd1df2d64a..877ccd7c8b 100644 --- a/scripts/build_arrow.bat +++ b/scripts/build_arrow.bat @@ -2,8 +2,8 @@ :: Build ARROW library :: @echo off -set arrow_src_version=0.17.1 -set arrow_build_version=3 +set arrow_src_version=15.0.0 +set arrow_build_version=2 :: The full version number for dependency packaging/uploading/downloading if "%ARROW_FROM_SOURCE%"=="1" ( set arrow_version=%arrow_src_version%.%arrow_build_version% diff --git a/scripts/build_arrow.sh b/scripts/build_arrow.sh index 013c58b598..ceff92a0e9 100755 --- a/scripts/build_arrow.sh +++ b/scripts/build_arrow.sh @@ -11,8 +11,8 @@ function usage() { } set -o pipefail -export ARROW_SRC_VERSION=0.17.1 -export ARROW_BUILD_VERSION=3 +export ARROW_SRC_VERSION=15.0.0 +export ARROW_BUILD_VERSION=2 #The full version number for dependency packaging/uploading/downloading export ARROW_VERSION=${ARROW_SRC_VERSION}.${ARROW_BUILD_VERSION} diff --git a/scripts/build_awssdk.bat b/scripts/build_awssdk.bat index 294ce44a6e..e8dfbe124f 100755 --- a/scripts/build_awssdk.bat +++ b/scripts/build_awssdk.bat @@ -4,7 +4,7 @@ :: @echo off set aws_src_version=1.11.283 -set aws_build_version=5 +set aws_build_version=6 set aws_version=%aws_src_version%.%aws_build_version% call %* goto :EOF diff --git a/scripts/build_awssdk.sh b/scripts/build_awssdk.sh index 4ed2f5579a..958c1447fa 100755 --- a/scripts/build_awssdk.sh +++ b/scripts/build_awssdk.sh @@ -13,7 +13,7 @@ function usage() { set -o pipefail AWS_SRC_VERSION=1.11.283 -AWS_BUILD_VERSION=5 +AWS_BUILD_VERSION=6 AWS_DIR=aws-sdk-cpp-$AWS_SRC_VERSION AWS_VERSION=$AWS_SRC_VERSION.$AWS_BUILD_VERSION diff --git a/scripts/build_azuresdk.bat b/scripts/build_azuresdk.bat index 1633ad9dba..66e1ba2654 100644 --- a/scripts/build_azuresdk.bat +++ b/scripts/build_azuresdk.bat @@ -4,7 +4,7 @@ :: @echo off set azure_src_version=0.1.20 -set azure_build_version=10 +set azure_build_version=11 set azure_version=%azure_src_version%.%azure_build_version% call %* goto :EOF diff --git a/scripts/build_azuresdk.sh b/scripts/build_azuresdk.sh index 7acf27b81e..a4abbbc98d 100755 --- a/scripts/build_azuresdk.sh +++ b/scripts/build_azuresdk.sh @@ -12,7 +12,7 @@ function usage() { set -o pipefail AZURE_SRC_VERSION=0.1.20 -AZURE_BUILD_VERSION=10 +AZURE_BUILD_VERSION=11 AZURE_DIR=azure-storage-cpplite-$AZURE_SRC_VERSION AZURE_VERSION=$AZURE_SRC_VERSION.$AZURE_BUILD_VERSION diff --git a/scripts/build_boost_source.bat b/scripts/build_boost_source.bat index e438ed698f..9b08f1feb5 100644 --- a/scripts/build_boost_source.bat +++ b/scripts/build_boost_source.bat @@ -3,7 +3,7 @@ :: GitHub repo: https://github.com/boostorg/boost.git :: @echo off -set boost_version=1.75.0 +set boost_version=1.81.0 call %* goto :EOF diff --git a/scripts/build_boost_source.sh b/scripts/build_boost_source.sh index 30f8445263..061bf4ac3d 100755 --- a/scripts/build_boost_source.sh +++ b/scripts/build_boost_source.sh @@ -11,7 +11,7 @@ function usage() { } set -o pipefail -BOOST_VERSION=1.75.0 +BOOST_VERSION=1.81.0 DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" source $DIR/_init.sh $@ diff --git a/scripts/build_cmocka.bat b/scripts/build_cmocka.bat index 8d1738097c..b29ec749de 100644 --- a/scripts/build_cmocka.bat +++ b/scripts/build_cmocka.bat @@ -4,7 +4,7 @@ :: @echo off set cmocka_src_version=1.1.1 -set cmocka_build_version=3 +set cmocka_build_version=4 set cmocka_version=%cmocka_src_version%.%cmocka_build_version% call %* goto :EOF diff --git a/scripts/build_cmocka.sh b/scripts/build_cmocka.sh index 054c454a50..c92a76be4d 100755 --- a/scripts/build_cmocka.sh +++ b/scripts/build_cmocka.sh @@ -14,7 +14,7 @@ function usage() { set -o pipefail CMOCKA_SRC_VERSION=1.1.1 -CMOCKA_BUILD_VERSION=3 +CMOCKA_BUILD_VERSION=4 CMOCKA_VERSION=$CMOCKA_SRC_VERSION.$CMOCKA_BUILD_VERSION DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" diff --git a/scripts/build_curl.bat b/scripts/build_curl.bat index ce5344db6a..9624349a70 100644 --- a/scripts/build_curl.bat +++ b/scripts/build_curl.bat @@ -11,7 +11,7 @@ @echo off set CURL_SRC_VERSION=8.7.1 -set CURL_BUILD_VERSION=1 +set CURL_BUILD_VERSION=2 set CURL_VERSION=%CURL_SRC_VERSION%.%CURL_BUILD_VERSION% call %* goto :EOF diff --git a/scripts/build_curl.sh b/scripts/build_curl.sh index 155bef9b53..cb86b4d991 100755 --- a/scripts/build_curl.sh +++ b/scripts/build_curl.sh @@ -13,7 +13,7 @@ function usage() { set -o pipefail CURL_SRC_VERSION=8.7.1 -CURL_BUILD_VERSION=1 +CURL_BUILD_VERSION=2 CURL_VERSION=${CURL_SRC_VERSION}.${CURL_BUILD_VERSION} DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" diff --git a/scripts/build_oob.bat b/scripts/build_oob.bat index 4573038275..5f5bcdef15 100644 --- a/scripts/build_oob.bat +++ b/scripts/build_oob.bat @@ -3,7 +3,7 @@ :: @echo off set OOB_SRC_VERSION=1.0.4 -set OOB_BUILD_VERSION=10 +set OOB_BUILD_VERSION=11 set OOB_VERSION=%OOB_SRC_VERSION%.%OOB_BUILD_VERSION% call %* goto :EOF diff --git a/scripts/build_oob.sh b/scripts/build_oob.sh index faf4060f74..63a2b8e6f6 100755 --- a/scripts/build_oob.sh +++ b/scripts/build_oob.sh @@ -12,7 +12,7 @@ function usage() { set -o pipefail OOB_SRC_VERSION=1.0.4 -OOB_BUILD_VERSION=10 +OOB_BUILD_VERSION=11 OOB_VERSION=$OOB_SRC_VERSION.$OOB_BUILD_VERSION UUID_VERSION=2.39.0 diff --git a/scripts/build_openssl.bat b/scripts/build_openssl.bat index a13a978704..5b693f029d 100644 --- a/scripts/build_openssl.bat +++ b/scripts/build_openssl.bat @@ -11,7 +11,7 @@ @echo off set OPENSSL_SRC_VERSION=3.0.13 -set OPENSSL_BUILD_VERSION=3 +set OPENSSL_BUILD_VERSION=4 set OPENSSL_VERSION=%OPENSSL_SRC_VERSION%.%OPENSSL_BUILD_VERSION% call %* goto :EOF diff --git a/scripts/build_openssl.sh b/scripts/build_openssl.sh index 9c32936665..336a99b6a0 100755 --- a/scripts/build_openssl.sh +++ b/scripts/build_openssl.sh @@ -13,7 +13,7 @@ function usage() { set -o pipefail OPENSSL_SRC_VERSION=3.0.13 -OPENSSL_BUILD_VERSION=3 +OPENSSL_BUILD_VERSION=4 OPENSSL_VERSION=$OPENSSL_SRC_VERSION.$OPENSSL_BUILD_VERSION DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" diff --git a/scripts/build_uuid.sh b/scripts/build_uuid.sh index a3305af801..e58333b6a2 100755 --- a/scripts/build_uuid.sh +++ b/scripts/build_uuid.sh @@ -15,7 +15,7 @@ function usage() { set -o pipefail UUID_SRC_VERSION=2.39.0 -UUID_BUILD_VERSION=2 +UUID_BUILD_VERSION=3 UUID_VERSION=$UUID_SRC_VERSION.$UUID_BUILD_VERSION DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" diff --git a/scripts/build_zlib.bat b/scripts/build_zlib.bat index 1a8da635c4..21cc4a6399 100644 --- a/scripts/build_zlib.bat +++ b/scripts/build_zlib.bat @@ -11,7 +11,7 @@ :: @echo off set ZLIB_SRC_VERSION=1.3.1 -set ZLIB_BUILD_VERSION=4 +set ZLIB_BUILD_VERSION=5 set ZLIB_VERSION=%ZLIB_SRC_VERSION%.%ZLIB_BUILD_VERSION% call %* goto :EOF diff --git a/scripts/build_zlib.sh b/scripts/build_zlib.sh index ea89cbe49a..b056ba84ee 100755 --- a/scripts/build_zlib.sh +++ b/scripts/build_zlib.sh @@ -13,7 +13,7 @@ function usage() { set -o pipefail ZLIB_SRC_VERSION=1.3.1 -ZLIB_BUILD_VERSION=4 +ZLIB_BUILD_VERSION=5 ZLIB_VERSION=$ZLIB_SRC_VERSION.$ZLIB_BUILD_VERSION DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" From 7b25a64e3df0d65e3999d76534d832dd20c3b94e Mon Sep 17 00:00:00 2001 From: sfc-gh-ext-simba-hx Date: Wed, 17 Apr 2024 11:45:30 -0700 Subject: [PATCH 2/6] avoid replacing libsnowflakeclient on s3 --- include/snowflake/version.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/snowflake/version.h b/include/snowflake/version.h index 2e4eca1e55..b1774a918c 100644 --- a/include/snowflake/version.h +++ b/include/snowflake/version.h @@ -5,6 +5,6 @@ #ifndef SNOWFLAKE_CLIENT_VERSION_H #define SNOWFLAKE_CLIENT_VERSION_H -#define SF_API_VERSION "1.0.10" +#define SF_API_VERSION "1.0.10.1" #endif /* SNOWFLAKE_CLIENT_VERSION_H */ From 9433392d89883d455d268ed1b371825ec9fc15fb Mon Sep 17 00:00:00 2001 From: sfc-gh-ext-simba-hx Date: Thu, 18 Apr 2024 03:24:09 +0000 Subject: [PATCH 3/6] fix test issue on Mac with Debug --- cpp/logger/SecretDetector.cpp | 31 +++++++++++++++++-------------- cpp/logger/SecretDetector.hpp | 16 ++++++++-------- 2 files changed, 25 insertions(+), 22 deletions(-) diff --git a/cpp/logger/SecretDetector.cpp b/cpp/logger/SecretDetector.cpp index b6a6ce379d..0e7addcc13 100644 --- a/cpp/logger/SecretDetector.cpp +++ b/cpp/logger/SecretDetector.cpp @@ -3,57 +3,60 @@ */ #include "SecretDetector.hpp" +using namespace boost::xpressive; +using namespace regex_constants; + namespace Snowflake { namespace Client { - boost::regex SecretDetector::AWS_KEY_PATTERN = boost::regex("(aws_key_id|aws_secret_key|access_key_id|secret_access_key)(\\s*=\\s*)'([^']+)'", boost::regex::icase); + sregex SecretDetector::AWS_KEY_PATTERN = sregex::compile("(aws_key_id|aws_secret_key|access_key_id|secret_access_key)(\\s*=\\s*)'([^']+)'", icase); - boost::regex SecretDetector::AWS_TOKEN_PATTERN = boost::regex("(accessToken|tempToken|keySecret)\"\\s*:\\s*\"([A-Za-z0-9/+]{32,}={0,2})\"", boost::regex::icase); + sregex SecretDetector::AWS_TOKEN_PATTERN = sregex::compile("(accessToken|tempToken|keySecret)\"\\s*:\\s*\"([A-Za-z0-9/+]{32,}={0,2})\"", icase); - boost::regex SecretDetector::SAS_TOKEN_PATTERN = boost::regex("(sig|signature|AWSAccessKeyId|password|passcode)=([A-Za-z0-9%/+]{16,})", boost::regex::icase); + sregex SecretDetector::SAS_TOKEN_PATTERN = sregex::compile("(sig|signature|AWSAccessKeyId|password|passcode)=([A-Za-z0-9%/+]{16,})", icase); - boost::regex SecretDetector::PRIVATE_KEY_PATTERN = boost::regex("-----BEGIN PRIVATE KEY-----\\\\n([A-Za-z0-9/+=\\\\n]{32,})\\\\n-----END PRIVATE KEY-----", boost::regex::extended | boost::regex::icase); + sregex SecretDetector::PRIVATE_KEY_PATTERN = sregex::compile("-----BEGIN PRIVATE KEY-----\\\\n([A-Za-z0-9/+=\\\\n]{32,})\\\\n-----END PRIVATE KEY-----", icase); - boost::regex SecretDetector::PRIVATE_KEY_DATA_PATTERN = boost::regex("\"privateKeyData\": \"([A-Za-z0-9/+=\\\\n]{10,})\"", boost::regex::extended | boost::regex::icase); + sregex SecretDetector::PRIVATE_KEY_DATA_PATTERN = sregex::compile("\"privateKeyData\": \"([A-Za-z0-9/+=\\\\n]{10,})\"", icase); - boost::regex SecretDetector::CONNECTION_TOKEN_PATTERN = boost::regex("(token|assertion content)(['\"\\s:=]+)([A-Za-z0-9=/_+-]{8,})", boost::regex::icase); + sregex SecretDetector::CONNECTION_TOKEN_PATTERN = sregex::compile("(token|assertion content)(['\"\\s:=]+)([A-Za-z0-9=/_+-]{8,})", icase); - boost::regex SecretDetector::PASSWORD_PATTERN = boost::regex("(password|passcode|pwd)(['\"\\s:=]+)([A-Za-z0-9!\"#$%&'\\()*+,-./:;<=>?@\\[\\]^_`\\{|\\}~]{6,})", boost::regex::icase); + sregex SecretDetector::PASSWORD_PATTERN = sregex::compile("(password|passcode|pwd)(['\"\\s:=]+)([A-Za-z0-9!\"#$%&'\\()*+,-./:;<=>?@\\[\\]^_`\\{|\\}~]{6,})", icase); std::string SecretDetector::maskAwsKeys(std::string text) { - return boost::regex_replace(text, SecretDetector::AWS_KEY_PATTERN, "$1$2'****'"); + return regex_replace(text, AWS_KEY_PATTERN, "$1$2'****'"); } std::string SecretDetector::maskAwsTokens(std::string text) { - return boost::regex_replace(text, SecretDetector::AWS_TOKEN_PATTERN, "$1\":\"XXXX\""); + return regex_replace(text, AWS_TOKEN_PATTERN, "$1\":\"XXXX\""); } std::string SecretDetector::maskSasTokens(std::string text) { - return boost::regex_replace(text, SecretDetector::SAS_TOKEN_PATTERN, "$1=****"); + return regex_replace(text, SAS_TOKEN_PATTERN, "$1=****"); } std::string SecretDetector::maskPrivateKey(std::string text) { - return boost::regex_replace(text, SecretDetector::PRIVATE_KEY_PATTERN, "-----BEGIN PRIVATE KEY-----\\nXXXX\\n-----END PRIVATE KEY-----"); + return regex_replace(text, PRIVATE_KEY_PATTERN, "-----BEGIN PRIVATE KEY-----\\nXXXX\\n-----END PRIVATE KEY-----"); } std::string SecretDetector::maskPrivateKeyData(std::string text) { - return boost::regex_replace(text, SecretDetector::PRIVATE_KEY_DATA_PATTERN, "\"privateKeyData\": \"XXXX\""); + return regex_replace(text, PRIVATE_KEY_DATA_PATTERN, "\"privateKeyData\": \"XXXX\""); } std::string SecretDetector::maskConnectionToken(std::string text) { - return boost::regex_replace(text, SecretDetector::CONNECTION_TOKEN_PATTERN, "$1$2****"); + return regex_replace(text, CONNECTION_TOKEN_PATTERN, "$1$2****"); } std::string SecretDetector::maskPassword(std::string text) { - return boost::regex_replace(text, SecretDetector::PASSWORD_PATTERN, "$1$2****"); + return regex_replace(text, PASSWORD_PATTERN, "$1$2****"); } std::string SecretDetector::maskSecrets(std::string text) diff --git a/cpp/logger/SecretDetector.hpp b/cpp/logger/SecretDetector.hpp index e6fd2d05a1..f256b8bf8b 100644 --- a/cpp/logger/SecretDetector.hpp +++ b/cpp/logger/SecretDetector.hpp @@ -5,7 +5,7 @@ #ifndef SNOWFLAKECLIENT_SECRETDETECTOR_HPP #define SNOWFLAKECLIENT_SECRETDETECTOR_HPP -#include "boost/regex.hpp" +#include namespace Snowflake { @@ -20,13 +20,13 @@ class SecretDetector static std::string maskSecrets(std::string); private: - static boost::regex AWS_KEY_PATTERN; - static boost::regex AWS_TOKEN_PATTERN; - static boost::regex SAS_TOKEN_PATTERN; - static boost::regex PRIVATE_KEY_PATTERN; - static boost::regex PRIVATE_KEY_DATA_PATTERN; - static boost::regex CONNECTION_TOKEN_PATTERN; - static boost::regex PASSWORD_PATTERN; + static boost::xpressive::sregex AWS_KEY_PATTERN; + static boost::xpressive::sregex AWS_TOKEN_PATTERN; + static boost::xpressive::sregex SAS_TOKEN_PATTERN; + static boost::xpressive::sregex PRIVATE_KEY_PATTERN; + static boost::xpressive::sregex PRIVATE_KEY_DATA_PATTERN; + static boost::xpressive::sregex CONNECTION_TOKEN_PATTERN; + static boost::xpressive::sregex PASSWORD_PATTERN; static std::string maskAwsKeys(std::string text); static std::string maskAwsTokens(std::string text); From aa1dd84abee30809f160bfe676a45760409b36f9 Mon Sep 17 00:00:00 2001 From: sfc-gh-ext-simba-hx Date: Thu, 18 Apr 2024 17:54:41 +0000 Subject: [PATCH 4/6] fix segfault issue on Mac --- cpp/logger/SecretDetector.cpp | 31 ++++++++++++++----------------- cpp/logger/SecretDetector.hpp | 16 ++++++++-------- scripts/build_boost_source.sh | 4 ++-- 3 files changed, 24 insertions(+), 27 deletions(-) diff --git a/cpp/logger/SecretDetector.cpp b/cpp/logger/SecretDetector.cpp index 0e7addcc13..b6a6ce379d 100644 --- a/cpp/logger/SecretDetector.cpp +++ b/cpp/logger/SecretDetector.cpp @@ -3,60 +3,57 @@ */ #include "SecretDetector.hpp" -using namespace boost::xpressive; -using namespace regex_constants; - namespace Snowflake { namespace Client { - sregex SecretDetector::AWS_KEY_PATTERN = sregex::compile("(aws_key_id|aws_secret_key|access_key_id|secret_access_key)(\\s*=\\s*)'([^']+)'", icase); + boost::regex SecretDetector::AWS_KEY_PATTERN = boost::regex("(aws_key_id|aws_secret_key|access_key_id|secret_access_key)(\\s*=\\s*)'([^']+)'", boost::regex::icase); - sregex SecretDetector::AWS_TOKEN_PATTERN = sregex::compile("(accessToken|tempToken|keySecret)\"\\s*:\\s*\"([A-Za-z0-9/+]{32,}={0,2})\"", icase); + boost::regex SecretDetector::AWS_TOKEN_PATTERN = boost::regex("(accessToken|tempToken|keySecret)\"\\s*:\\s*\"([A-Za-z0-9/+]{32,}={0,2})\"", boost::regex::icase); - sregex SecretDetector::SAS_TOKEN_PATTERN = sregex::compile("(sig|signature|AWSAccessKeyId|password|passcode)=([A-Za-z0-9%/+]{16,})", icase); + boost::regex SecretDetector::SAS_TOKEN_PATTERN = boost::regex("(sig|signature|AWSAccessKeyId|password|passcode)=([A-Za-z0-9%/+]{16,})", boost::regex::icase); - sregex SecretDetector::PRIVATE_KEY_PATTERN = sregex::compile("-----BEGIN PRIVATE KEY-----\\\\n([A-Za-z0-9/+=\\\\n]{32,})\\\\n-----END PRIVATE KEY-----", icase); + boost::regex SecretDetector::PRIVATE_KEY_PATTERN = boost::regex("-----BEGIN PRIVATE KEY-----\\\\n([A-Za-z0-9/+=\\\\n]{32,})\\\\n-----END PRIVATE KEY-----", boost::regex::extended | boost::regex::icase); - sregex SecretDetector::PRIVATE_KEY_DATA_PATTERN = sregex::compile("\"privateKeyData\": \"([A-Za-z0-9/+=\\\\n]{10,})\"", icase); + boost::regex SecretDetector::PRIVATE_KEY_DATA_PATTERN = boost::regex("\"privateKeyData\": \"([A-Za-z0-9/+=\\\\n]{10,})\"", boost::regex::extended | boost::regex::icase); - sregex SecretDetector::CONNECTION_TOKEN_PATTERN = sregex::compile("(token|assertion content)(['\"\\s:=]+)([A-Za-z0-9=/_+-]{8,})", icase); + boost::regex SecretDetector::CONNECTION_TOKEN_PATTERN = boost::regex("(token|assertion content)(['\"\\s:=]+)([A-Za-z0-9=/_+-]{8,})", boost::regex::icase); - sregex SecretDetector::PASSWORD_PATTERN = sregex::compile("(password|passcode|pwd)(['\"\\s:=]+)([A-Za-z0-9!\"#$%&'\\()*+,-./:;<=>?@\\[\\]^_`\\{|\\}~]{6,})", icase); + boost::regex SecretDetector::PASSWORD_PATTERN = boost::regex("(password|passcode|pwd)(['\"\\s:=]+)([A-Za-z0-9!\"#$%&'\\()*+,-./:;<=>?@\\[\\]^_`\\{|\\}~]{6,})", boost::regex::icase); std::string SecretDetector::maskAwsKeys(std::string text) { - return regex_replace(text, AWS_KEY_PATTERN, "$1$2'****'"); + return boost::regex_replace(text, SecretDetector::AWS_KEY_PATTERN, "$1$2'****'"); } std::string SecretDetector::maskAwsTokens(std::string text) { - return regex_replace(text, AWS_TOKEN_PATTERN, "$1\":\"XXXX\""); + return boost::regex_replace(text, SecretDetector::AWS_TOKEN_PATTERN, "$1\":\"XXXX\""); } std::string SecretDetector::maskSasTokens(std::string text) { - return regex_replace(text, SAS_TOKEN_PATTERN, "$1=****"); + return boost::regex_replace(text, SecretDetector::SAS_TOKEN_PATTERN, "$1=****"); } std::string SecretDetector::maskPrivateKey(std::string text) { - return regex_replace(text, PRIVATE_KEY_PATTERN, "-----BEGIN PRIVATE KEY-----\\nXXXX\\n-----END PRIVATE KEY-----"); + return boost::regex_replace(text, SecretDetector::PRIVATE_KEY_PATTERN, "-----BEGIN PRIVATE KEY-----\\nXXXX\\n-----END PRIVATE KEY-----"); } std::string SecretDetector::maskPrivateKeyData(std::string text) { - return regex_replace(text, PRIVATE_KEY_DATA_PATTERN, "\"privateKeyData\": \"XXXX\""); + return boost::regex_replace(text, SecretDetector::PRIVATE_KEY_DATA_PATTERN, "\"privateKeyData\": \"XXXX\""); } std::string SecretDetector::maskConnectionToken(std::string text) { - return regex_replace(text, CONNECTION_TOKEN_PATTERN, "$1$2****"); + return boost::regex_replace(text, SecretDetector::CONNECTION_TOKEN_PATTERN, "$1$2****"); } std::string SecretDetector::maskPassword(std::string text) { - return regex_replace(text, PASSWORD_PATTERN, "$1$2****"); + return boost::regex_replace(text, SecretDetector::PASSWORD_PATTERN, "$1$2****"); } std::string SecretDetector::maskSecrets(std::string text) diff --git a/cpp/logger/SecretDetector.hpp b/cpp/logger/SecretDetector.hpp index f256b8bf8b..e6fd2d05a1 100644 --- a/cpp/logger/SecretDetector.hpp +++ b/cpp/logger/SecretDetector.hpp @@ -5,7 +5,7 @@ #ifndef SNOWFLAKECLIENT_SECRETDETECTOR_HPP #define SNOWFLAKECLIENT_SECRETDETECTOR_HPP -#include +#include "boost/regex.hpp" namespace Snowflake { @@ -20,13 +20,13 @@ class SecretDetector static std::string maskSecrets(std::string); private: - static boost::xpressive::sregex AWS_KEY_PATTERN; - static boost::xpressive::sregex AWS_TOKEN_PATTERN; - static boost::xpressive::sregex SAS_TOKEN_PATTERN; - static boost::xpressive::sregex PRIVATE_KEY_PATTERN; - static boost::xpressive::sregex PRIVATE_KEY_DATA_PATTERN; - static boost::xpressive::sregex CONNECTION_TOKEN_PATTERN; - static boost::xpressive::sregex PASSWORD_PATTERN; + static boost::regex AWS_KEY_PATTERN; + static boost::regex AWS_TOKEN_PATTERN; + static boost::regex SAS_TOKEN_PATTERN; + static boost::regex PRIVATE_KEY_PATTERN; + static boost::regex PRIVATE_KEY_DATA_PATTERN; + static boost::regex CONNECTION_TOKEN_PATTERN; + static boost::regex PASSWORD_PATTERN; static std::string maskAwsKeys(std::string text); static std::string maskAwsTokens(std::string text); diff --git a/scripts/build_boost_source.sh b/scripts/build_boost_source.sh index 061bf4ac3d..5313f59471 100755 --- a/scripts/build_boost_source.sh +++ b/scripts/build_boost_source.sh @@ -38,8 +38,8 @@ sed -i -- 's/build.sh)/build.sh gcc)/g' bootstrap.sh # If we are not doing a universal build, build with 64-bit if [[ "$PLATFORM" == "darwin" ]] && [[ "$ARCH" == "universal" ]]; then CXX=$CXX ./bootstrap.sh --prefix=. --with-toolset=clang --with-libraries=filesystem,regex,system cxxflags="-arch x86_64 -arch arm64" cflags="-arch x86_64 -arch arm64" linkflags="-arch x86_64 -arch arm64" - ./b2 stage --stagedir=$BOOST_BUILD_DIR/x64 --includedir=$BOOST_BUILD_DIR/include toolset=clang target-os=darwin architecture=x86 variant=$VARIANT link=static address-model=64 cflags="-Wall -D_REENTRANT -DCLUNIX -fPIC -O3 -arch x86_64" cxxflags="-arch x86_64" linkflags="-arch x86_64" -a install - ./b2 stage --stagedir=$BOOST_BUILD_DIR/arm64 toolset=clang variant=$VARIANT link=static address-model=64 cflags="-Wall -D_REENTRANT -DCLUNIX -fPIC -O3 -arch arm64" cxxflags="-arch arm64" linkflags="-arch arm64" -a install + ./b2 stage --stagedir=$BOOST_BUILD_DIR/x64 --includedir=$BOOST_BUILD_DIR/include toolset=clang target-os=darwin architecture=x86 variant=$VARIANT link=static address-model=64 cflags="-Wall -D_REENTRANT -DCLUNIX -fPIC -O3 -arch x86_64" cxxflags="-arch x86_64 -DBOOST_REGEX_MAX_CACHE_BLOCKS=0" linkflags="-arch x86_64" -a install + ./b2 stage --stagedir=$BOOST_BUILD_DIR/arm64 toolset=clang variant=$VARIANT link=static address-model=64 cflags="-Wall -D_REENTRANT -DCLUNIX -fPIC -O3 -arch arm64" cxxflags="-arch arm64 -DBOOST_REGEX_MAX_CACHE_BLOCKS=0" linkflags="-arch arm64" -a install mkdir $BOOST_BUILD_DIR/lib for static_lib in $BOOST_BUILD_DIR/x64/lib/*.a; do lipo -create -arch x86_64 $static_lib -arch arm64 $BOOST_BUILD_DIR/arm64/lib/$(basename $static_lib) -output $BOOST_BUILD_DIR/lib/$(basename $static_lib); From 9d3e65821122050ccc4bdd7dd4d571ffd4069739 Mon Sep 17 00:00:00 2001 From: sfc-gh-ext-simba-hx Date: Thu, 18 Apr 2024 18:00:03 +0000 Subject: [PATCH 5/6] bump up arrow build number to update artifacts on s3 --- scripts/build_arrow.bat | 2 +- scripts/build_arrow.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/build_arrow.bat b/scripts/build_arrow.bat index 877ccd7c8b..3c36229a4a 100644 --- a/scripts/build_arrow.bat +++ b/scripts/build_arrow.bat @@ -3,7 +3,7 @@ :: @echo off set arrow_src_version=15.0.0 -set arrow_build_version=2 +set arrow_build_version=3 :: The full version number for dependency packaging/uploading/downloading if "%ARROW_FROM_SOURCE%"=="1" ( set arrow_version=%arrow_src_version%.%arrow_build_version% diff --git a/scripts/build_arrow.sh b/scripts/build_arrow.sh index ceff92a0e9..3f6f4ac562 100755 --- a/scripts/build_arrow.sh +++ b/scripts/build_arrow.sh @@ -12,7 +12,7 @@ function usage() { set -o pipefail export ARROW_SRC_VERSION=15.0.0 -export ARROW_BUILD_VERSION=2 +export ARROW_BUILD_VERSION=3 #The full version number for dependency packaging/uploading/downloading export ARROW_VERSION=${ARROW_SRC_VERSION}.${ARROW_BUILD_VERSION} From 608a52c6c2680a2d6145eeeef8675655254f3f11 Mon Sep 17 00:00:00 2001 From: sfc-gh-ext-simba-hx Date: Mon, 22 Apr 2024 09:22:48 -0700 Subject: [PATCH 6/6] change back version number --- include/snowflake/version.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/snowflake/version.h b/include/snowflake/version.h index b1774a918c..2e4eca1e55 100644 --- a/include/snowflake/version.h +++ b/include/snowflake/version.h @@ -5,6 +5,6 @@ #ifndef SNOWFLAKE_CLIENT_VERSION_H #define SNOWFLAKE_CLIENT_VERSION_H -#define SF_API_VERSION "1.0.10.1" +#define SF_API_VERSION "1.0.10" #endif /* SNOWFLAKE_CLIENT_VERSION_H */