@squiz/db-lib 1.35.1-alpha.25 → 1.35.1-alpha.26

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.
@@ -5,33 +5,33 @@
5
5
  4 timing config:load:defaults Completed in 2ms
6
6
  5 timing config:load:file:/usr/local/lib/node_modules/npm/npmrc Completed in 0ms
7
7
  6 timing config:load:builtin Completed in 1ms
8
- 7 timing config:load:cli Completed in 2ms
8
+ 7 timing config:load:cli Completed in 1ms
9
9
  8 timing config:load:env Completed in 1ms
10
10
  9 info found workspace root at /builds/developer-experience/cmp
11
11
  10 timing config:load:file:/builds/developer-experience/cmp/.npmrc Completed in 0ms
12
12
  11 timing config:load:project Completed in 21ms
13
- 12 timing config:load:file:/root/.npmrc Completed in 0ms
13
+ 12 timing config:load:file:/root/.npmrc Completed in 1ms
14
14
  13 timing config:load:user Completed in 1ms
15
15
  14 timing config:load:file:/usr/local/etc/npmrc Completed in 0ms
16
16
  15 timing config:load:global Completed in 0ms
17
17
  16 timing config:load:setEnvs Completed in 1ms
18
18
  17 timing config:load Completed in 30ms
19
19
  18 timing npm:load:configload Completed in 30ms
20
- 19 timing npm:load:mkdirpcache Completed in 84ms
21
- 20 timing npm:load:mkdirplogs Completed in 1ms
20
+ 19 timing npm:load:mkdirpcache Completed in 0ms
21
+ 20 timing npm:load:mkdirplogs Completed in 0ms
22
22
  21 verbose title npm run compile
23
23
  22 verbose argv "run" "compile" "--"
24
- 23 timing npm:load:setTitle Completed in 4ms
25
- 24 timing config:load:flatten Completed in 12ms
26
- 25 timing npm:load:display Completed in 16ms
27
- 26 verbose logfile logs-max:10 dir:/builds/developer-experience/cmp/packages/db-lib/.npm/_logs/2023-06-12T03_44_25_200Z-
28
- 27 verbose logfile /builds/developer-experience/cmp/packages/db-lib/.npm/_logs/2023-06-12T03_44_25_200Z-debug-0.log
29
- 28 timing npm:load:logFile Completed in 10ms
24
+ 23 timing npm:load:setTitle Completed in 2ms
25
+ 24 timing config:load:flatten Completed in 4ms
26
+ 25 timing npm:load:display Completed in 5ms
27
+ 26 verbose logfile logs-max:10 dir:/builds/developer-experience/cmp/packages/db-lib/.npm/_logs/2023-06-12T22_41_46_505Z-
28
+ 27 verbose logfile /builds/developer-experience/cmp/packages/db-lib/.npm/_logs/2023-06-12T22_41_46_505Z-debug-0.log
29
+ 28 timing npm:load:logFile Completed in 4ms
30
30
  29 timing npm:load:timers Completed in 0ms
31
31
  30 timing npm:load:configScope Completed in 0ms
32
- 31 timing npm:load Completed in 146ms
32
+ 31 timing npm:load Completed in 43ms
33
33
  32 silly logfile done cleaning log files
34
- 33 timing command:run Completed in 3275ms
34
+ 33 timing command:run Completed in 3584ms
35
35
  34 verbose exit 0
36
- 35 timing npm Completed in 3440ms
36
+ 35 timing npm Completed in 3640ms
37
37
  36 info ok
package/lib/index.js CHANGED
@@ -49343,11 +49343,11 @@ var require_CloudflareApiKeyService = __commonJS({
49343
49343
  "../dx-common-lib/lib/api-key-validation/CloudflareApiKeyService.js"(exports2) {
49344
49344
  "use strict";
49345
49345
  Object.defineProperty(exports2, "__esModule", { value: true });
49346
- exports2.CloudflareApiKeyService = exports2.validKeys = void 0;
49346
+ exports2.CloudflareApiKeyService = void 0;
49347
49347
  var client_secrets_manager_1 = require_dist_cjs51();
49348
49348
  var UnAuthenticatedRequestError_1 = require_UnAuthenticatedRequestError();
49349
49349
  var dx_logger_lib_1 = require_lib4();
49350
- exports2.validKeys = {
49350
+ var validKeys = {
49351
49351
  keys: [],
49352
49352
  "matrix-keys": []
49353
49353
  };
@@ -49365,16 +49365,16 @@ var require_CloudflareApiKeyService = __commonJS({
49365
49365
  this.logger = logger2;
49366
49366
  }
49367
49367
  keyIsValid(key) {
49368
- if (exports2.validKeys.keys.length == 0) {
49368
+ if (validKeys.keys.length == 0) {
49369
49369
  throw new UnAuthenticatedRequestError_1.UnAuthenticatedRequestError("No api keys to check against");
49370
49370
  }
49371
- return exports2.validKeys.keys.includes(key);
49371
+ return validKeys.keys.includes(key);
49372
49372
  }
49373
49373
  matrixKeyIsValid(key) {
49374
- if (exports2.validKeys["matrix-keys"].length == 0) {
49374
+ if (validKeys["matrix-keys"].length == 0) {
49375
49375
  throw new UnAuthenticatedRequestError_1.UnAuthenticatedRequestError("No api keys to check against");
49376
49376
  }
49377
- return exports2.validKeys["matrix-keys"].includes(key);
49377
+ return validKeys["matrix-keys"].includes(key);
49378
49378
  }
49379
49379
  async getValidApiKeys() {
49380
49380
  let secretValue;
@@ -49401,14 +49401,18 @@ var require_CloudflareApiKeyService = __commonJS({
49401
49401
  }
49402
49402
  async refreshApiKeys() {
49403
49403
  this.logger.info("refreshing keys");
49404
- exports2.validKeys = await this.getValidApiKeys();
49405
- this.logger.info(`number of valid keys found: ${exports2.validKeys.keys.length}`);
49404
+ validKeys = await this.getValidApiKeys();
49405
+ this.logger.info(`number of valid keys found: ${validKeys.keys.length}`);
49406
49406
  if (!refreshInterval) {
49407
49407
  refreshInterval = setInterval(async () => {
49408
49408
  await this.refreshApiKeys();
49409
49409
  }, REFRESH_TIMER);
49410
49410
  }
49411
49411
  }
49412
+ // temporary method, to be removed when DXP auth is properly implemented
49413
+ getMatrixKeys() {
49414
+ return validKeys["matrix-keys"];
49415
+ }
49412
49416
  };
49413
49417
  exports2.CloudflareApiKeyService = CloudflareApiKeyService;
49414
49418
  }
@@ -49427,6 +49431,10 @@ var require_DevelopmentApiKeyService = __commonJS({
49427
49431
  matrixKeyIsValid() {
49428
49432
  return true;
49429
49433
  }
49434
+ // temporary method, to be removed when DXP auth is properly implemented
49435
+ getMatrixKeys() {
49436
+ return ["matrix-api-key"];
49437
+ }
49430
49438
  };
49431
49439
  exports2.DevelopmentApiKeyService = DevelopmentApiKeyService;
49432
49440
  }