diff --git a/lib/file_transfer_agent/azure_util.js b/lib/file_transfer_agent/azure_util.js index 507dfce4e..005c403bd 100644 --- a/lib/file_transfer_agent/azure_util.js +++ b/lib/file_transfer_agent/azure_util.js @@ -48,8 +48,11 @@ function AzureUtil(connectionConfig, azure, filestream) { const connectionString = `https://${account}.blob.core.windows.net${sasToken}`; let proxy = ProxyUtil.getProxy(connectionConfig.getProxy(), 'Azure Util'); if (proxy && !isBypassProxy(proxy, connectionString)) { - proxy = ProxyUtil.getAzureProxy(proxy); Logger.getInstance().debug(`The destination host is: ${ProxyUtil.getHostFromURL(connectionString)} and the proxy host is: ${proxy.host}`); + Logger.getInstance().trace(`Initializing the proxy information for the Azure Client: ${ProxyUtil.describeProxy(proxy)}`); + + proxy = ProxyUtil.getAzureProxy(proxy); + Logger.getInstance().trace(connectionConfig.describe); } ProxyUtil.hideEnvironmentProxy(); const blobServiceClient = new AZURE.BlobServiceClient( diff --git a/lib/proxy_util.js b/lib/proxy_util.js index 50a198b1d..018a9cb3f 100644 --- a/lib/proxy_util.js +++ b/lib/proxy_util.js @@ -6,6 +6,7 @@ const Logger = require('./logger'); const Errors = require('./errors'); const Util = require('./util'); const GlobalConfig = require('./global_config'); +const LoggingUtil = require('./logger/logging_utils'); const ErrorCodes = Errors.codes; /** * remove http:// or https:// from the input, e.g. used with proxy URL @@ -254,4 +255,10 @@ exports.restoreEnvironmentProxy = function () { } } Logger.getInstance().debug('An Azure client has been created. Restore back the proxy environment variable values'); +}; + +exports.describeProxy = function (proxy) { + return `proxyHost: ${proxy.host}, proxyPort: ${proxy.port}, proxyUser: ${proxy.user}, ` + + `proxyPassword is ${LoggingUtil.describePresence(proxy.password)}, ` + + `proxyProtocol: ${proxy.protocol}, noProxy: ${proxy.noProxy}`; }; \ No newline at end of file diff --git a/test/unit/util_test.js b/test/unit/util_test.js index 812b3bea8..ef221b877 100644 --- a/test/unit/util_test.js +++ b/test/unit/util_test.js @@ -1057,42 +1057,6 @@ describe('Util', function () { parameters: ['a', 123, ['testing'], {}], result: true }, - { - name: 'HTTPS PROXY with authentication without port and protocol', - isHttps: true, - noProxy: '*.amazonaws.com,*.my_company.com,*.test.com', - httpsProxy: 'myproxy.server.com', - result: { - host: 'myproxy.server.com', - port: 80, - protocol: 'http:', - noProxy: '*.amazonaws.com|*.my_company.com|*.test.com', - }, - }, - { - name: 'HTTP PROXY with authentication without port and protocol', - isHttps: false, - noProxy: '*.amazonaws.com,*.my_company.com,*.test.com', - httpProxy: 'myproxy.server.com', - result: { - host: 'myproxy.server.com', - port: 80, - protocol: 'http:', - noProxy: '*.amazonaws.com|*.my_company.com|*.test.com', - }, - }, - { - name: 'HTTPS PROXY with authentication without port', - isHttps: true, - noProxy: '*.amazonaws.com,*.my_company.com,*.test.com', - httpsProxy: 'https://myproxy.server.com', - result: { - host: 'myproxy.server.com', - port: 443, - protocol: 'https:', - noProxy: '*.amazonaws.com|*.my_company.com|*.test.com', - }, - }, ]; for (const { name, parameters, result } of testCases) { @@ -1214,7 +1178,7 @@ describe('shouldPerformGCPBucket function test', () => { result: false, }, { - name: 'test - test - when token is empty but the disableGCPTokenUplaod is disabled', + name: 'test - when token is empty but the disableGCPTokenUplaod is disabled', accessToken: null, forceGCPUseDownscopedCredential: false, result: false,