|
| 1 | +diff --git a/node_modules/snowflake-sdk/dist/lib/agent/crl_validator/crl_fetcher.js b/node_modules/snowflake-sdk/dist/lib/agent/crl_validator/crl_fetcher.js |
| 2 | +index be70497..56b74b6 100644 |
| 3 | +--- a/node_modules/snowflake-sdk/dist/lib/agent/crl_validator/crl_fetcher.js |
| 4 | ++++ b/node_modules/snowflake-sdk/dist/lib/agent/crl_validator/crl_fetcher.js |
| 5 | +@@ -6,8 +6,16 @@ Object.defineProperty(exports, "__esModule", { value: true }); |
| 6 | + exports.PENDING_FETCH_REQUESTS = void 0; |
| 7 | + exports.resetCrlCacheCleaner = resetCrlCacheCleaner; |
| 8 | + exports.getCrl = getCrl; |
| 9 | ++const { hckFetch } = require('@hackolade/fetch'); |
| 10 | + const asn1_js_rfc5280_1 = __importDefault(require("asn1.js-rfc5280")); |
| 11 | +-const axios_1 = __importDefault(require("axios")); |
| 12 | ++const axios_1 = __importDefault(require("axios").create({ |
| 13 | ++ adapter: 'fetch', |
| 14 | ++ env: { |
| 15 | ++ fetch: hckFetch, |
| 16 | ++ Request: null, |
| 17 | ++ Response: null, |
| 18 | ++ } |
| 19 | ++})); |
| 20 | + const logger_1 = __importDefault(require("../../logger")); |
| 21 | + const global_config_typed_1 = __importDefault(require("../../global_config_typed")); |
| 22 | + const crl_cache_1 = require("./crl_cache"); |
| 23 | +diff --git a/node_modules/snowflake-sdk/dist/lib/http/axios_instance.js b/node_modules/snowflake-sdk/dist/lib/http/axios_instance.js |
| 24 | +index e09430b..9ee9c35 100644 |
| 25 | +--- a/node_modules/snowflake-sdk/dist/lib/http/axios_instance.js |
| 26 | ++++ b/node_modules/snowflake-sdk/dist/lib/http/axios_instance.js |
| 27 | +@@ -36,6 +36,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) { |
| 28 | + return (mod && mod.__esModule) ? mod : { "default": mod }; |
| 29 | + }; |
| 30 | + Object.defineProperty(exports, "__esModule", { value: true }); |
| 31 | ++const { hckFetch } = require('@hackolade/fetch'); |
| 32 | + const axios_1 = __importDefault(require("axios")); |
| 33 | + const Util = __importStar(require("../util")); |
| 34 | + const logger_1 = __importDefault(require("../logger")); |
| 35 | +@@ -46,7 +47,14 @@ const DEFAULT_SNOWFLAKE_RETRY_CONFIG = { |
| 36 | + sleepCap: 16, |
| 37 | + includeRetryReason: false, |
| 38 | + }; |
| 39 | +-const axios = axios_1.default.create(); |
| 40 | ++const axios = axios_1.default.create({ |
| 41 | ++ adapter: 'fetch', |
| 42 | ++ env: { |
| 43 | ++ fetch: hckFetch, |
| 44 | ++ Request: null, |
| 45 | ++ Response: null, |
| 46 | ++ } |
| 47 | ++}); |
| 48 | + axios.interceptors.request.use((config) => { |
| 49 | + if (!config.useSnowflakeRetryMiddleware) { |
| 50 | + return config; |
| 51 | +diff --git a/node_modules/snowflake-sdk/dist/lib/http/node_untyped.js b/node_modules/snowflake-sdk/dist/lib/http/node_untyped.js |
| 52 | +index 3a94c3d..36a4cd5 100644 |
| 53 | +--- a/node_modules/snowflake-sdk/dist/lib/http/node_untyped.js |
| 54 | ++++ b/node_modules/snowflake-sdk/dist/lib/http/node_untyped.js |
| 55 | +@@ -72,15 +72,7 @@ function isBypassProxy(proxy, destination, agentId) { |
| 56 | + * @inheritDoc |
| 57 | + */ |
| 58 | + NodeHttpClient.prototype.getAgent = function (parsedUrl, proxy, mock) { |
| 59 | +- Logger.getInstance().trace('Agent[url: %s] - getting an agent instance.', RequestUtil.describeURL(parsedUrl.href)); |
| 60 | +- if (!proxy && GlobalConfig.isEnvProxyActive()) { |
| 61 | +- const isHttps = parsedUrl.protocol === 'https:'; |
| 62 | +- proxy = ProxyUtil.getProxyFromEnv(isHttps); |
| 63 | +- if (proxy) { |
| 64 | +- Logger.getInstance().debug('Agent[url: %s] - proxy info loaded from the environment variable. Proxy host: %s', RequestUtil.describeURL(parsedUrl.href), proxy.host); |
| 65 | +- } |
| 66 | +- } |
| 67 | +- return getProxyAgent(proxy, parsedUrl, parsedUrl.href, mock, this._connectionConfig); |
| 68 | ++ return null; |
| 69 | + }; |
| 70 | + function getProxyAgent(proxyOptions, parsedUrl, destination, mock, connectionConfig) { |
| 71 | + Logger.getInstance().trace('Agent[url: %s] - getting a proxy agent instance.', RequestUtil.describeURL(parsedUrl.href)); |
| 72 | +diff --git a/node_modules/snowflake-sdk/dist/lib/minicore/minicore.js b/node_modules/snowflake-sdk/dist/lib/minicore/minicore.js |
| 73 | +index c288916..a97a284 100644 |
| 74 | +--- a/node_modules/snowflake-sdk/dist/lib/minicore/minicore.js |
| 75 | ++++ b/node_modules/snowflake-sdk/dist/lib/minicore/minicore.js |
| 76 | +@@ -14,27 +14,7 @@ exports.minicoreStatus = { |
| 77 | + errorType: null, |
| 78 | + errorDetails: null, |
| 79 | + }; |
| 80 | +-if (process.env.SNOWFLAKE_DISABLE_MINICORE) { |
| 81 | +- exports.minicoreStatus.errorType = 'Minicore is disabled with SNOWFLAKE_DISABLE_MINICORE env variable'; |
| 82 | +-} |
| 83 | +-else { |
| 84 | +- try { |
| 85 | +- exports.minicoreStatus.binaryName = getBinaryName(); |
| 86 | +- // eval('require') prevents bundlers (esbuild, webpack, etc.) from statically analyzing |
| 87 | +- // and attempting to bundle .node native addon files |
| 88 | +- // oxlint-disable-next-line no-eval |
| 89 | +- const minicoreModule = eval('require')(`./binaries/${exports.minicoreStatus.binaryName}`); |
| 90 | +- exports.minicoreStatus.version = minicoreModule.sfCoreFullVersion(); |
| 91 | +- } |
| 92 | +- catch (error) { |
| 93 | +- exports.minicoreStatus.errorType = isBinaryIgnoredByBundlers(error) |
| 94 | +- ? 'Binary is missing from the bundle' |
| 95 | +- : 'Failed to load binary'; |
| 96 | +- if (error instanceof Error) { |
| 97 | +- exports.minicoreStatus.errorDetails = error; |
| 98 | +- } |
| 99 | +- } |
| 100 | +-} |
| 101 | ++exports.minicoreStatus.errorType = 'Minicore is disabled with SNOWFLAKE_DISABLE_MINICORE env variable'; |
| 102 | + // NOTE: |
| 103 | + // Custom loader instead of napi-rs autogenerated binding file because: |
| 104 | + // - napi-rs tries to require(process.env.NAPI_RS_NATIVE_LIBRARY_PATH) which might be a security risk |
0 commit comments