@backstage/plugin-auth-backend-module-aws-alb-provider 0.0.0-nightly-20260127025640 → 0.0.0-nightly-20260129030729

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,27 @@
1
1
  # @backstage/plugin-auth-backend-module-aws-alb-provider
2
2
 
3
- ## 0.0.0-nightly-20260127025640
3
+ ## 0.0.0-nightly-20260129030729
4
4
 
5
5
  ### Patch Changes
6
6
 
7
+ - 7455dae: Use node prefix on native imports
7
8
  - 69d880e: Bump to latest zod to ensure it has the latest features
8
9
  - Updated dependencies
9
- - @backstage/backend-plugin-api@0.0.0-nightly-20260127025640
10
- - @backstage/plugin-auth-node@0.0.0-nightly-20260127025640
11
- - @backstage/plugin-auth-backend@0.0.0-nightly-20260127025640
10
+ - @backstage/backend-plugin-api@0.0.0-nightly-20260129030729
11
+ - @backstage/plugin-auth-backend@0.0.0-nightly-20260129030729
12
+ - @backstage/plugin-auth-node@0.0.0-nightly-20260129030729
13
+ - @backstage/errors@1.2.7
14
+
15
+ ## 0.4.12-next.0
16
+
17
+ ### Patch Changes
18
+
19
+ - 7455dae: Use node prefix on native imports
20
+ - 69d880e: Bump to latest zod to ensure it has the latest features
21
+ - Updated dependencies
22
+ - @backstage/backend-plugin-api@1.7.0-next.0
23
+ - @backstage/plugin-auth-backend@0.26.1-next.0
24
+ - @backstage/plugin-auth-node@0.6.12-next.0
12
25
  - @backstage/errors@1.2.7
13
26
 
14
27
  ## 0.4.11
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var crypto = require('crypto');
3
+ var crypto = require('node:crypto');
4
4
  var jose = require('jose');
5
5
  var errors = require('@backstage/errors');
6
6
 
@@ -1 +1 @@
1
- {"version":3,"file":"helpers.cjs.js","sources":["../src/helpers.ts"],"sourcesContent":["/*\n * Copyright 2023 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { KeyObject } from 'crypto';\nimport * as crypto from 'crypto';\nimport { JWTHeaderParameters, decodeJwt } from 'jose';\nimport NodeCache from 'node-cache';\nimport { PassportProfile, ProfileInfo } from '@backstage/plugin-auth-node';\nimport { AuthenticationError } from '@backstage/errors';\n\nexport const makeProfileInfo = (\n profile: PassportProfile,\n idToken?: string,\n): ProfileInfo => {\n let email: string | undefined = undefined;\n if (profile.emails && profile.emails.length > 0) {\n const [firstEmail] = profile.emails;\n email = firstEmail.value;\n }\n\n let picture: string | undefined = undefined;\n if (profile.avatarUrl) {\n picture = profile.avatarUrl;\n } else if (profile.photos && profile.photos.length > 0) {\n const [firstPhoto] = profile.photos;\n picture = firstPhoto.value;\n }\n\n let displayName: string | undefined =\n profile.displayName ?? profile.username ?? profile.id;\n\n if ((!email || !picture || !displayName) && idToken) {\n try {\n const decoded: Record<string, string> = decodeJwt(idToken) as {\n email?: string;\n picture?: string;\n name?: string;\n };\n if (!email && decoded.email) {\n email = decoded.email;\n }\n if (!picture && decoded.picture) {\n picture = decoded.picture;\n }\n if (!displayName && decoded.name) {\n displayName = decoded.name;\n }\n } catch (e) {\n throw new Error(`Failed to parse id token and get profile info, ${e}`);\n }\n }\n\n return {\n email,\n picture,\n displayName,\n };\n};\n\nconst getPublicKeyEndpoint = (region: string) => {\n if (region.startsWith('us-gov')) {\n return `https://s3-${encodeURIComponent(\n region,\n )}.amazonaws.com/aws-elb-public-keys-prod-${encodeURIComponent(region)}`;\n }\n\n return `https://public-keys.auth.elb.${encodeURIComponent(\n region,\n )}.amazonaws.com`;\n};\n\nexport const provisionKeyCache = (region: string, keyCache: NodeCache) => {\n return async (header: JWTHeaderParameters): Promise<KeyObject> => {\n if (!header.kid) {\n throw new AuthenticationError('No key id was specified in header');\n }\n const optionalCacheKey = keyCache.get<KeyObject>(header.kid);\n if (optionalCacheKey) {\n return crypto.createPublicKey(optionalCacheKey);\n }\n\n const keyText: string = await fetch(\n `${getPublicKeyEndpoint(region)}/${encodeURIComponent(header.kid)}`,\n ).then(response => response.text());\n\n const keyValue = crypto.createPublicKey(keyText);\n keyCache.set(header.kid, keyValue.export({ format: 'pem', type: 'spki' }));\n return keyValue;\n };\n};\n"],"names":["decodeJwt","AuthenticationError","crypto"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAuBO,MAAM,eAAA,GAAkB,CAC7B,OAAA,EACA,OAAA,KACgB;AAChB,EAAA,IAAI,KAAA,GAA4B,MAAA;AAChC,EAAA,IAAI,OAAA,CAAQ,MAAA,IAAU,OAAA,CAAQ,MAAA,CAAO,SAAS,CAAA,EAAG;AAC/C,IAAA,MAAM,CAAC,UAAU,CAAA,GAAI,OAAA,CAAQ,MAAA;AAC7B,IAAA,KAAA,GAAQ,UAAA,CAAW,KAAA;AAAA,EACrB;AAEA,EAAA,IAAI,OAAA,GAA8B,MAAA;AAClC,EAAA,IAAI,QAAQ,SAAA,EAAW;AACrB,IAAA,OAAA,GAAU,OAAA,CAAQ,SAAA;AAAA,EACpB,WAAW,OAAA,CAAQ,MAAA,IAAU,OAAA,CAAQ,MAAA,CAAO,SAAS,CAAA,EAAG;AACtD,IAAA,MAAM,CAAC,UAAU,CAAA,GAAI,OAAA,CAAQ,MAAA;AAC7B,IAAA,OAAA,GAAU,UAAA,CAAW,KAAA;AAAA,EACvB;AAEA,EAAA,IAAI,WAAA,GACF,OAAA,CAAQ,WAAA,IAAe,OAAA,CAAQ,YAAY,OAAA,CAAQ,EAAA;AAErD,EAAA,IAAA,CAAK,CAAC,KAAA,IAAS,CAAC,OAAA,IAAW,CAAC,gBAAgB,OAAA,EAAS;AACnD,IAAA,IAAI;AACF,MA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IAAA,IAAI,gBAAA,EAAkB;AACpB,MAAA,OAAOC,iBAAA,CAAO,gBAAgB,gBAAgB,CAAA;AAAA,IAChD;AAEA,IAAA,MAAM,UAAkB,MAAM,KAAA;AAAA,MAC5B,CAAA,EAAG,qBAAqB,MAAM,CAAC,IAAI,kBAAA,CAAmB,MAAA,CAAO,GAAG,CAAC,CAAA;AAAA,KACnE,CAAE,IAAA,CAAK,CAAA,QAAA,KAAY,QAAA,CAAS,MAAM,CAAA;AAElC,IAAA,MAAM,QAAA,GAAWA,iBAAA,CAAO,eAAA,CAAgB,OAAO,CAAA;AAC/C,IAAA,QAAA,CAAS,GAAA,CAAI,MAAA,CAAO,GAAA,EAAK,QAAA,CAAS,MAAA,CAAO,EAAE,MAAA,EAAQ,KAAA,EAAO,IAAA,EAAM,MAAA,EAAQ,CAAC,CAAA;AACzE,IAAA,OAAO,QAAA;AAAA,EACT,CAAA;AACF;;;;;"}
1
+ {"version":3,"file":"helpers.cjs.js","sources":["../src/helpers.ts"],"sourcesContent":["/*\n * Copyright 2023 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { KeyObject } from 'node:crypto';\nimport * as crypto from 'node:crypto';\nimport { JWTHeaderParameters, decodeJwt } from 'jose';\nimport NodeCache from 'node-cache';\nimport { PassportProfile, ProfileInfo } from '@backstage/plugin-auth-node';\nimport { AuthenticationError } from '@backstage/errors';\n\nexport const makeProfileInfo = (\n profile: PassportProfile,\n idToken?: string,\n): ProfileInfo => {\n let email: string | undefined = undefined;\n if (profile.emails && profile.emails.length > 0) {\n const [firstEmail] = profile.emails;\n email = firstEmail.value;\n }\n\n let picture: string | undefined = undefined;\n if (profile.avatarUrl) {\n picture = profile.avatarUrl;\n } else if (profile.photos && profile.photos.length > 0) {\n const [firstPhoto] = profile.photos;\n picture = firstPhoto.value;\n }\n\n let displayName: string | undefined =\n profile.displayName ?? profile.username ?? profile.id;\n\n if ((!email || !picture || !displayName) && idToken) {\n try {\n const decoded: Record<string, string> = decodeJwt(idToken) as {\n email?: string;\n picture?: string;\n name?: string;\n };\n if (!email && decoded.email) {\n email = decoded.email;\n }\n if (!picture && decoded.picture) {\n picture = decoded.picture;\n }\n if (!displayName && decoded.name) {\n displayName = decoded.name;\n }\n } catch (e) {\n throw new Error(`Failed to parse id token and get profile info, ${e}`);\n }\n }\n\n return {\n email,\n picture,\n displayName,\n };\n};\n\nconst getPublicKeyEndpoint = (region: string) => {\n if (region.startsWith('us-gov')) {\n return `https://s3-${encodeURIComponent(\n region,\n )}.amazonaws.com/aws-elb-public-keys-prod-${encodeURIComponent(region)}`;\n }\n\n return `https://public-keys.auth.elb.${encodeURIComponent(\n region,\n )}.amazonaws.com`;\n};\n\nexport const provisionKeyCache = (region: string, keyCache: NodeCache) => {\n return async (header: JWTHeaderParameters): Promise<KeyObject> => {\n if (!header.kid) {\n throw new AuthenticationError('No key id was specified in header');\n }\n const optionalCacheKey = keyCache.get<KeyObject>(header.kid);\n if (optionalCacheKey) {\n return crypto.createPublicKey(optionalCacheKey);\n }\n\n const keyText: string = await fetch(\n `${getPublicKeyEndpoint(region)}/${encodeURIComponent(header.kid)}`,\n ).then(response => response.text());\n\n const keyValue = crypto.createPublicKey(keyText);\n keyCache.set(header.kid, keyValue.export({ format: 'pem', type: 'spki' }));\n return keyValue;\n };\n};\n"],"names":["decodeJwt","AuthenticationError","crypto"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAuBO,MAAM,eAAA,GAAkB,CAC7B,OAAA,EACA,OAAA,KACgB;AAChB,EAAA,IAAI,KAAA,GAA4B,MAAA;AAChC,EAAA,IAAI,OAAA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AACzE,IAAA,OAAO,QAAA;AAAA,EACT,CAAA;AACF;;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@backstage/plugin-auth-backend-module-aws-alb-provider",
3
- "version": "0.0.0-nightly-20260127025640",
3
+ "version": "0.0.0-nightly-20260129030729",
4
4
  "description": "The aws-alb provider module for the Backstage auth backend.",
5
5
  "backstage": {
6
6
  "role": "backend-plugin-module",
@@ -40,17 +40,17 @@
40
40
  "test": "backstage-cli package test"
41
41
  },
42
42
  "dependencies": {
43
- "@backstage/backend-plugin-api": "0.0.0-nightly-20260127025640",
43
+ "@backstage/backend-plugin-api": "0.0.0-nightly-20260129030729",
44
44
  "@backstage/errors": "1.2.7",
45
- "@backstage/plugin-auth-backend": "0.0.0-nightly-20260127025640",
46
- "@backstage/plugin-auth-node": "0.0.0-nightly-20260127025640",
45
+ "@backstage/plugin-auth-backend": "0.0.0-nightly-20260129030729",
46
+ "@backstage/plugin-auth-node": "0.0.0-nightly-20260129030729",
47
47
  "jose": "^5.0.0",
48
48
  "node-cache": "^5.1.2",
49
49
  "zod": "^3.25.76"
50
50
  },
51
51
  "devDependencies": {
52
- "@backstage/backend-test-utils": "0.0.0-nightly-20260127025640",
53
- "@backstage/cli": "0.0.0-nightly-20260127025640",
52
+ "@backstage/backend-test-utils": "0.0.0-nightly-20260129030729",
53
+ "@backstage/cli": "0.0.0-nightly-20260129030729",
54
54
  "@backstage/config": "1.3.6",
55
55
  "@backstage/types": "1.2.2",
56
56
  "express": "^4.22.0",