@backstage/plugin-auth-backend 0.0.0-nightly-20220516023848 → 0.0.0-nightly-20220525024352

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,6 +1,24 @@
1
1
  # @backstage/plugin-auth-backend
2
2
 
3
- ## 0.0.0-nightly-20220516023848
3
+ ## 0.0.0-nightly-20220525024352
4
+
5
+ ### Patch Changes
6
+
7
+ - f6aae90e4e: Added configurable algorithm field for TokenFactory
8
+ - Updated dependencies
9
+ - @backstage/backend-common@0.0.0-nightly-20220525024352
10
+ - @backstage/plugin-auth-node@0.0.0-nightly-20220525024352
11
+
12
+ ## 0.14.1-next.0
13
+
14
+ ### Patch Changes
15
+
16
+ - f6aae90e4e: Added configurable algorithm field for TokenFactory
17
+ - Updated dependencies
18
+ - @backstage/backend-common@0.13.6-next.0
19
+ - @backstage/plugin-auth-node@0.2.2-next.0
20
+
21
+ ## 0.14.0
4
22
 
5
23
  ### Minor Changes
6
24
 
@@ -32,11 +50,11 @@
32
50
 
33
51
  - 9ec4e0613e: Update to `jose` 4.6.0
34
52
  - Updated dependencies
35
- - @backstage/backend-common@0.0.0-nightly-20220516023848
36
- - @backstage/config@0.0.0-nightly-20220516023848
37
- - @backstage/plugin-auth-node@0.0.0-nightly-20220516023848
38
- - @backstage/catalog-client@0.0.0-nightly-20220516023848
39
- - @backstage/catalog-model@0.0.0-nightly-20220516023848
53
+ - @backstage/backend-common@0.13.3
54
+ - @backstage/config@1.0.1
55
+ - @backstage/plugin-auth-node@0.2.1
56
+ - @backstage/catalog-client@1.0.2
57
+ - @backstage/catalog-model@1.0.2
40
58
 
41
59
  ## 0.13.1-next.2
42
60
 
package/dist/index.cjs.js CHANGED
@@ -26,9 +26,9 @@ var passportOneloginOauth = require('passport-onelogin-oauth');
26
26
  var passportSaml = require('passport-saml');
27
27
  var googleAuthLibrary = require('google-auth-library');
28
28
  var catalogClient = require('@backstage/catalog-client');
29
- var uuid = require('uuid');
30
- var luxon = require('luxon');
31
29
  var catalogModel = require('@backstage/catalog-model');
30
+ var luxon = require('luxon');
31
+ var uuid = require('uuid');
32
32
  var backendCommon = require('@backstage/backend-common');
33
33
  var firestore = require('@google-cloud/firestore');
34
34
  var lodash = require('lodash');
@@ -2300,10 +2300,12 @@ function createOidcRouter(options) {
2300
2300
  const MS_IN_S = 1e3;
2301
2301
  class TokenFactory {
2302
2302
  constructor(options) {
2303
+ var _a;
2303
2304
  this.issuer = options.issuer;
2304
2305
  this.logger = options.logger;
2305
2306
  this.keyStore = options.keyStore;
2306
2307
  this.keyDurationSeconds = options.keyDurationSeconds;
2308
+ this.algorithm = (_a = options.algorithm) != null ? _a : "ES256";
2307
2309
  }
2308
2310
  async issueToken(params) {
2309
2311
  const key = await this.getKey();
@@ -2359,11 +2361,11 @@ class TokenFactory {
2359
2361
  seconds: this.keyDurationSeconds
2360
2362
  }).toJSDate();
2361
2363
  const promise = (async () => {
2362
- const key = await jose.generateKeyPair("ES256");
2364
+ const key = await jose.generateKeyPair(this.algorithm);
2363
2365
  const publicKey = await jose.exportJWK(key.publicKey);
2364
2366
  const privateKey = await jose.exportJWK(key.privateKey);
2365
2367
  publicKey.kid = privateKey.kid = uuid.v4();
2366
- publicKey.alg = privateKey.alg = "ES256";
2368
+ publicKey.alg = privateKey.alg = this.algorithm;
2367
2369
  this.logger.info(`Created new signing key ${publicKey.kid}`);
2368
2370
  await this.keyStore.addKey(publicKey);
2369
2371
  return privateKey;