@backstage/plugin-auth-backend-module-aws-alb-provider 0.1.9-next.0 → 0.1.9

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,36 @@
1
1
  # @backstage/plugin-auth-backend-module-aws-alb-provider
2
2
 
3
+ ## 0.1.9
4
+
5
+ ### Patch Changes
6
+
7
+ - f286d59: Added support for AWS GovCloud (US) regions
8
+ - 30f5a51: Added `authModuleAwsAlbProvider` as a default export.
9
+
10
+ It can now be used like this in your backend: `backend.add(import('@backstage/plugin-auth-backend-module-aws-alb-provider'));`
11
+
12
+ - Updated dependencies
13
+ - @backstage/backend-common@0.21.7
14
+ - @backstage/plugin-auth-backend@0.22.4
15
+ - @backstage/backend-plugin-api@0.6.17
16
+ - @backstage/plugin-auth-node@0.4.12
17
+ - @backstage/errors@1.2.4
18
+
19
+ ## 0.1.9-next.1
20
+
21
+ ### Patch Changes
22
+
23
+ - 30f5a51: Added `authModuleAwsAlbProvider` as a default export.
24
+
25
+ It can now be used like this in your backend: `backend.add(import('@backstage/plugin-auth-backend-module-aws-alb-provider'));`
26
+
27
+ - Updated dependencies
28
+ - @backstage/backend-common@0.21.7-next.1
29
+ - @backstage/plugin-auth-backend@0.22.4-next.1
30
+ - @backstage/backend-plugin-api@0.6.17-next.1
31
+ - @backstage/plugin-auth-node@0.4.12-next.1
32
+ - @backstage/errors@1.2.4
33
+
3
34
  ## 0.1.9-next.0
4
35
 
5
36
  ### Patch Changes
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Auth Module: AWS ALB Provider
2
2
 
3
- This module provides an GitHub auth provider implementation for `@backstage/plugin-auth-backend`.
3
+ This module provides an AWS application load balancer auth provider implementation for `@backstage/plugin-auth-backend`.
4
4
 
5
5
  ## Links
6
6
 
package/dist/index.cjs.js CHANGED
@@ -1,5 +1,7 @@
1
1
  'use strict';
2
2
 
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
3
5
  var errors = require('@backstage/errors');
4
6
  var jose = require('jose');
5
7
  var pluginAuthNode = require('@backstage/plugin-auth-node');
@@ -69,6 +71,16 @@ const makeProfileInfo = (profile, idToken) => {
69
71
  displayName
70
72
  };
71
73
  };
74
+ const getPublicKeyEndpoint = (region) => {
75
+ if (region.startsWith("us-gov")) {
76
+ return `https://s3-${encodeURIComponent(
77
+ region
78
+ )}.amazonaws.com/aws-elb-public-keys-prod-${encodeURIComponent(region)}`;
79
+ }
80
+ return `https://public-keys.auth.elb.${encodeURIComponent(
81
+ region
82
+ )}.amazonaws.com`;
83
+ };
72
84
  const provisionKeyCache = (region, keyCache) => {
73
85
  return async (header) => {
74
86
  if (!header.kid) {
@@ -79,9 +91,7 @@ const provisionKeyCache = (region, keyCache) => {
79
91
  return crypto__namespace.createPublicKey(optionalCacheKey);
80
92
  }
81
93
  const keyText = await fetch__default.default(
82
- `https://public-keys.auth.elb.${encodeURIComponent(
83
- region
84
- )}.amazonaws.com/${encodeURIComponent(header.kid)}`
94
+ `${getPublicKeyEndpoint(region)}/${encodeURIComponent(header.kid)}`
85
95
  ).then((response) => response.text());
86
96
  const keyValue = crypto__namespace.createPublicKey(keyText);
87
97
  keyCache.set(header.kid, keyValue.export({ format: "pem", type: "spki" }));
@@ -199,4 +209,5 @@ const authModuleAwsAlbProvider = backendPluginApi.createBackendModule({
199
209
 
200
210
  exports.authModuleAwsAlbProvider = authModuleAwsAlbProvider;
201
211
  exports.awsAlbAuthenticator = awsAlbAuthenticator;
212
+ exports.default = authModuleAwsAlbProvider;
202
213
  //# sourceMappingURL=index.cjs.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs.js","sources":["../src/helpers.ts","../src/authenticator.ts","../src/resolvers.ts","../src/module.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 */\nimport { KeyObject } from 'crypto';\nimport * as crypto from 'crypto';\nimport { JWTHeaderParameters, decodeJwt } from 'jose';\nimport NodeCache from 'node-cache';\nimport fetch from 'node-fetch';\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\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 const keyText: string = await fetch(\n `https://public-keys.auth.elb.${encodeURIComponent(\n region,\n )}.amazonaws.com/${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","/*\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 { AuthenticationError } from '@backstage/errors';\nimport { AwsAlbClaims, AwsAlbResult } from './types';\nimport { jwtVerify } from 'jose';\nimport {\n PassportProfile,\n createProxyAuthenticator,\n} from '@backstage/plugin-auth-node';\nimport NodeCache from 'node-cache';\nimport { makeProfileInfo, provisionKeyCache } from './helpers';\n\nexport const ALB_JWT_HEADER = 'x-amzn-oidc-data';\nexport const ALB_ACCESS_TOKEN_HEADER = 'x-amzn-oidc-accesstoken';\n\n/** @public */\nexport const awsAlbAuthenticator = createProxyAuthenticator({\n defaultProfileTransform: async (result: AwsAlbResult) => {\n return {\n profile: makeProfileInfo(result.fullProfile, result.accessToken),\n };\n },\n initialize({ config }) {\n const issuer = config.getString('issuer');\n const region = config.getString('region');\n const keyCache = new NodeCache({ stdTTL: 3600 });\n const getKey = provisionKeyCache(region, keyCache);\n return { issuer, getKey };\n },\n async authenticate({ req }, { issuer, getKey }) {\n const jwt = req.header(ALB_JWT_HEADER);\n const accessToken = req.header(ALB_ACCESS_TOKEN_HEADER);\n\n if (jwt === undefined) {\n throw new AuthenticationError(\n `Missing ALB OIDC header: ${ALB_JWT_HEADER}`,\n );\n }\n\n if (accessToken === undefined) {\n throw new AuthenticationError(\n `Missing ALB OIDC header: ${ALB_ACCESS_TOKEN_HEADER}`,\n );\n }\n\n try {\n const verifyResult = await jwtVerify(jwt, getKey);\n const claims = verifyResult.payload as AwsAlbClaims;\n\n if (issuer && claims?.iss !== issuer) {\n throw new AuthenticationError('Issuer mismatch on JWT token');\n }\n\n const fullProfile: PassportProfile = {\n provider: 'unknown',\n id: claims.sub,\n displayName: claims.name,\n username: claims.email.split('@')[0].toLowerCase(),\n name: {\n familyName: claims.family_name,\n givenName: claims.given_name,\n },\n emails: [{ value: claims.email.toLowerCase() }],\n photos: [{ value: claims.picture }],\n };\n\n return {\n result: {\n fullProfile,\n accessToken: accessToken,\n expiresInSeconds: claims.exp,\n },\n providerInfo: {\n accessToken: accessToken,\n expiresInSeconds: claims.exp,\n },\n };\n } catch (e) {\n throw new Error(`Exception occurred during JWT processing: ${e}`);\n }\n },\n});\n","/*\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 {\n createSignInResolverFactory,\n SignInInfo,\n} from '@backstage/plugin-auth-node';\nimport { AwsAlbResult } from './types';\n/**\n * Available sign-in resolvers for the Google auth provider.\n *\n * @public\n */\nexport namespace awsAlbSignInResolvers {\n export const emailMatchingUserEntityProfileEmail =\n createSignInResolverFactory({\n create() {\n return async (info: SignInInfo<AwsAlbResult>, ctx) => {\n if (!info.result.fullProfile.emails) {\n throw new Error(\n 'Login failed, user profile does not contain an email',\n );\n }\n return ctx.signInWithCatalogUser({\n filter: {\n kind: ['User'],\n 'spec.profile.email': info.result.fullProfile.emails[0].value,\n },\n });\n };\n },\n });\n}\n","/*\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 */\nimport { createBackendModule } from '@backstage/backend-plugin-api';\nimport {\n authProvidersExtensionPoint,\n commonSignInResolvers,\n createProxyAuthProviderFactory,\n} from '@backstage/plugin-auth-node';\nimport { awsAlbAuthenticator } from './authenticator';\nimport { awsAlbSignInResolvers } from './resolvers';\n\n/** @public */\nexport const authModuleAwsAlbProvider = createBackendModule({\n pluginId: 'auth',\n moduleId: 'awsAlbProvider',\n register(reg) {\n reg.registerInit({\n deps: {\n providers: authProvidersExtensionPoint,\n },\n async init({ providers }) {\n providers.registerProvider({\n providerId: 'awsalb',\n factory: createProxyAuthProviderFactory({\n authenticator: awsAlbAuthenticator,\n signInResolverFactories: {\n ...commonSignInResolvers,\n ...awsAlbSignInResolvers,\n },\n }),\n });\n },\n });\n },\n});\n"],"names":["decodeJwt","AuthenticationError","crypto","fetch","createProxyAuthenticator","NodeCache","jwtVerify","awsAlbSignInResolvers","createSignInResolverFactory","createBackendModule","authProvidersExtensionPoint","createProxyAuthProviderFactory","commonSignInResolvers"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAuBa,MAAA,eAAA,GAAkB,CAC7B,OAAA,EACA,OACgB,KAAA;AA1BlB,EAAA,IAAA,EAAA,EAAA,EAAA,CAAA;AA2BE,EAAA,IAAI,KAA4B,GAAA,KAAA,CAAA,CAAA;AAChC,EAAA,IAAI,OAAQ,CAAA,MAAA,IAAU,OAAQ,CAAA,MAAA,CAAO,SAAS,CAAG,EAAA;AAC/C,IAAM,MAAA,CAAC,UAAU,CAAA,GAAI,OAAQ,CAAA,MAAA,CAAA;AAC7B,IAAA,KAAA,GAAQ,UAAW,CAAA,KAAA,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R,sDAAA;AAAA,WACF,CAAA;AAAA,SACF;AACA,QAAA,OAAO,IAAI,qBAAsB,CAAA;AAAA,UAC/B,MAAQ,EAAA;AAAA,YACN,IAAA,EAAM,CAAC,MAAM,CAAA;AAAA,YACb,sBAAsB,IAAK,CAAA,MAAA,CAAO,WAAY,CAAA,MAAA,CAAO,CAAC,CAAE,CAAA,KAAA;AAAA,WAC1D;AAAA,SACD,CAAA,CAAA;AAAA,OACH,CAAA;AAAA,KACF;AAAA,GACD,CAAA,CAAA;AAAA,CAlBY,EAAAD,6BAAA,KAAAA,6BAAA,GAAA,EAAA,CAAA,CAAA;;ACDV,MAAM,2BAA2BE,oCAAoB,CAAA;AAAA,EAC1D,QAAU,EAAA,MAAA;AAAA,EACV,QAAU,EAAA,gBAAA;AAAA,EACV,SAAS,GAAK,EAAA;AACZ,IAAA,GAAA,CAAI,YAAa,CAAA;AAAA,MACf,IAAM,EAAA;AAAA,QACJ,SAAW,EAAAC,0CAAA;AAAA,OACb;AAAA,MACA,MAAM,IAAA,CAAK,EAAE,SAAA,EAAa,EAAA;AACxB,QAAA,SAAA,CAAU,gBAAiB,CAAA;AAAA,UACzB,UAAY,EAAA,QAAA;AAAA,UACZ,SAASC,6CAA+B,CAAA;AAAA,YACtC,aAAe,EAAA,mBAAA;AAAA,YACf,uBAAyB,EAAA;AAAA,cACvB,GAAGC,oCAAA;AAAA,cACH,GAAGL,6BAAA;AAAA,aACL;AAAA,WACD,CAAA;AAAA,SACF,CAAA,CAAA;AAAA,OACH;AAAA,KACD,CAAA,CAAA;AAAA,GACH;AACF,CAAC;;;;;"}
1
+ {"version":3,"file":"index.cjs.js","sources":["../src/helpers.ts","../src/authenticator.ts","../src/resolvers.ts","../src/module.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 */\nimport { KeyObject } from 'crypto';\nimport * as crypto from 'crypto';\nimport { JWTHeaderParameters, decodeJwt } from 'jose';\nimport NodeCache from 'node-cache';\nimport fetch from 'node-fetch';\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","/*\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 { AuthenticationError } from '@backstage/errors';\nimport { AwsAlbClaims, AwsAlbResult } from './types';\nimport { jwtVerify } from 'jose';\nimport {\n PassportProfile,\n createProxyAuthenticator,\n} from '@backstage/plugin-auth-node';\nimport NodeCache from 'node-cache';\nimport { makeProfileInfo, provisionKeyCache } from './helpers';\n\nexport const ALB_JWT_HEADER = 'x-amzn-oidc-data';\nexport const ALB_ACCESS_TOKEN_HEADER = 'x-amzn-oidc-accesstoken';\n\n/** @public */\nexport const awsAlbAuthenticator = createProxyAuthenticator({\n defaultProfileTransform: async (result: AwsAlbResult) => {\n return {\n profile: makeProfileInfo(result.fullProfile, result.accessToken),\n };\n },\n initialize({ config }) {\n const issuer = config.getString('issuer');\n const region = config.getString('region');\n const keyCache = new NodeCache({ stdTTL: 3600 });\n const getKey = provisionKeyCache(region, keyCache);\n return { issuer, getKey };\n },\n async authenticate({ req }, { issuer, getKey }) {\n const jwt = req.header(ALB_JWT_HEADER);\n const accessToken = req.header(ALB_ACCESS_TOKEN_HEADER);\n\n if (jwt === undefined) {\n throw new AuthenticationError(\n `Missing ALB OIDC header: ${ALB_JWT_HEADER}`,\n );\n }\n\n if (accessToken === undefined) {\n throw new AuthenticationError(\n `Missing ALB OIDC header: ${ALB_ACCESS_TOKEN_HEADER}`,\n );\n }\n\n try {\n const verifyResult = await jwtVerify(jwt, getKey);\n const claims = verifyResult.payload as AwsAlbClaims;\n\n if (issuer && claims?.iss !== issuer) {\n throw new AuthenticationError('Issuer mismatch on JWT token');\n }\n\n const fullProfile: PassportProfile = {\n provider: 'unknown',\n id: claims.sub,\n displayName: claims.name,\n username: claims.email.split('@')[0].toLowerCase(),\n name: {\n familyName: claims.family_name,\n givenName: claims.given_name,\n },\n emails: [{ value: claims.email.toLowerCase() }],\n photos: [{ value: claims.picture }],\n };\n\n return {\n result: {\n fullProfile,\n accessToken: accessToken,\n expiresInSeconds: claims.exp,\n },\n providerInfo: {\n accessToken: accessToken,\n expiresInSeconds: claims.exp,\n },\n };\n } catch (e) {\n throw new Error(`Exception occurred during JWT processing: ${e}`);\n }\n },\n});\n","/*\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 {\n createSignInResolverFactory,\n SignInInfo,\n} from '@backstage/plugin-auth-node';\nimport { AwsAlbResult } from './types';\n/**\n * Available sign-in resolvers for the AWS ALB auth provider.\n *\n * @public\n */\nexport namespace awsAlbSignInResolvers {\n export const emailMatchingUserEntityProfileEmail =\n createSignInResolverFactory({\n create() {\n return async (info: SignInInfo<AwsAlbResult>, ctx) => {\n if (!info.result.fullProfile.emails) {\n throw new Error(\n 'Login failed, user profile does not contain an email',\n );\n }\n return ctx.signInWithCatalogUser({\n filter: {\n kind: ['User'],\n 'spec.profile.email': info.result.fullProfile.emails[0].value,\n },\n });\n };\n },\n });\n}\n","/*\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 */\nimport { createBackendModule } from '@backstage/backend-plugin-api';\nimport {\n authProvidersExtensionPoint,\n commonSignInResolvers,\n createProxyAuthProviderFactory,\n} from '@backstage/plugin-auth-node';\nimport { awsAlbAuthenticator } from './authenticator';\nimport { awsAlbSignInResolvers } from './resolvers';\n\n/** @public */\nexport const authModuleAwsAlbProvider = createBackendModule({\n pluginId: 'auth',\n moduleId: 'awsAlbProvider',\n register(reg) {\n reg.registerInit({\n deps: {\n providers: authProvidersExtensionPoint,\n },\n async init({ providers }) {\n providers.registerProvider({\n providerId: 'awsalb',\n factory: createProxyAuthProviderFactory({\n authenticator: awsAlbAuthenticator,\n signInResolverFactories: {\n ...commonSignInResolvers,\n ...awsAlbSignInResolvers,\n },\n }),\n });\n },\n });\n },\n});\n"],"names":["decodeJwt","AuthenticationError","crypto","fetch","createProxyAuthenticator","NodeCache","jwtVerify","awsAlbSignInResolvers","createSignInResolverFactory","createBackendModule","authProvidersExtensionPoint","createProxyAuthProviderFactory","commonSignInResolvers"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAuBa,MAAA,eAAA,GAAkB,CAC7B,OAAA,EACA,OACgB,KAAA;AA1BlB,EAAA,IAAA,EAAA,EAAA,EAAA,CAAA;AA2BE,EAAA,IAAI,KAA4B,GAAA,KAAA,CAAA,CAAA;AAChC,EAAA,IAAI,OAAQ,CAAA,MAAA,IAAU,OAAQ,C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,SAASC,6CAA+B,CAAA;AAAA,YACtC,aAAe,EAAA,mBAAA;AAAA,YACf,uBAAyB,EAAA;AAAA,cACvB,GAAGC,oCAAA;AAAA,cACH,GAAGL,6BAAA;AAAA,aACL;AAAA,WACD,CAAA;AAAA,SACF,CAAA,CAAA;AAAA,OACH;AAAA,KACD,CAAA,CAAA;AAAA,GACH;AACF,CAAC;;;;;;"}
package/dist/index.d.ts CHANGED
@@ -30,7 +30,7 @@ declare const awsAlbAuthenticator: _backstage_plugin_auth_node.ProxyAuthenticato
30
30
  declare const authModuleAwsAlbProvider: () => _backstage_backend_plugin_api.BackendFeature;
31
31
 
32
32
  /**
33
- * Available sign-in resolvers for the Google auth provider.
33
+ * Available sign-in resolvers for the AWS ALB auth provider.
34
34
  *
35
35
  * @public
36
36
  */
@@ -38,4 +38,4 @@ declare namespace awsAlbSignInResolvers {
38
38
  const emailMatchingUserEntityProfileEmail: _backstage_plugin_auth_node.SignInResolverFactory<AwsAlbResult, unknown>;
39
39
  }
40
40
 
41
- export { type AwsAlbResult, authModuleAwsAlbProvider, awsAlbAuthenticator, awsAlbSignInResolvers };
41
+ export { type AwsAlbResult, authModuleAwsAlbProvider, awsAlbAuthenticator, awsAlbSignInResolvers, authModuleAwsAlbProvider as default };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@backstage/plugin-auth-backend-module-aws-alb-provider",
3
3
  "description": "The aws-alb provider module for the Backstage auth backend.",
4
- "version": "0.1.9-next.0",
4
+ "version": "0.1.9",
5
5
  "main": "dist/index.cjs.js",
6
6
  "types": "dist/index.d.ts",
7
7
  "license": "Apache-2.0",
@@ -32,18 +32,18 @@
32
32
  "postpack": "backstage-cli package postpack"
33
33
  },
34
34
  "dependencies": {
35
- "@backstage/backend-common": "^0.21.7-next.0",
36
- "@backstage/backend-plugin-api": "^0.6.17-next.0",
35
+ "@backstage/backend-common": "^0.21.7",
36
+ "@backstage/backend-plugin-api": "^0.6.17",
37
37
  "@backstage/errors": "^1.2.4",
38
- "@backstage/plugin-auth-backend": "^0.22.4-next.0",
39
- "@backstage/plugin-auth-node": "^0.4.12-next.0",
38
+ "@backstage/plugin-auth-backend": "^0.22.4",
39
+ "@backstage/plugin-auth-node": "^0.4.12",
40
40
  "jose": "^5.0.0",
41
41
  "node-cache": "^5.1.2",
42
42
  "node-fetch": "^2.6.7"
43
43
  },
44
44
  "devDependencies": {
45
- "@backstage/backend-test-utils": "^0.3.7-next.0",
46
- "@backstage/cli": "^0.26.3-next.0",
45
+ "@backstage/backend-test-utils": "^0.3.7",
46
+ "@backstage/cli": "^0.26.3",
47
47
  "@backstage/config": "^1.2.0",
48
48
  "express": "^4.18.2",
49
49
  "msw": "^2.0.8"