@backstage/plugin-auth-backend 0.0.0-nightly-20220529024825 → 0.0.0-nightly-20220601025619

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,14 +1,31 @@
1
1
  # @backstage/plugin-auth-backend
2
2
 
3
- ## 0.0.0-nightly-20220529024825
3
+ ## 0.0.0-nightly-20220601025619
4
4
 
5
5
  ### Patch Changes
6
6
 
7
7
  - 5e055079f0: Increased key field size for signing_keys table to account for larger signature keys
8
8
  - f6aae90e4e: Added configurable algorithm field for TokenFactory
9
+ - 8f7b1835df: Updated dependency `msw` to `^0.41.0`.
10
+ - 467facc6ea: Fix improper binding of 'this' in ALB Auth provider
9
11
  - Updated dependencies
10
- - @backstage/backend-common@0.0.0-nightly-20220529024825
11
- - @backstage/plugin-auth-node@0.0.0-nightly-20220529024825
12
+ - @backstage/backend-common@0.0.0-nightly-20220601025619
13
+ - @backstage/catalog-client@0.0.0-nightly-20220601025619
14
+ - @backstage/plugin-auth-node@0.0.0-nightly-20220601025619
15
+ - @backstage/catalog-model@0.0.0-nightly-20220601025619
16
+
17
+ ## 0.14.1-next.1
18
+
19
+ ### Patch Changes
20
+
21
+ - 5e055079f0: Increased key field size for signing_keys table to account for larger signature keys
22
+ - 8f7b1835df: Updated dependency `msw` to `^0.41.0`.
23
+ - 467facc6ea: Fix improper binding of 'this' in ALB Auth provider
24
+ - Updated dependencies
25
+ - @backstage/backend-common@0.13.6-next.1
26
+ - @backstage/catalog-client@1.0.3-next.0
27
+ - @backstage/plugin-auth-node@0.2.2-next.1
28
+ - @backstage/catalog-model@1.0.3-next.0
12
29
 
13
30
  ## 0.14.1-next.0
14
31
 
package/dist/index.cjs.js CHANGED
@@ -764,6 +764,19 @@ const ALB_JWT_HEADER = "x-amzn-oidc-data";
764
764
  const ALB_ACCESS_TOKEN_HEADER = "x-amzn-oidc-accesstoken";
765
765
  class AwsAlbAuthProvider {
766
766
  constructor(options) {
767
+ this.getKey = async (header) => {
768
+ if (!header.kid) {
769
+ throw new errors.AuthenticationError("No key id was specified in header");
770
+ }
771
+ const optionalCacheKey = this.keyCache.get(header.kid);
772
+ if (optionalCacheKey) {
773
+ return crypto__namespace.createPublicKey(optionalCacheKey);
774
+ }
775
+ const keyText = await fetch__default["default"](`https://public-keys.auth.elb.${encodeURIComponent(this.region)}.amazonaws.com/${encodeURIComponent(header.kid)}`).then((response) => response.text());
776
+ const keyValue = crypto__namespace.createPublicKey(keyText);
777
+ this.keyCache.set(header.kid, keyValue.export({ format: "pem", type: "spki" }));
778
+ return keyValue;
779
+ };
767
780
  this.region = options.region;
768
781
  this.issuer = options.issuer;
769
782
  this.authHandler = options.authHandler;
@@ -837,19 +850,6 @@ class AwsAlbAuthProvider {
837
850
  profile
838
851
  };
839
852
  }
840
- async getKey(header) {
841
- if (!header.kid) {
842
- throw new errors.AuthenticationError("No key id was specified in header");
843
- }
844
- const optionalCacheKey = this.keyCache.get(header.kid);
845
- if (optionalCacheKey) {
846
- return crypto__namespace.createPublicKey(optionalCacheKey);
847
- }
848
- const keyText = await fetch__default["default"](`https://public-keys.auth.elb.${encodeURIComponent(this.region)}.amazonaws.com/${encodeURIComponent(header.kid)}`).then((response) => response.text());
849
- const keyValue = crypto__namespace.createPublicKey(keyText);
850
- this.keyCache.set(header.kid, keyValue.export({ format: "pem", type: "spki" }));
851
- return keyValue;
852
- }
853
853
  }
854
854
  const awsAlb = createAuthProviderIntegration({
855
855
  create(options) {