@backstage/plugin-auth-backend 0.14.1-next.0 → 0.14.1-next.1

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,5 +1,18 @@
1
1
  # @backstage/plugin-auth-backend
2
2
 
3
+ ## 0.14.1-next.1
4
+
5
+ ### Patch Changes
6
+
7
+ - 5e055079f0: Increased key field size for signing_keys table to account for larger signature keys
8
+ - 8f7b1835df: Updated dependency `msw` to `^0.41.0`.
9
+ - 467facc6ea: Fix improper binding of 'this' in ALB Auth provider
10
+ - Updated dependencies
11
+ - @backstage/backend-common@0.13.6-next.1
12
+ - @backstage/catalog-client@1.0.3-next.0
13
+ - @backstage/plugin-auth-node@0.2.2-next.1
14
+ - @backstage/catalog-model@1.0.3-next.0
15
+
3
16
  ## 0.14.1-next.0
4
17
 
5
18
  ### Patch Changes
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) {