@itentialopensource/adapter-gcp_compute 1.3.1 → 1.3.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,4 +1,20 @@
1
1
 
2
+ ## 1.3.3 [08-01-2023]
3
+
4
+ * Remove any sensitive data logging
5
+
6
+ See merge request itentialopensource/adapters/cloud/adapter-gcp_compute!8
7
+
8
+ ---
9
+
10
+ ## 1.3.2 [06-22-2023]
11
+
12
+ * Remove any sensitive data logging
13
+
14
+ See merge request itentialopensource/adapters/cloud/adapter-gcp_compute!8
15
+
16
+ ---
17
+
2
18
  ## 1.3.1 [05-09-2023]
3
19
 
4
20
  * updated adapterBase.js with broker integration bug fixes
package/adapter.js CHANGED
@@ -923,14 +923,11 @@ class GcpCompute extends AdapterBaseCl {
923
923
  log.trace(origin);
924
924
  try {
925
925
  // const keyFile = this.getNested(this, 'allProps', 'authentication', 'configureGtoken', 'keyFile') || process.env.GOOGLE_APPLICATION_CREDENTIALS;
926
- // log.debug(`readPropsKeyFile keyFile is ${keyFile}`)
927
926
  if (!keyFile) {
928
927
  throw new Error('No keyFile specified in Service Config or GOOGLE_APPLICATION_CREDENTIALS');
929
928
  } else {
930
929
  const content = readFileSync(keyFile, 'utf8');
931
- // log.debug(`readPropsKeyFile content length is ${content.length}`);
932
930
  const keyObj = JSON.parse(content);
933
- // log.debug(`readPropsKeyFile keyObj is ${JSON.stringify(keyObj)}`);
934
931
  return keyObj;
935
932
  }
936
933
  } catch (ex) {
@@ -955,7 +952,6 @@ class GcpCompute extends AdapterBaseCl {
955
952
  delete configureGtoken.keyFile;
956
953
  }
957
954
  if (configureGtoken.key || configureGtoken.keyFile) {
958
- // log.debug(`${meth} configureGtoken is ${JSON.stringify(configureGtoken)}`);
959
955
  if (this.allProps.stub) {
960
956
  this.gtoken = this;
961
957
  } else {
@@ -1004,7 +1000,6 @@ class GcpCompute extends AdapterBaseCl {
1004
1000
  refreshAuthorizationHeader(token) {
1005
1001
  const ret = `${token.token_type} ${token.access_token}`;
1006
1002
  this.allProps.request.global_request.addlHeaders.Authorization = ret;
1007
- // log.debug(`refreshAuthorizationHeader ${JSON.stringify(this.allProps.request.global_request.addlHeaders)}`); // this will LEAK the token!
1008
1003
  return ret;
1009
1004
  }
1010
1005
 
@@ -1167,7 +1162,7 @@ class GcpCompute extends AdapterBaseCl {
1167
1162
  // Make the call -
1168
1163
  // identifyRequest(entity, action, requestObj, returnDataFlag, callback)
1169
1164
  return this.refreshAuthorizationAndIdentifyRequest('Projects', 'getProject', reqObj, true, (irReturnData, irReturnError) => {
1170
- // if we received an error or their is no response on the results
1165
+ // if we received an error or there is no response on the results
1171
1166
  // return an error
1172
1167
  if (irReturnError) {
1173
1168
  /* HERE IS WHERE YOU CAN ALTER THE ERROR MESSAGE */
package/adapterBase.js CHANGED
@@ -11,11 +11,11 @@
11
11
  /* eslint prefer-destructuring: warn */
12
12
 
13
13
  /* Required libraries. */
14
- const fs = require('fs-extra');
15
14
  const path = require('path');
16
- const jsonQuery = require('json-query');
17
- const EventEmitterCl = require('events').EventEmitter;
18
15
  const { execSync } = require('child_process');
16
+ const EventEmitterCl = require('events').EventEmitter;
17
+ const fs = require('fs-extra');
18
+ const jsonQuery = require('json-query');
19
19
 
20
20
  const sampleProperties = require(`${__dirname}/sampleProperties.json`).properties;
21
21
 
@@ -26,14 +26,11 @@ const AjvCl = require('ajv');
26
26
  const PropUtilCl = require('@itentialopensource/adapter-utils').PropertyUtility;
27
27
  const RequestHandlerCl = require('@itentialopensource/adapter-utils').RequestHandler;
28
28
 
29
- const TransUtilCl = require(path.join(__dirname, 'node_modules/@itentialopensource/adapter-utils/lib/translatorUtil.js'));
30
-
31
29
  const entitiesToDB = require(path.join(__dirname, 'utils/entitiesToDB'));
32
30
  const troubleshootingAdapter = require(path.join(__dirname, 'utils/troubleshootingAdapter'));
33
31
  const tbUtils = require(path.join(__dirname, 'utils/tbUtils'));
34
32
 
35
33
  let propUtil = null;
36
- let transUtil = null;
37
34
  let choosepath = null;
38
35
 
39
36
  /*
@@ -217,10 +214,6 @@ class AdapterBase extends EventEmitterCl {
217
214
  this.id = prongid;
218
215
  this.propUtilInst = new PropUtilCl(prongid, __dirname);
219
216
  propUtil = this.propUtilInst;
220
- this.transUtilInst = new TransUtilCl(prongid, this.propUtilInst);
221
- transUtil = this.transUtilInst;
222
- this.transUtilInst = new TransUtilCl(prongid, this.propUtilInst);
223
- transUtil = this.transUtilInst;
224
217
  this.initProps = properties;
225
218
  this.alive = false;
226
219
  this.healthy = false;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@itentialopensource/adapter-gcp_compute",
3
- "version": "1.3.1",
3
+ "version": "1.3.3",
4
4
  "description": "This adapter integrates with system described as: computeEngineApi.",
5
5
  "main": "adapter.js",
6
6
  "systemName": "Google Cloud Compute",
Binary file
@@ -7,9 +7,9 @@
7
7
  /* eslint import/no-dynamic-require: warn */
8
8
  /* eslint import/no-unresolved: warn */
9
9
 
10
- const mocha = require('mocha');
11
10
  const path = require('path');
12
11
  const assert = require('assert');
12
+ const mocha = require('mocha');
13
13
  const itParam = require('mocha-param');
14
14
 
15
15
  const utils = require('../../utils/tbUtils');
@@ -3,8 +3,8 @@
3
3
  /* global describe it context before after */
4
4
  /* eslint no-unused-vars: warn */
5
5
 
6
- const mocha = require('mocha');
7
6
  const assert = require('assert');
7
+ const mocha = require('mocha');
8
8
  const diagnostics = require('network-diagnostics');
9
9
 
10
10
  let host;
@@ -9,13 +9,13 @@
9
9
  // include required items for testing & logging
10
10
  const assert = require('assert');
11
11
  const fs = require('fs');
12
- const mocha = require('mocha');
13
12
  const path = require('path');
13
+ const util = require('util');
14
+ const mocha = require('mocha');
14
15
  const winston = require('winston');
15
16
  const { expect } = require('chai');
16
17
  const { use } = require('chai');
17
18
  const td = require('testdouble');
18
- const util = require('util');
19
19
 
20
20
  const anything = td.matchers.anything();
21
21
 
@@ -5,9 +5,9 @@
5
5
 
6
6
  // include required items for testing & logging
7
7
  const assert = require('assert');
8
+ const path = require('path');
8
9
  const fs = require('fs-extra');
9
10
  const mocha = require('mocha');
10
- const path = require('path');
11
11
  const winston = require('winston');
12
12
  const { expect } = require('chai');
13
13
  const { use } = require('chai');
@@ -8,12 +8,12 @@
8
8
 
9
9
  // include required items for testing & logging
10
10
  const assert = require('assert');
11
- const fs = require('fs-extra');
12
- const mocha = require('mocha');
13
11
  const path = require('path');
14
12
  const util = require('util');
15
- const winston = require('winston');
16
13
  const execute = require('child_process').execSync;
14
+ const fs = require('fs-extra');
15
+ const mocha = require('mocha');
16
+ const winston = require('winston');
17
17
  const { expect } = require('chai');
18
18
  const { use } = require('chai');
19
19
  const td = require('testdouble');
@@ -4,8 +4,8 @@
4
4
  /* eslint import/no-dynamic-require:warn */
5
5
  /* eslint prefer-destructuring:warn */
6
6
 
7
- const fs = require('fs-extra');
8
7
  const path = require('path');
8
+ const fs = require('fs-extra');
9
9
 
10
10
  /**
11
11
  * This script will determine the information about the adapter and store
package/utils/addAuth.js CHANGED
@@ -2,9 +2,9 @@
2
2
  /* eslint global-require: warn */
3
3
  /* eslint import/no-dynamic-require: warn */
4
4
 
5
- const rls = require('readline-sync');
6
5
  const path = require('path');
7
6
  const fs = require('fs');
7
+ const rls = require('readline-sync');
8
8
 
9
9
  function getQuestions(props, obj) {
10
10
  const questions = props.map((p) => `${p}: ${(obj[p] !== undefined) ? `(${obj[p]})` : ''} `);
@@ -1,8 +1,8 @@
1
1
  #!/usr/bin/env node
2
2
  /* @copyright Itential, LLC 2019 */
3
3
 
4
- const fs = require('fs-extra');
5
4
  const path = require('path');
5
+ const fs = require('fs-extra');
6
6
 
7
7
  async function createBundle(adapterOldDir) {
8
8
  // set directories
@@ -1,7 +1,7 @@
1
1
  const { execSync } = require('child_process');
2
+ const fs = require('fs');
2
3
  const semver = require('semver');
3
4
  const axios = require('axios');
4
- const fs = require('fs');
5
5
  const packageJson = require('../package.json');
6
6
 
7
7
  const localEngineVer = packageJson.engineVersion;
package/utils/findPath.js CHANGED
@@ -4,8 +4,8 @@
4
4
  /* eslint import/no-dynamic-require:warn */
5
5
  /* eslint prefer-destructuring:warn */
6
6
 
7
- const fs = require('fs-extra');
8
7
  const path = require('path');
8
+ const fs = require('fs-extra');
9
9
  const rls = require('readline-sync');
10
10
 
11
11
  /**
package/utils/modify.js CHANGED
@@ -1,7 +1,7 @@
1
+ const { execSync } = require('child_process');
1
2
  const fs = require('fs-extra');
2
3
  const Ajv = require('ajv');
3
4
  const rls = require('readline-sync');
4
- const { execSync } = require('child_process');
5
5
  const { existsSync } = require('fs-extra');
6
6
  const { getAdapterConfig } = require('./tbUtils');
7
7
  const { name } = require('../package.json');
@@ -1,9 +1,9 @@
1
1
  #!/usr/bin/env node
2
2
  /* @copyright Itential, LLC 2019 */
3
3
 
4
- const fs = require('fs-extra');
5
4
  const path = require('path');
6
5
  const { spawnSync } = require('child_process');
6
+ const fs = require('fs-extra');
7
7
  const { createBundle } = require('./artifactize');
8
8
 
9
9
  const nodeEntryPath = path.resolve('.');
package/utils/tbUtils.js CHANGED
@@ -6,8 +6,8 @@
6
6
  /* eslint-disable no-console */
7
7
 
8
8
  const path = require('path');
9
- const fs = require('fs-extra');
10
9
  const cp = require('child_process');
10
+ const fs = require('fs-extra');
11
11
 
12
12
  module.exports = {
13
13
  SERVICE_CONFIGS_COLLECTION: 'service_configs',
@@ -1,9 +1,9 @@
1
1
  #!/usr/bin/env node
2
2
  /* @copyright Itential, LLC 2019 */
3
3
 
4
+ const execute = require('child_process').exec;
4
5
  const fs = require('fs-extra');
5
6
  const rl = require('readline-sync');
6
- const execute = require('child_process').exec;
7
7
 
8
8
  /**
9
9
  * This script will determine the type of integration test to run