@cumulus/common 10.1.1 → 10.1.2

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.
@@ -0,0 +1,2 @@
1
+ export declare const fetchFakeProviderIp: () => Promise<string>;
2
+ //# sourceMappingURL=fake-provider.d.ts.map
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.fetchFakeProviderIp = void 0;
7
+ const is_ip_1 = __importDefault(require("is-ip"));
8
+ const S3_1 = require("@cumulus/aws-client/S3");
9
+ const fetchFakeProviderIp = async () => {
10
+ if (!process.env.FAKE_PROVIDER_CONFIG_BUCKET) {
11
+ throw new Error('The FAKE_PROVIDER_CONFIG_BUCKET environment variable must be set');
12
+ }
13
+ const textObject = await (0, S3_1.getTextObject)(process.env.FAKE_PROVIDER_CONFIG_BUCKET, 'fake-provider-ip');
14
+ if (!textObject) {
15
+ throw new Error('Failed to get object defined in FAKE_PROVIDER_CONFIG_BUCKET');
16
+ }
17
+ const ip = textObject.trim();
18
+ if (!(0, is_ip_1.default)(ip)) {
19
+ throw new Error(`Invalid fake provider IP "${ip}" fetched from s3://${process.env.FAKE_PROVIDER_CONFIG_BUCKET}/fake-provider-ip`);
20
+ }
21
+ return ip;
22
+ };
23
+ exports.fetchFakeProviderIp = fetchFakeProviderIp;
24
+ //# sourceMappingURL=fake-provider.js.map
package/index.d.ts CHANGED
@@ -2,6 +2,7 @@ import BucketsConfig = require('./BucketsConfig');
2
2
  export { BucketsConfig };
3
3
  export * as cliUtils from './cli-utils';
4
4
  export * as envUtils from './env';
5
+ export * as fakeProvider from './fake-provider';
5
6
  export * as keyPairProvider from './key-pair-provider';
6
7
  export * as log from './log';
7
8
  export * as testUtils from './test-utils';
package/index.js CHANGED
@@ -23,11 +23,12 @@ var __importStar = (this && this.__importStar) || function (mod) {
23
23
  return result;
24
24
  };
25
25
  Object.defineProperty(exports, "__esModule", { value: true });
26
- exports.workflows = exports.util = exports.testUtils = exports.log = exports.keyPairProvider = exports.envUtils = exports.cliUtils = exports.BucketsConfig = void 0;
26
+ exports.workflows = exports.util = exports.testUtils = exports.log = exports.keyPairProvider = exports.fakeProvider = exports.envUtils = exports.cliUtils = exports.BucketsConfig = void 0;
27
27
  const BucketsConfig = require("./BucketsConfig");
28
28
  exports.BucketsConfig = BucketsConfig;
29
29
  exports.cliUtils = __importStar(require("./cli-utils"));
30
30
  exports.envUtils = __importStar(require("./env"));
31
+ exports.fakeProvider = __importStar(require("./fake-provider"));
31
32
  exports.keyPairProvider = __importStar(require("./key-pair-provider"));
32
33
  exports.log = __importStar(require("./log"));
33
34
  exports.testUtils = __importStar(require("./test-utils"));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cumulus/common",
3
- "version": "10.1.1",
3
+ "version": "10.1.2",
4
4
  "description": "Common utilities used across tasks",
5
5
  "keywords": [
6
6
  "GIBS",
@@ -41,12 +41,13 @@
41
41
  "author": "Cumulus Authors",
42
42
  "license": "Apache-2.0",
43
43
  "dependencies": {
44
- "@cumulus/errors": "10.1.1",
45
- "@cumulus/logger": "10.1.1",
44
+ "@cumulus/errors": "10.1.2",
45
+ "@cumulus/logger": "10.1.2",
46
46
  "ajv": "^6.12.3",
47
47
  "aws-sdk": "^2.585.0",
48
48
  "follow-redirects": "^1.2.4",
49
49
  "fs-extra": "^5.0.0",
50
+ "is-ip": "^3.1.0",
50
51
  "jsonpath-plus": "^3.0.0",
51
52
  "lodash": "^4.17.21",
52
53
  "node-forge": "^1.0.0",
@@ -63,5 +64,5 @@
63
64
  "@types/node-forge": "^0.9.5",
64
65
  "@types/url-join": "^4.0.0"
65
66
  },
66
- "gitHead": "b34bda5035263c74c8341b25abfb033226a27387"
67
+ "gitHead": "3b59753fa85064549b70ad8ed4a4ee213c5af313"
67
68
  }