From 8143d46d620c043390d06d6c9b8da00ef19a35c0 Mon Sep 17 00:00:00 2001 From: SimbaGithub Date: Wed, 6 Apr 2022 12:13:53 -0700 Subject: [PATCH 1/3] Set 'Client Application' under 'Client Info' --- lib/authentication/authentication.js | 2 -- lib/services/sf.js | 7 ++++++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/lib/authentication/authentication.js b/lib/authentication/authentication.js index 5975ff066..57da5b00e 100644 --- a/lib/authentication/authentication.js +++ b/lib/authentication/authentication.js @@ -36,7 +36,6 @@ exports.formAuthJSON = function formAuthJSON( username, clientName, clientVersion, - clientApplication, clientEnv ) { @@ -49,7 +48,6 @@ exports.formAuthJSON = function formAuthJSON( LOGIN_NAME: username, CLIENT_APP_ID: clientName, CLIENT_APP_VERSION: clientVersion, - CLIENT_APP_NAME: clientApplication, CLIENT_ENVIRONMENT: { OS: clientEnv.OS, diff --git a/lib/services/sf.js b/lib/services/sf.js index d483613e7..8cfb1d135 100644 --- a/lib/services/sf.js +++ b/lib/services/sf.js @@ -1079,7 +1079,6 @@ StateConnecting.prototype.continue = function () { CLIENT_APP_ID: this.connectionConfig.getClientType(), CLIENT_APP_VERSION: this.connectionConfig.getClientVersion(), - CLIENT_APP_NAME: this.connectionConfig.getClientApplication() }; // if we have some information about the client environment, add it as well @@ -1089,6 +1088,12 @@ StateConnecting.prototype.continue = function () clientInfo.CLIENT_ENVIRONMENT = clientEnvironment; } + var clientApplication = this.connectionConfig.getClientApplication(); + if (Util.isString(clientApplication)) + { + clientEnvironment["APPLICATION"] = clientApplication; + } + var sessionParameters = { SESSION_PARAMETERS: {} From 75295e0745bbdc88ad3f7554e05f92085f9e0517 Mon Sep 17 00:00:00 2001 From: SimbaGithub Date: Thu, 7 Apr 2022 11:51:42 -0700 Subject: [PATCH 2/3] Set 'Client Application' under 'Client Info' --- lib/authentication/authentication.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/authentication/authentication.js b/lib/authentication/authentication.js index 57da5b00e..5975ff066 100644 --- a/lib/authentication/authentication.js +++ b/lib/authentication/authentication.js @@ -36,6 +36,7 @@ exports.formAuthJSON = function formAuthJSON( username, clientName, clientVersion, + clientApplication, clientEnv ) { @@ -48,6 +49,7 @@ exports.formAuthJSON = function formAuthJSON( LOGIN_NAME: username, CLIENT_APP_ID: clientName, CLIENT_APP_VERSION: clientVersion, + CLIENT_APP_NAME: clientApplication, CLIENT_ENVIRONMENT: { OS: clientEnv.OS, From 68d7be746b64539fd194d7af0004a849dd42c90c Mon Sep 17 00:00:00 2001 From: SimbaGithub Date: Thu, 7 Apr 2022 14:14:24 -0700 Subject: [PATCH 3/3] Set 'Client Application' under 'Client Info' --- lib/authentication/authentication.js | 2 -- lib/connection/connection.js | 2 -- test/unit/authentication/authentication_test.js | 10 +++++----- 3 files changed, 5 insertions(+), 9 deletions(-) diff --git a/lib/authentication/authentication.js b/lib/authentication/authentication.js index 5975ff066..57da5b00e 100644 --- a/lib/authentication/authentication.js +++ b/lib/authentication/authentication.js @@ -36,7 +36,6 @@ exports.formAuthJSON = function formAuthJSON( username, clientName, clientVersion, - clientApplication, clientEnv ) { @@ -49,7 +48,6 @@ exports.formAuthJSON = function formAuthJSON( LOGIN_NAME: username, CLIENT_APP_ID: clientName, CLIENT_APP_VERSION: clientVersion, - CLIENT_APP_NAME: clientApplication, CLIENT_ENVIRONMENT: { OS: clientEnv.OS, diff --git a/lib/connection/connection.js b/lib/connection/connection.js index c7985163b..8f79fbfc1 100644 --- a/lib/connection/connection.js +++ b/lib/connection/connection.js @@ -209,7 +209,6 @@ function Connection(context) connectionConfig.username, connectionConfig.getClientName(), connectionConfig.getClientVersion(), - connectionConfig.getClientApplication(), connectionConfig.getClientEnvironment()); // Update JSON body with the authentication values @@ -272,7 +271,6 @@ function Connection(context) connectionConfig.username, connectionConfig.getClientName(), connectionConfig.getClientVersion(), - connectionConfig.getClientApplication(), connectionConfig.getClientEnvironment()); // Update JSON body with the authentication values diff --git a/test/unit/authentication/authentication_test.js b/test/unit/authentication/authentication_test.js index de43ce418..8853e9240 100644 --- a/test/unit/authentication/authentication_test.js +++ b/test/unit/authentication/authentication_test.js @@ -45,7 +45,7 @@ describe('default authentication', function () var body = authenticator.formAuthJSON(connectionOptionsDefault.authenticator, connectionOptionsDefault.account, connectionOptionsDefault.username, - {}, {}, {}, {}); + {}, {}, {}); assert.strictEqual( body['data']['AUTHENTICATOR'], authenticationTypes.DEFAULT_AUTHENTICATOR, 'Authenticator should be SNOWFLAKE'); @@ -155,7 +155,7 @@ describe('external browser authentication', function () var body = authenticator.formAuthJSON(connectionOptionsExternalBrowser.authenticator, connectionOptionsExternalBrowser.account, connectionOptionsExternalBrowser.username, - {}, {}, {}, {}); + {}, {}, {}); assert.strictEqual( body['data']['AUTHENTICATOR'], authenticationTypes.EXTERNAL_BROWSER_AUTHENTICATOR, 'Authenticator should be EXTERNALBROWSER'); @@ -300,7 +300,7 @@ describe('key-pair authentication', function () var body = authenticator.formAuthJSON(connectionOptionsKeyPair.authenticator, connectionOptionsKeyPair.account, connectionOptionsKeyPair.username, - {}, {}, {}, {}); + {}, {}, {}); assert.strictEqual( body['data']['AUTHENTICATOR'], authenticationTypes.KEY_PAIR_AUTHENTICATOR, 'Authenticator should be SNOWFLAKE_JWT'); @@ -325,7 +325,7 @@ describe('oauth authentication', function () var body = authenticator.formAuthJSON(connectionOptionsOauth.authenticator, connectionOptionsOauth.account, connectionOptionsOauth.username, - {}, {}, {}, {}); + {}, {}, {}); assert.strictEqual( body['data']['AUTHENTICATOR'], authenticationTypes.OAUTH_AUTHENTICATOR, 'Authenticator should be OAUTH'); @@ -502,7 +502,7 @@ describe('okta authentication', function () var body = authenticator.formAuthJSON(connectionOptionsOkta.authenticator, connectionOptionsOkta.account, connectionOptionsOkta.username, - {}, {}, {}, {}); + {}, {}, {}); assert.strictEqual( body['data']['AUTHENTICATOR'], 'https://dev-12345678.okta.com/' , 'Authenticator should be OAUTH');