@backstage/plugin-auth-backend 0.24.5 → 0.25.0-next.0

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.
Files changed (78) hide show
  1. package/CHANGELOG.md +19 -0
  2. package/config.d.ts +0 -58
  3. package/dist/authPlugin.cjs.js +4 -8
  4. package/dist/authPlugin.cjs.js.map +1 -1
  5. package/dist/database/AuthDatabase.cjs.js +0 -16
  6. package/dist/database/AuthDatabase.cjs.js.map +1 -1
  7. package/dist/index.cjs.js +0 -26
  8. package/dist/index.cjs.js.map +1 -1
  9. package/dist/index.d.ts +1 -850
  10. package/dist/lib/catalog/CatalogIdentityClient.cjs.js +11 -20
  11. package/dist/lib/catalog/CatalogIdentityClient.cjs.js.map +1 -1
  12. package/dist/lib/resolvers/CatalogAuthResolverContext.cjs.js +14 -17
  13. package/dist/lib/resolvers/CatalogAuthResolverContext.cjs.js.map +1 -1
  14. package/dist/providers/router.cjs.js +2 -9
  15. package/dist/providers/router.cjs.js.map +1 -1
  16. package/dist/service/router.cjs.js +5 -16
  17. package/dist/service/router.cjs.js.map +1 -1
  18. package/package.json +15 -58
  19. package/dist/lib/flow/authFlowHelpers.cjs.js +0 -43
  20. package/dist/lib/flow/authFlowHelpers.cjs.js.map +0 -1
  21. package/dist/lib/legacy/adaptLegacyOAuthHandler.cjs.js +0 -20
  22. package/dist/lib/legacy/adaptLegacyOAuthHandler.cjs.js.map +0 -1
  23. package/dist/lib/legacy/adaptLegacyOAuthSignInResolver.cjs.js +0 -24
  24. package/dist/lib/legacy/adaptLegacyOAuthSignInResolver.cjs.js.map +0 -1
  25. package/dist/lib/legacy/adaptOAuthSignInResolverToLegacy.cjs.js +0 -29
  26. package/dist/lib/legacy/adaptOAuthSignInResolverToLegacy.cjs.js.map +0 -1
  27. package/dist/lib/oauth/OAuthAdapter.cjs.js +0 -220
  28. package/dist/lib/oauth/OAuthAdapter.cjs.js.map +0 -1
  29. package/dist/lib/oauth/OAuthEnvironmentHandler.cjs.js +0 -8
  30. package/dist/lib/oauth/OAuthEnvironmentHandler.cjs.js.map +0 -1
  31. package/dist/lib/oauth/helpers.cjs.js +0 -40
  32. package/dist/lib/oauth/helpers.cjs.js.map +0 -1
  33. package/dist/lib/passport/PassportStrategyHelper.cjs.js +0 -49
  34. package/dist/lib/passport/PassportStrategyHelper.cjs.js.map +0 -1
  35. package/dist/providers/atlassian/provider.cjs.js +0 -20
  36. package/dist/providers/atlassian/provider.cjs.js.map +0 -1
  37. package/dist/providers/auth0/provider.cjs.js +0 -20
  38. package/dist/providers/auth0/provider.cjs.js.map +0 -1
  39. package/dist/providers/aws-alb/provider.cjs.js +0 -18
  40. package/dist/providers/aws-alb/provider.cjs.js.map +0 -1
  41. package/dist/providers/azure-easyauth/provider.cjs.js +0 -18
  42. package/dist/providers/azure-easyauth/provider.cjs.js.map +0 -1
  43. package/dist/providers/bitbucket/provider.cjs.js +0 -25
  44. package/dist/providers/bitbucket/provider.cjs.js.map +0 -1
  45. package/dist/providers/bitbucketServer/provider.cjs.js +0 -46
  46. package/dist/providers/bitbucketServer/provider.cjs.js.map +0 -1
  47. package/dist/providers/cloudflare-access/provider.cjs.js +0 -22
  48. package/dist/providers/cloudflare-access/provider.cjs.js.map +0 -1
  49. package/dist/providers/createAuthProviderIntegration.cjs.js +0 -11
  50. package/dist/providers/createAuthProviderIntegration.cjs.js.map +0 -1
  51. package/dist/providers/gcp-iap/provider.cjs.js +0 -18
  52. package/dist/providers/gcp-iap/provider.cjs.js.map +0 -1
  53. package/dist/providers/github/provider.cjs.js +0 -61
  54. package/dist/providers/github/provider.cjs.js.map +0 -1
  55. package/dist/providers/gitlab/provider.cjs.js +0 -20
  56. package/dist/providers/gitlab/provider.cjs.js.map +0 -1
  57. package/dist/providers/google/provider.cjs.js +0 -26
  58. package/dist/providers/google/provider.cjs.js.map +0 -1
  59. package/dist/providers/microsoft/provider.cjs.js +0 -27
  60. package/dist/providers/microsoft/provider.cjs.js.map +0 -1
  61. package/dist/providers/oauth2/provider.cjs.js +0 -20
  62. package/dist/providers/oauth2/provider.cjs.js.map +0 -1
  63. package/dist/providers/oauth2-proxy/provider.cjs.js +0 -18
  64. package/dist/providers/oauth2-proxy/provider.cjs.js.map +0 -1
  65. package/dist/providers/oidc/provider.cjs.js +0 -37
  66. package/dist/providers/oidc/provider.cjs.js.map +0 -1
  67. package/dist/providers/okta/provider.cjs.js +0 -47
  68. package/dist/providers/okta/provider.cjs.js.map +0 -1
  69. package/dist/providers/onelogin/provider.cjs.js +0 -20
  70. package/dist/providers/onelogin/provider.cjs.js.map +0 -1
  71. package/dist/providers/prepareBackstageIdentityResponse.cjs.js +0 -8
  72. package/dist/providers/prepareBackstageIdentityResponse.cjs.js.map +0 -1
  73. package/dist/providers/providers.cjs.js +0 -62
  74. package/dist/providers/providers.cjs.js.map +0 -1
  75. package/dist/providers/resolvers.cjs.js +0 -27
  76. package/dist/providers/resolvers.cjs.js.map +0 -1
  77. package/dist/providers/saml/provider.cjs.js +0 -121
  78. package/dist/providers/saml/provider.cjs.js.map +0 -1
@@ -1,46 +0,0 @@
1
- 'use strict';
2
-
3
- var pluginAuthNode = require('@backstage/plugin-auth-node');
4
- var pluginAuthBackendModuleBitbucketServerProvider = require('@backstage/plugin-auth-backend-module-bitbucket-server-provider');
5
- var adaptLegacyOAuthHandler = require('../../lib/legacy/adaptLegacyOAuthHandler.cjs.js');
6
- var adaptLegacyOAuthSignInResolver = require('../../lib/legacy/adaptLegacyOAuthSignInResolver.cjs.js');
7
- var createAuthProviderIntegration = require('../createAuthProviderIntegration.cjs.js');
8
-
9
- const bitbucketServer = createAuthProviderIntegration.createAuthProviderIntegration({
10
- create(options) {
11
- return pluginAuthNode.createOAuthProviderFactory({
12
- authenticator: pluginAuthBackendModuleBitbucketServerProvider.bitbucketServerAuthenticator,
13
- profileTransform: adaptLegacyOAuthHandler.adaptLegacyOAuthHandler(options?.authHandler),
14
- signInResolver: adaptLegacyOAuthSignInResolver.adaptLegacyOAuthSignInResolver(options?.signIn?.resolver)
15
- });
16
- },
17
- resolvers: {
18
- /**
19
- * Looks up the user by matching their email to the entity email.
20
- */
21
- emailMatchingUserEntityProfileEmail: () => {
22
- const resolver = pluginAuthBackendModuleBitbucketServerProvider.bitbucketServerSignInResolvers.emailMatchingUserEntityProfileEmail();
23
- return async (info, ctx) => {
24
- return resolver(
25
- {
26
- profile: info.profile,
27
- result: {
28
- fullProfile: info.result.fullProfile,
29
- session: {
30
- accessToken: info.result.accessToken,
31
- tokenType: info.result.params.token_type ?? "bearer",
32
- scope: info.result.params.scope,
33
- expiresInSeconds: info.result.params.expires_in,
34
- refreshToken: info.result.refreshToken
35
- }
36
- }
37
- },
38
- ctx
39
- );
40
- };
41
- }
42
- }
43
- });
44
-
45
- exports.bitbucketServer = bitbucketServer;
46
- //# sourceMappingURL=provider.cjs.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"provider.cjs.js","sources":["../../../src/providers/bitbucketServer/provider.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 { Profile as PassportProfile } from 'passport';\nimport {\n AuthResolverContext,\n createOAuthProviderFactory,\n SignInResolver,\n} from '@backstage/plugin-auth-node';\nimport {\n bitbucketServerAuthenticator,\n bitbucketServerSignInResolvers,\n} from '@backstage/plugin-auth-backend-module-bitbucket-server-provider';\nimport { OAuthProviderOptions } from '../../lib/oauth';\nimport {\n adaptLegacyOAuthHandler,\n adaptLegacyOAuthSignInResolver,\n} from '../../lib/legacy';\nimport { AuthHandler } from '../types';\nimport { createAuthProviderIntegration } from '../createAuthProviderIntegration';\n\n/**\n * @public\n * @deprecated The Bitbucket Server auth provider was extracted to `@backstage/plugin-auth-backend-module-bitbucket-server-provider`.\n */\nexport type BitbucketServerOAuthResult = {\n fullProfile: PassportProfile;\n params: {\n scope: string;\n access_token?: string;\n token_type?: string;\n expires_in?: number;\n };\n accessToken: string;\n refreshToken?: string;\n};\n\n/**\n * @public\n * @deprecated The Bitbucket Server auth provider was extracted to `@backstage/plugin-auth-backend-module-bitbucket-server-provider`.\n */\nexport type BitbucketServerAuthProviderOptions = OAuthProviderOptions & {\n host: string;\n authorizationUrl: string;\n tokenUrl: string;\n authHandler: AuthHandler<BitbucketServerOAuthResult>;\n signInResolver?: SignInResolver<BitbucketServerOAuthResult>;\n resolverContext: AuthResolverContext;\n};\n\nexport const bitbucketServer = createAuthProviderIntegration({\n create(options?: {\n /**\n * The profile transformation function used to verify and convert the auth response\n * into the profile that will be presented to the user.\n */\n authHandler?: AuthHandler<BitbucketServerOAuthResult>;\n\n /**\n * Configure sign-in for this provider, without it the provider can not be used to sign users in.\n */\n signIn?: {\n /**\n * Maps an auth result to a Backstage identity for the user.\n */\n resolver: SignInResolver<BitbucketServerOAuthResult>;\n };\n }) {\n return createOAuthProviderFactory({\n authenticator: bitbucketServerAuthenticator,\n profileTransform: adaptLegacyOAuthHandler(options?.authHandler),\n signInResolver: adaptLegacyOAuthSignInResolver(options?.signIn?.resolver),\n });\n },\n resolvers: {\n /**\n * Looks up the user by matching their email to the entity email.\n */\n emailMatchingUserEntityProfileEmail:\n (): SignInResolver<BitbucketServerOAuthResult> => {\n const resolver =\n bitbucketServerSignInResolvers.emailMatchingUserEntityProfileEmail();\n return async (info, ctx) => {\n return resolver(\n {\n profile: info.profile,\n result: {\n fullProfile: info.result.fullProfile,\n session: {\n accessToken: info.result.accessToken,\n tokenType: info.result.params.token_type ?? 'bearer',\n scope: info.result.params.scope,\n expiresInSeconds: info.result.params.expires_in,\n refreshToken: info.result.refreshToken,\n },\n },\n },\n ctx,\n );\n };\n },\n },\n});\n"],"names":["createAuthProviderIntegration","createOAuthProviderFactory","bitbucketServerAuthenticator","adaptLegacyOAuthHandler","adaptLegacyOAuthSignInResolver","bitbucketServerSignInResolvers"],"mappings":";;;;;;;;AA+DO,MAAM,kBAAkBA,2DAA8B,CAAA;AAAA,EAC3D,OAAO,OAgBJ,EAAA;AACD,IAAA,OAAOC,yCAA2B,CAAA;AAAA,MAChC,aAAe,EAAAC,2EAAA;AAAA,MACf,gBAAA,EAAkBC,+CAAwB,CAAA,OAAA,EAAS,WAAW,CAAA;AAAA,MAC9D,cAAgB,EAAAC,6DAAA,CAA+B,OAAS,EAAA,MAAA,EAAQ,QAAQ;AAAA,KACzE,CAAA;AAAA,GACH;AAAA,EACA,SAAW,EAAA;AAAA;AAAA;AAAA;AAAA,IAIT,qCACE,MAAkD;AAChD,MAAM,MAAA,QAAA,GACJC,8EAA+B,mCAAoC,EAAA;AACrE,MAAO,OAAA,OAAO,MAAM,GAAQ,KAAA;AAC1B,QAAO,OAAA,QAAA;AAAA,UACL;AAAA,YACE,SAAS,IAAK,CAAA,OAAA;AAAA,YACd,MAAQ,EAAA;AAAA,cACN,WAAA,EAAa,KAAK,MAAO,CAAA,WAAA;AAAA,cACzB,OAAS,EAAA;AAAA,gBACP,WAAA,EAAa,KAAK,MAAO,CAAA,WAAA;AAAA,gBACzB,SAAW,EAAA,IAAA,CAAK,MAAO,CAAA,MAAA,CAAO,UAAc,IAAA,QAAA;AAAA,gBAC5C,KAAA,EAAO,IAAK,CAAA,MAAA,CAAO,MAAO,CAAA,KAAA;AAAA,gBAC1B,gBAAA,EAAkB,IAAK,CAAA,MAAA,CAAO,MAAO,CAAA,UAAA;AAAA,gBACrC,YAAA,EAAc,KAAK,MAAO,CAAA;AAAA;AAC5B;AACF,WACF;AAAA,UACA;AAAA,SACF;AAAA,OACF;AAAA;AACF;AAEN,CAAC;;;;"}
@@ -1,22 +0,0 @@
1
- 'use strict';
2
-
3
- var pluginAuthBackendModuleCloudflareAccessProvider = require('@backstage/plugin-auth-backend-module-cloudflare-access-provider');
4
- var pluginAuthNode = require('@backstage/plugin-auth-node');
5
- var createAuthProviderIntegration = require('../createAuthProviderIntegration.cjs.js');
6
-
7
- const cfAccess = createAuthProviderIntegration.createAuthProviderIntegration({
8
- create(options) {
9
- return pluginAuthNode.createProxyAuthProviderFactory({
10
- authenticator: pluginAuthBackendModuleCloudflareAccessProvider.createCloudflareAccessAuthenticator({
11
- cache: options.cache
12
- }),
13
- profileTransform: options?.authHandler,
14
- signInResolver: options?.signIn?.resolver,
15
- signInResolverFactories: pluginAuthBackendModuleCloudflareAccessProvider.cloudflareAccessSignInResolvers
16
- });
17
- },
18
- resolvers: pluginAuthBackendModuleCloudflareAccessProvider.cloudflareAccessSignInResolvers
19
- });
20
-
21
- exports.cfAccess = cfAccess;
22
- //# sourceMappingURL=provider.cjs.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"provider.cjs.js","sources":["../../../src/providers/cloudflare-access/provider.ts"],"sourcesContent":["/*\n * Copyright 2022 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 cloudflareAccessSignInResolvers,\n createCloudflareAccessAuthenticator,\n} from '@backstage/plugin-auth-backend-module-cloudflare-access-provider';\nimport {\n SignInResolver,\n createProxyAuthProviderFactory,\n} from '@backstage/plugin-auth-node';\nimport { createAuthProviderIntegration } from '../createAuthProviderIntegration';\nimport { AuthHandler } from '../types';\nimport { CacheService } from '@backstage/backend-plugin-api';\n\n/**\n * CloudflareAccessClaims\n *\n * Can be used in externally provided auth handler or sign in resolver to\n * enrich user profile for sign-in user entity\n *\n * @public\n * @deprecated import from `@backstage/plugin-auth-backend-module-cloudflare-access-provider` instead\n */\nexport type CloudflareAccessClaims = {\n /**\n * `aud` identifies the application to which the JWT is issued.\n */\n aud: string[];\n /**\n * `email` contains the email address of the authenticated user.\n */\n email: string;\n /**\n * iat and exp are the issuance and expiration timestamps.\n */\n exp: number;\n iat: number;\n /**\n * `nonce` is the session identifier.\n */\n nonce: string;\n /**\n * `identity_nonce` is available in the Application Token and can be used to\n * query all group membership for a given user.\n */\n identity_nonce: string;\n /**\n * `sub` contains the identifier of the authenticated user.\n */\n sub: string;\n /**\n * `iss` the issuer is the application’s Cloudflare Access Domain URL.\n */\n iss: string;\n /**\n * `custom` contains SAML attributes in the Application Token specified by an\n * administrator in the identity provider configuration.\n */\n custom: string;\n};\n\n/**\n * CloudflareAccessGroup\n *\n * @public\n * @deprecated import from `@backstage/plugin-auth-backend-module-cloudflare-access-provider` instead\n */\nexport type CloudflareAccessGroup = {\n /**\n * Group id\n */\n id: string;\n /**\n * Name of group as defined in Cloudflare zero trust dashboard\n */\n name: string;\n /**\n * Access group email address\n */\n email: string;\n};\n\n/**\n * CloudflareAccessIdentityProfile\n *\n * Can be used in externally provided auth handler or sign in resolver to\n * enrich user profile for sign-in user entity\n *\n * @public\n * @deprecated import from `@backstage/plugin-auth-backend-module-cloudflare-access-provider` instead\n */\nexport type CloudflareAccessIdentityProfile = {\n id: string;\n name: string;\n email: string;\n groups: CloudflareAccessGroup[];\n};\n\n/**\n * @public\n * @deprecated import from `@backstage/plugin-auth-backend-module-cloudflare-access-provider` instead\n */\nexport type CloudflareAccessResult = {\n claims: CloudflareAccessClaims;\n cfIdentity: CloudflareAccessIdentityProfile;\n expiresInSeconds?: number;\n token: string;\n};\n\n/**\n * Auth provider integration for Cloudflare Access auth\n *\n * @public\n * @deprecated Migrate the auth plugin to the new backend system https://backstage.io/docs/backend-system/building-backends/migrating#the-auth-plugin\n */\nexport const cfAccess = createAuthProviderIntegration({\n create(options: {\n /**\n * The profile transformation function used to verify and convert the auth response\n * into the profile that will be presented to the user.\n */\n authHandler?: AuthHandler<CloudflareAccessResult>;\n\n /**\n * Configure sign-in for this provider, without it the provider can not be used to sign users in.\n */\n signIn: {\n /**\n * Maps an auth result to a Backstage identity for the user.\n */\n resolver: SignInResolver<CloudflareAccessResult>;\n };\n\n /**\n * Cache service object that was configured for the Backstage backend,\n * should be provided via the backend auth plugin.\n */\n cache?: CacheService;\n }) {\n return createProxyAuthProviderFactory({\n authenticator: createCloudflareAccessAuthenticator({\n cache: options.cache,\n }),\n profileTransform: options?.authHandler,\n signInResolver: options?.signIn?.resolver,\n signInResolverFactories: cloudflareAccessSignInResolvers,\n });\n },\n resolvers: cloudflareAccessSignInResolvers,\n});\n"],"names":["createAuthProviderIntegration","createProxyAuthProviderFactory","createCloudflareAccessAuthenticator","cloudflareAccessSignInResolvers"],"mappings":";;;;;;AAiIO,MAAM,WAAWA,2DAA8B,CAAA;AAAA,EACpD,OAAO,OAsBJ,EAAA;AACD,IAAA,OAAOC,6CAA+B,CAAA;AAAA,MACpC,eAAeC,mFAAoC,CAAA;AAAA,QACjD,OAAO,OAAQ,CAAA;AAAA,OAChB,CAAA;AAAA,MACD,kBAAkB,OAAS,EAAA,WAAA;AAAA,MAC3B,cAAA,EAAgB,SAAS,MAAQ,EAAA,QAAA;AAAA,MACjC,uBAAyB,EAAAC;AAAA,KAC1B,CAAA;AAAA,GACH;AAAA,EACA,SAAW,EAAAA;AACb,CAAC;;;;"}
@@ -1,11 +0,0 @@
1
- 'use strict';
2
-
3
- function createAuthProviderIntegration(config) {
4
- return Object.freeze({
5
- ...config,
6
- resolvers: Object.freeze(config.resolvers ?? {})
7
- });
8
- }
9
-
10
- exports.createAuthProviderIntegration = createAuthProviderIntegration;
11
- //# sourceMappingURL=createAuthProviderIntegration.cjs.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"createAuthProviderIntegration.cjs.js","sources":["../../src/providers/createAuthProviderIntegration.ts"],"sourcesContent":["/*\n * Copyright 2022 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 AuthProviderFactory,\n SignInResolver,\n} from '@backstage/plugin-auth-node';\n\n/**\n * Creates a standardized representation of an integration with a third-party\n * auth provider.\n *\n * The returned object facilitates the creation of provider instances, and\n * supplies built-in sign-in resolvers for the specific provider.\n *\n * @public\n * @deprecated Migrate the auth plugin to the new backend system https://backstage.io/docs/backend-system/building-backends/migrating#the-auth-plugin\n */\nexport function createAuthProviderIntegration<\n TCreateOptions extends unknown[],\n TResolvers extends\n | {\n [name in string]: (...args: any[]) => SignInResolver<any>;\n },\n>(config: {\n create: (...args: TCreateOptions) => AuthProviderFactory;\n resolvers?: TResolvers;\n}): Readonly<{\n create: (...args: TCreateOptions) => AuthProviderFactory;\n // If no resolvers are defined, this receives the type `never`\n resolvers: Readonly<string extends keyof TResolvers ? never : TResolvers>;\n}> {\n return Object.freeze({\n ...config,\n resolvers: Object.freeze(config.resolvers ?? ({} as any)),\n });\n}\n"],"names":[],"mappings":";;AA+BO,SAAS,8BAMd,MAOC,EAAA;AACD,EAAA,OAAO,OAAO,MAAO,CAAA;AAAA,IACnB,GAAG,MAAA;AAAA,IACH,WAAW,MAAO,CAAA,MAAA,CAAO,MAAO,CAAA,SAAA,IAAc,EAAU;AAAA,GACzD,CAAA;AACH;;;;"}
@@ -1,18 +0,0 @@
1
- 'use strict';
2
-
3
- var pluginAuthBackendModuleGcpIapProvider = require('@backstage/plugin-auth-backend-module-gcp-iap-provider');
4
- var pluginAuthNode = require('@backstage/plugin-auth-node');
5
- var createAuthProviderIntegration = require('../createAuthProviderIntegration.cjs.js');
6
-
7
- const gcpIap = createAuthProviderIntegration.createAuthProviderIntegration({
8
- create(options) {
9
- return pluginAuthNode.createProxyAuthProviderFactory({
10
- authenticator: pluginAuthBackendModuleGcpIapProvider.gcpIapAuthenticator,
11
- profileTransform: options?.authHandler,
12
- signInResolver: options?.signIn?.resolver
13
- });
14
- }
15
- });
16
-
17
- exports.gcpIap = gcpIap;
18
- //# sourceMappingURL=provider.cjs.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"provider.cjs.js","sources":["../../../src/providers/gcp-iap/provider.ts"],"sourcesContent":["/*\n * Copyright 2021 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 { gcpIapAuthenticator } from '@backstage/plugin-auth-backend-module-gcp-iap-provider';\nimport {\n SignInResolver,\n createProxyAuthProviderFactory,\n} from '@backstage/plugin-auth-node';\nimport { createAuthProviderIntegration } from '../createAuthProviderIntegration';\nimport { AuthHandler } from '../types';\nimport { GcpIapResult } from './types';\n\n/**\n * Auth provider integration for Google Identity-Aware Proxy auth\n *\n * @public\n * @deprecated Migrate the auth plugin to the new backend system https://backstage.io/docs/backend-system/building-backends/migrating#the-auth-plugin\n */\nexport const gcpIap = createAuthProviderIntegration({\n create(options: {\n /**\n * The profile transformation function used to verify and convert the auth\n * response into the profile that will be presented to the user. The default\n * implementation just provides the authenticated email that the IAP\n * presented.\n */\n authHandler?: AuthHandler<GcpIapResult>;\n\n /**\n * Configures sign-in for this provider.\n */\n signIn: {\n /**\n * Maps an auth result to a Backstage identity for the user.\n */\n resolver: SignInResolver<GcpIapResult>;\n };\n }) {\n return createProxyAuthProviderFactory({\n authenticator: gcpIapAuthenticator,\n profileTransform: options?.authHandler,\n signInResolver: options?.signIn?.resolver,\n });\n },\n});\n"],"names":["createAuthProviderIntegration","createProxyAuthProviderFactory","gcpIapAuthenticator"],"mappings":";;;;;;AA+BO,MAAM,SAASA,2DAA8B,CAAA;AAAA,EAClD,OAAO,OAkBJ,EAAA;AACD,IAAA,OAAOC,6CAA+B,CAAA;AAAA,MACpC,aAAe,EAAAC,yDAAA;AAAA,MACf,kBAAkB,OAAS,EAAA,WAAA;AAAA,MAC3B,cAAA,EAAgB,SAAS,MAAQ,EAAA;AAAA,KAClC,CAAA;AAAA;AAEL,CAAC;;;;"}
@@ -1,61 +0,0 @@
1
- 'use strict';
2
-
3
- var createAuthProviderIntegration = require('../createAuthProviderIntegration.cjs.js');
4
- var pluginAuthNode = require('@backstage/plugin-auth-node');
5
- var pluginAuthBackendModuleGithubProvider = require('@backstage/plugin-auth-backend-module-github-provider');
6
-
7
- const github = createAuthProviderIntegration.createAuthProviderIntegration({
8
- create(options) {
9
- const authHandler = options?.authHandler;
10
- const signInResolver = options?.signIn?.resolver;
11
- return pluginAuthNode.createOAuthProviderFactory({
12
- authenticator: pluginAuthBackendModuleGithubProvider.githubAuthenticator,
13
- profileTransform: authHandler && (async (result, ctx) => authHandler(
14
- {
15
- fullProfile: result.fullProfile,
16
- accessToken: result.session.accessToken,
17
- params: {
18
- scope: result.session.scope,
19
- expires_in: result.session.expiresInSeconds ? String(result.session.expiresInSeconds) : "",
20
- refresh_token_expires_in: result.session.refreshTokenExpiresInSeconds ? String(result.session.refreshTokenExpiresInSeconds) : ""
21
- }
22
- },
23
- ctx
24
- )),
25
- signInResolver: signInResolver && (async ({ profile, result }, ctx) => signInResolver(
26
- {
27
- profile,
28
- result: {
29
- fullProfile: result.fullProfile,
30
- accessToken: result.session.accessToken,
31
- refreshToken: result.session.refreshToken,
32
- params: {
33
- scope: result.session.scope,
34
- expires_in: result.session.expiresInSeconds ? String(result.session.expiresInSeconds) : "",
35
- refresh_token_expires_in: result.session.refreshTokenExpiresInSeconds ? String(result.session.refreshTokenExpiresInSeconds) : ""
36
- }
37
- }
38
- },
39
- ctx
40
- ))
41
- });
42
- },
43
- resolvers: {
44
- /**
45
- * Looks up the user by matching their GitHub username to the entity name.
46
- */
47
- usernameMatchingUserEntityName: () => {
48
- return async (info, ctx) => {
49
- const { fullProfile } = info.result;
50
- const userId = fullProfile.username;
51
- if (!userId) {
52
- throw new Error(`GitHub user profile does not contain a username`);
53
- }
54
- return ctx.signInWithCatalogUser({ entityRef: { name: userId } });
55
- };
56
- }
57
- }
58
- });
59
-
60
- exports.github = github;
61
- //# sourceMappingURL=provider.cjs.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"provider.cjs.js","sources":["../../../src/providers/github/provider.ts"],"sourcesContent":["/*\n * Copyright 2020 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 { Profile as PassportProfile } from 'passport';\nimport { AuthHandler, StateEncoder } from '../types';\nimport { createAuthProviderIntegration } from '../createAuthProviderIntegration';\nimport {\n createOAuthProviderFactory,\n OAuthAuthenticatorResult,\n ProfileTransform,\n SignInResolver,\n} from '@backstage/plugin-auth-node';\nimport { githubAuthenticator } from '@backstage/plugin-auth-backend-module-github-provider';\n\n/**\n * @public\n * @deprecated Migrate the auth plugin to the new backend system https://backstage.io/docs/backend-system/building-backends/migrating#the-auth-plugin\n */\nexport type GithubOAuthResult = {\n fullProfile: PassportProfile;\n params: {\n scope: string;\n expires_in?: string;\n refresh_token_expires_in?: string;\n };\n accessToken: string;\n refreshToken?: string;\n};\n\n/**\n * Auth provider integration for GitHub auth\n *\n * @public\n * @deprecated Migrate the auth plugin to the new backend system https://backstage.io/docs/backend-system/building-backends/migrating#the-auth-plugin\n */\nexport const github = createAuthProviderIntegration({\n create(options?: {\n /**\n * The profile transformation function used to verify and convert the auth response\n * into the profile that will be presented to the user.\n */\n authHandler?: AuthHandler<GithubOAuthResult>;\n\n /**\n * Configure sign-in for this provider, without it the provider can not be used to sign users in.\n */\n signIn?: {\n /**\n * Maps an auth result to a Backstage identity for the user.\n */\n resolver: SignInResolver<GithubOAuthResult>;\n };\n\n /**\n * The state encoder used to encode the 'state' parameter on the OAuth request.\n *\n * It should return a string that takes the state params (from the request), url encodes the params\n * and finally base64 encodes them.\n *\n * Providing your own stateEncoder will allow you to add addition parameters to the state field.\n *\n * It is typed as follows:\n * `export type StateEncoder = (input: OAuthState) => Promise<{encodedState: string}>;`\n *\n * Note: the stateEncoder must encode a 'nonce' value and an 'env' value. Without this, the OAuth flow will fail\n * (These two values will be set by the req.state by default)\n *\n * For more information, please see the helper module in ../../oauth/helpers #readState\n */\n stateEncoder?: StateEncoder;\n }) {\n const authHandler = options?.authHandler;\n const signInResolver = options?.signIn?.resolver;\n return createOAuthProviderFactory({\n authenticator: githubAuthenticator,\n profileTransform:\n authHandler &&\n ((async (result, ctx) =>\n authHandler!(\n {\n fullProfile: result.fullProfile,\n accessToken: result.session.accessToken,\n params: {\n scope: result.session.scope,\n expires_in: result.session.expiresInSeconds\n ? String(result.session.expiresInSeconds)\n : '',\n refresh_token_expires_in: result.session\n .refreshTokenExpiresInSeconds\n ? String(result.session.refreshTokenExpiresInSeconds)\n : '',\n },\n },\n ctx,\n )) as ProfileTransform<OAuthAuthenticatorResult<PassportProfile>>),\n signInResolver:\n signInResolver &&\n ((async ({ profile, result }, ctx) =>\n signInResolver(\n {\n profile: profile,\n result: {\n fullProfile: result.fullProfile,\n accessToken: result.session.accessToken,\n refreshToken: result.session.refreshToken,\n params: {\n scope: result.session.scope,\n expires_in: result.session.expiresInSeconds\n ? String(result.session.expiresInSeconds)\n : '',\n refresh_token_expires_in: result.session\n .refreshTokenExpiresInSeconds\n ? String(result.session.refreshTokenExpiresInSeconds)\n : '',\n },\n },\n },\n ctx,\n )) as SignInResolver<OAuthAuthenticatorResult<PassportProfile>>),\n });\n },\n resolvers: {\n /**\n * Looks up the user by matching their GitHub username to the entity name.\n */\n usernameMatchingUserEntityName: (): SignInResolver<GithubOAuthResult> => {\n return async (info, ctx) => {\n const { fullProfile } = info.result;\n\n const userId = fullProfile.username;\n if (!userId) {\n throw new Error(`GitHub user profile does not contain a username`);\n }\n\n return ctx.signInWithCatalogUser({ entityRef: { name: userId } });\n };\n },\n },\n});\n"],"names":["createAuthProviderIntegration","createOAuthProviderFactory","githubAuthenticator"],"mappings":";;;;;;AAgDO,MAAM,SAASA,2DAA8B,CAAA;AAAA,EAClD,OAAO,OAkCJ,EAAA;AACD,IAAA,MAAM,cAAc,OAAS,EAAA,WAAA;AAC7B,IAAM,MAAA,cAAA,GAAiB,SAAS,MAAQ,EAAA,QAAA;AACxC,IAAA,OAAOC,yCAA2B,CAAA;AAAA,MAChC,aAAe,EAAAC,yDAAA;AAAA,MACf,gBACE,EAAA,WAAA,KACE,OAAO,MAAA,EAAQ,GACf,KAAA,WAAA;AAAA,QACE;AAAA,UACE,aAAa,MAAO,CAAA,WAAA;AAAA,UACpB,WAAA,EAAa,OAAO,OAAQ,CAAA,WAAA;AAAA,UAC5B,MAAQ,EAAA;AAAA,YACN,KAAA,EAAO,OAAO,OAAQ,CAAA,KAAA;AAAA,YACtB,UAAA,EAAY,OAAO,OAAQ,CAAA,gBAAA,GACvB,OAAO,MAAO,CAAA,OAAA,CAAQ,gBAAgB,CACtC,GAAA,EAAA;AAAA,YACJ,wBAAA,EAA0B,OAAO,OAC9B,CAAA,4BAAA,GACC,OAAO,MAAO,CAAA,OAAA,CAAQ,4BAA4B,CAClD,GAAA;AAAA;AACN,SACF;AAAA,QACA;AAAA,OACF,CAAA;AAAA,MACJ,gBACE,cACE,KAAA,OAAO,EAAE,OAAS,EAAA,MAAA,IAAU,GAC5B,KAAA,cAAA;AAAA,QACE;AAAA,UACE,OAAA;AAAA,UACA,MAAQ,EAAA;AAAA,YACN,aAAa,MAAO,CAAA,WAAA;AAAA,YACpB,WAAA,EAAa,OAAO,OAAQ,CAAA,WAAA;AAAA,YAC5B,YAAA,EAAc,OAAO,OAAQ,CAAA,YAAA;AAAA,YAC7B,MAAQ,EAAA;AAAA,cACN,KAAA,EAAO,OAAO,OAAQ,CAAA,KAAA;AAAA,cACtB,UAAA,EAAY,OAAO,OAAQ,CAAA,gBAAA,GACvB,OAAO,MAAO,CAAA,OAAA,CAAQ,gBAAgB,CACtC,GAAA,EAAA;AAAA,cACJ,wBAAA,EAA0B,OAAO,OAC9B,CAAA,4BAAA,GACC,OAAO,MAAO,CAAA,OAAA,CAAQ,4BAA4B,CAClD,GAAA;AAAA;AACN;AACF,SACF;AAAA,QACA;AAAA,OACF;AAAA,KACL,CAAA;AAAA,GACH;AAAA,EACA,SAAW,EAAA;AAAA;AAAA;AAAA;AAAA,IAIT,gCAAgC,MAAyC;AACvE,MAAO,OAAA,OAAO,MAAM,GAAQ,KAAA;AAC1B,QAAM,MAAA,EAAE,WAAY,EAAA,GAAI,IAAK,CAAA,MAAA;AAE7B,QAAA,MAAM,SAAS,WAAY,CAAA,QAAA;AAC3B,QAAA,IAAI,CAAC,MAAQ,EAAA;AACX,UAAM,MAAA,IAAI,MAAM,CAAiD,+CAAA,CAAA,CAAA;AAAA;AAGnE,QAAO,OAAA,GAAA,CAAI,sBAAsB,EAAE,SAAA,EAAW,EAAE,IAAM,EAAA,MAAA,IAAU,CAAA;AAAA,OAClE;AAAA;AACF;AAEJ,CAAC;;;;"}
@@ -1,20 +0,0 @@
1
- 'use strict';
2
-
3
- var createAuthProviderIntegration = require('../createAuthProviderIntegration.cjs.js');
4
- var pluginAuthNode = require('@backstage/plugin-auth-node');
5
- var adaptLegacyOAuthHandler = require('../../lib/legacy/adaptLegacyOAuthHandler.cjs.js');
6
- var adaptLegacyOAuthSignInResolver = require('../../lib/legacy/adaptLegacyOAuthSignInResolver.cjs.js');
7
- var pluginAuthBackendModuleGitlabProvider = require('@backstage/plugin-auth-backend-module-gitlab-provider');
8
-
9
- const gitlab = createAuthProviderIntegration.createAuthProviderIntegration({
10
- create(options) {
11
- return pluginAuthNode.createOAuthProviderFactory({
12
- authenticator: pluginAuthBackendModuleGitlabProvider.gitlabAuthenticator,
13
- profileTransform: adaptLegacyOAuthHandler.adaptLegacyOAuthHandler(options?.authHandler),
14
- signInResolver: adaptLegacyOAuthSignInResolver.adaptLegacyOAuthSignInResolver(options?.signIn?.resolver)
15
- });
16
- }
17
- });
18
-
19
- exports.gitlab = gitlab;
20
- //# sourceMappingURL=provider.cjs.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"provider.cjs.js","sources":["../../../src/providers/gitlab/provider.ts"],"sourcesContent":["/*\n * Copyright 2020 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 { AuthHandler } from '../types';\nimport { OAuthResult } from '../../lib/oauth';\nimport { createAuthProviderIntegration } from '../createAuthProviderIntegration';\nimport {\n SignInResolver,\n createOAuthProviderFactory,\n} from '@backstage/plugin-auth-node';\nimport {\n adaptLegacyOAuthHandler,\n adaptLegacyOAuthSignInResolver,\n} from '../../lib/legacy';\nimport { gitlabAuthenticator } from '@backstage/plugin-auth-backend-module-gitlab-provider';\n\n/**\n * Auth provider integration for GitLab auth\n *\n * @public\n * @deprecated Migrate the auth plugin to the new backend system https://backstage.io/docs/backend-system/building-backends/migrating#the-auth-plugin\n */\nexport const gitlab = createAuthProviderIntegration({\n create(options?: {\n /**\n * The profile transformation function used to verify and convert the auth response\n * into the profile that will be presented to the user.\n */\n authHandler?: AuthHandler<OAuthResult>;\n\n /**\n * Configure sign-in for this provider, without it the provider can not be used to sign users in.\n */\n signIn?: {\n resolver: SignInResolver<OAuthResult>;\n };\n }) {\n return createOAuthProviderFactory({\n authenticator: gitlabAuthenticator,\n profileTransform: adaptLegacyOAuthHandler(options?.authHandler),\n signInResolver: adaptLegacyOAuthSignInResolver(options?.signIn?.resolver),\n });\n },\n});\n"],"names":["createAuthProviderIntegration","createOAuthProviderFactory","gitlabAuthenticator","adaptLegacyOAuthHandler","adaptLegacyOAuthSignInResolver"],"mappings":";;;;;;;;AAmCO,MAAM,SAASA,2DAA8B,CAAA;AAAA,EAClD,OAAO,OAaJ,EAAA;AACD,IAAA,OAAOC,yCAA2B,CAAA;AAAA,MAChC,aAAe,EAAAC,yDAAA;AAAA,MACf,gBAAA,EAAkBC,+CAAwB,CAAA,OAAA,EAAS,WAAW,CAAA;AAAA,MAC9D,cAAgB,EAAAC,6DAAA,CAA+B,OAAS,EAAA,MAAA,EAAQ,QAAQ;AAAA,KACzE,CAAA;AAAA;AAEL,CAAC;;;;"}
@@ -1,26 +0,0 @@
1
- 'use strict';
2
-
3
- var pluginAuthBackendModuleGoogleProvider = require('@backstage/plugin-auth-backend-module-google-provider');
4
- var pluginAuthNode = require('@backstage/plugin-auth-node');
5
- var adaptLegacyOAuthHandler = require('../../lib/legacy/adaptLegacyOAuthHandler.cjs.js');
6
- var adaptLegacyOAuthSignInResolver = require('../../lib/legacy/adaptLegacyOAuthSignInResolver.cjs.js');
7
- var adaptOAuthSignInResolverToLegacy = require('../../lib/legacy/adaptOAuthSignInResolverToLegacy.cjs.js');
8
- var createAuthProviderIntegration = require('../createAuthProviderIntegration.cjs.js');
9
-
10
- const google = createAuthProviderIntegration.createAuthProviderIntegration({
11
- create(options) {
12
- return pluginAuthNode.createOAuthProviderFactory({
13
- authenticator: pluginAuthBackendModuleGoogleProvider.googleAuthenticator,
14
- profileTransform: adaptLegacyOAuthHandler.adaptLegacyOAuthHandler(options?.authHandler),
15
- signInResolver: adaptLegacyOAuthSignInResolver.adaptLegacyOAuthSignInResolver(options?.signIn?.resolver)
16
- });
17
- },
18
- resolvers: adaptOAuthSignInResolverToLegacy.adaptOAuthSignInResolverToLegacy({
19
- emailLocalPartMatchingUserEntityName: pluginAuthNode.commonSignInResolvers.emailLocalPartMatchingUserEntityName(),
20
- emailMatchingUserEntityProfileEmail: pluginAuthNode.commonSignInResolvers.emailMatchingUserEntityProfileEmail(),
21
- emailMatchingUserEntityAnnotation: pluginAuthBackendModuleGoogleProvider.googleSignInResolvers.emailMatchingUserEntityAnnotation()
22
- })
23
- });
24
-
25
- exports.google = google;
26
- //# sourceMappingURL=provider.cjs.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"provider.cjs.js","sources":["../../../src/providers/google/provider.ts"],"sourcesContent":["/*\n * Copyright 2020 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 googleAuthenticator,\n googleSignInResolvers,\n} from '@backstage/plugin-auth-backend-module-google-provider';\nimport {\n SignInResolver,\n commonSignInResolvers,\n createOAuthProviderFactory,\n} from '@backstage/plugin-auth-node';\nimport {\n adaptLegacyOAuthHandler,\n adaptLegacyOAuthSignInResolver,\n adaptOAuthSignInResolverToLegacy,\n} from '../../lib/legacy';\nimport { OAuthResult } from '../../lib/oauth';\nimport { createAuthProviderIntegration } from '../createAuthProviderIntegration';\nimport { AuthHandler } from '../types';\n\n/**\n * Auth provider integration for Google auth\n *\n * @public\n * @deprecated Migrate the auth plugin to the new backend system https://backstage.io/docs/backend-system/building-backends/migrating#the-auth-plugin\n */\nexport const google = createAuthProviderIntegration({\n create(options?: {\n /**\n * The profile transformation function used to verify and convert the auth response\n * into the profile that will be presented to the user.\n */\n authHandler?: AuthHandler<OAuthResult>;\n\n /**\n * Configure sign-in for this provider, without it the provider can not be used to sign users in.\n */\n signIn?: {\n /**\n * Maps an auth result to a Backstage identity for the user.\n */\n resolver: SignInResolver<OAuthResult>;\n };\n }) {\n return createOAuthProviderFactory({\n authenticator: googleAuthenticator,\n profileTransform: adaptLegacyOAuthHandler(options?.authHandler),\n signInResolver: adaptLegacyOAuthSignInResolver(options?.signIn?.resolver),\n });\n },\n resolvers: adaptOAuthSignInResolverToLegacy({\n emailLocalPartMatchingUserEntityName:\n commonSignInResolvers.emailLocalPartMatchingUserEntityName(),\n emailMatchingUserEntityProfileEmail:\n commonSignInResolvers.emailMatchingUserEntityProfileEmail(),\n emailMatchingUserEntityAnnotation:\n googleSignInResolvers.emailMatchingUserEntityAnnotation(),\n }),\n});\n"],"names":["createAuthProviderIntegration","createOAuthProviderFactory","googleAuthenticator","adaptLegacyOAuthHandler","adaptLegacyOAuthSignInResolver","adaptOAuthSignInResolverToLegacy","commonSignInResolvers","googleSignInResolvers"],"mappings":";;;;;;;;;AAwCO,MAAM,SAASA,2DAA8B,CAAA;AAAA,EAClD,OAAO,OAgBJ,EAAA;AACD,IAAA,OAAOC,yCAA2B,CAAA;AAAA,MAChC,aAAe,EAAAC,yDAAA;AAAA,MACf,gBAAA,EAAkBC,+CAAwB,CAAA,OAAA,EAAS,WAAW,CAAA;AAAA,MAC9D,cAAgB,EAAAC,6DAAA,CAA+B,OAAS,EAAA,MAAA,EAAQ,QAAQ;AAAA,KACzE,CAAA;AAAA,GACH;AAAA,EACA,WAAWC,iEAAiC,CAAA;AAAA,IAC1C,oCAAA,EACEC,qCAAsB,oCAAqC,EAAA;AAAA,IAC7D,mCAAA,EACEA,qCAAsB,mCAAoC,EAAA;AAAA,IAC5D,iCAAA,EACEC,4DAAsB,iCAAkC;AAAA,GAC3D;AACH,CAAC;;;;"}
@@ -1,27 +0,0 @@
1
- 'use strict';
2
-
3
- var createAuthProviderIntegration = require('../createAuthProviderIntegration.cjs.js');
4
- var pluginAuthNode = require('@backstage/plugin-auth-node');
5
- var adaptLegacyOAuthHandler = require('../../lib/legacy/adaptLegacyOAuthHandler.cjs.js');
6
- var adaptLegacyOAuthSignInResolver = require('../../lib/legacy/adaptLegacyOAuthSignInResolver.cjs.js');
7
- var adaptOAuthSignInResolverToLegacy = require('../../lib/legacy/adaptOAuthSignInResolverToLegacy.cjs.js');
8
- var pluginAuthBackendModuleMicrosoftProvider = require('@backstage/plugin-auth-backend-module-microsoft-provider');
9
-
10
- const microsoft = createAuthProviderIntegration.createAuthProviderIntegration({
11
- create(options) {
12
- return pluginAuthNode.createOAuthProviderFactory({
13
- authenticator: pluginAuthBackendModuleMicrosoftProvider.microsoftAuthenticator,
14
- profileTransform: adaptLegacyOAuthHandler.adaptLegacyOAuthHandler(options?.authHandler),
15
- signInResolver: adaptLegacyOAuthSignInResolver.adaptLegacyOAuthSignInResolver(options?.signIn?.resolver)
16
- });
17
- },
18
- resolvers: adaptOAuthSignInResolverToLegacy.adaptOAuthSignInResolverToLegacy({
19
- emailLocalPartMatchingUserEntityName: pluginAuthNode.commonSignInResolvers.emailLocalPartMatchingUserEntityName(),
20
- emailMatchingUserEntityProfileEmail: pluginAuthNode.commonSignInResolvers.emailMatchingUserEntityProfileEmail(),
21
- emailMatchingUserEntityAnnotation: pluginAuthBackendModuleMicrosoftProvider.microsoftSignInResolvers.emailMatchingUserEntityAnnotation(),
22
- userIdMatchingUserEntityAnnotation: pluginAuthBackendModuleMicrosoftProvider.microsoftSignInResolvers.userIdMatchingUserEntityAnnotation()
23
- })
24
- });
25
-
26
- exports.microsoft = microsoft;
27
- //# sourceMappingURL=provider.cjs.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"provider.cjs.js","sources":["../../../src/providers/microsoft/provider.ts"],"sourcesContent":["/*\n * Copyright 2020 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 { AuthHandler } from '../types';\nimport { OAuthResult } from '../../lib/oauth';\nimport { createAuthProviderIntegration } from '../createAuthProviderIntegration';\nimport {\n SignInResolver,\n commonSignInResolvers,\n createOAuthProviderFactory,\n} from '@backstage/plugin-auth-node';\nimport {\n adaptLegacyOAuthHandler,\n adaptLegacyOAuthSignInResolver,\n adaptOAuthSignInResolverToLegacy,\n} from '../../lib/legacy';\nimport {\n microsoftAuthenticator,\n microsoftSignInResolvers,\n} from '@backstage/plugin-auth-backend-module-microsoft-provider';\n\n/**\n * Auth provider integration for Microsoft auth\n *\n * @public\n * @deprecated Migrate the auth plugin to the new backend system https://backstage.io/docs/backend-system/building-backends/migrating#the-auth-plugin\n */\nexport const microsoft = createAuthProviderIntegration({\n create(options?: {\n /**\n * The profile transformation function used to verify and convert the auth response\n * into the profile that will be presented to the user.\n */\n authHandler?: AuthHandler<OAuthResult>;\n\n /**\n * Configure sign-in for this provider, without it the provider can not be used to sign users in.\n */\n signIn?: {\n resolver: SignInResolver<OAuthResult>;\n };\n }) {\n return createOAuthProviderFactory({\n authenticator: microsoftAuthenticator,\n profileTransform: adaptLegacyOAuthHandler(options?.authHandler),\n signInResolver: adaptLegacyOAuthSignInResolver(options?.signIn?.resolver),\n });\n },\n resolvers: adaptOAuthSignInResolverToLegacy({\n emailLocalPartMatchingUserEntityName:\n commonSignInResolvers.emailLocalPartMatchingUserEntityName(),\n emailMatchingUserEntityProfileEmail:\n commonSignInResolvers.emailMatchingUserEntityProfileEmail(),\n emailMatchingUserEntityAnnotation:\n microsoftSignInResolvers.emailMatchingUserEntityAnnotation(),\n userIdMatchingUserEntityAnnotation:\n microsoftSignInResolvers.userIdMatchingUserEntityAnnotation(),\n }),\n});\n"],"names":["createAuthProviderIntegration","createOAuthProviderFactory","microsoftAuthenticator","adaptLegacyOAuthHandler","adaptLegacyOAuthSignInResolver","adaptOAuthSignInResolverToLegacy","commonSignInResolvers","microsoftSignInResolvers"],"mappings":";;;;;;;;;AAwCO,MAAM,YAAYA,2DAA8B,CAAA;AAAA,EACrD,OAAO,OAaJ,EAAA;AACD,IAAA,OAAOC,yCAA2B,CAAA;AAAA,MAChC,aAAe,EAAAC,+DAAA;AAAA,MACf,gBAAA,EAAkBC,+CAAwB,CAAA,OAAA,EAAS,WAAW,CAAA;AAAA,MAC9D,cAAgB,EAAAC,6DAAA,CAA+B,OAAS,EAAA,MAAA,EAAQ,QAAQ;AAAA,KACzE,CAAA;AAAA,GACH;AAAA,EACA,WAAWC,iEAAiC,CAAA;AAAA,IAC1C,oCAAA,EACEC,qCAAsB,oCAAqC,EAAA;AAAA,IAC7D,mCAAA,EACEA,qCAAsB,mCAAoC,EAAA;AAAA,IAC5D,iCAAA,EACEC,kEAAyB,iCAAkC,EAAA;AAAA,IAC7D,kCAAA,EACEA,kEAAyB,kCAAmC;AAAA,GAC/D;AACH,CAAC;;;;"}
@@ -1,20 +0,0 @@
1
- 'use strict';
2
-
3
- var createAuthProviderIntegration = require('../createAuthProviderIntegration.cjs.js');
4
- var adaptLegacyOAuthHandler = require('../../lib/legacy/adaptLegacyOAuthHandler.cjs.js');
5
- var adaptLegacyOAuthSignInResolver = require('../../lib/legacy/adaptLegacyOAuthSignInResolver.cjs.js');
6
- var pluginAuthNode = require('@backstage/plugin-auth-node');
7
- var pluginAuthBackendModuleOauth2Provider = require('@backstage/plugin-auth-backend-module-oauth2-provider');
8
-
9
- const oauth2 = createAuthProviderIntegration.createAuthProviderIntegration({
10
- create(options) {
11
- return pluginAuthNode.createOAuthProviderFactory({
12
- authenticator: pluginAuthBackendModuleOauth2Provider.oauth2Authenticator,
13
- profileTransform: adaptLegacyOAuthHandler.adaptLegacyOAuthHandler(options?.authHandler),
14
- signInResolver: adaptLegacyOAuthSignInResolver.adaptLegacyOAuthSignInResolver(options?.signIn?.resolver)
15
- });
16
- }
17
- });
18
-
19
- exports.oauth2 = oauth2;
20
- //# sourceMappingURL=provider.cjs.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"provider.cjs.js","sources":["../../../src/providers/oauth2/provider.ts"],"sourcesContent":["/*\n * Copyright 2020 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 { OAuthResult } from '../../lib/oauth';\nimport { AuthHandler } from '../types';\nimport { createAuthProviderIntegration } from '../createAuthProviderIntegration';\nimport {\n adaptLegacyOAuthHandler,\n adaptLegacyOAuthSignInResolver,\n} from '../../lib/legacy';\nimport {\n SignInResolver,\n createOAuthProviderFactory,\n} from '@backstage/plugin-auth-node';\nimport { oauth2Authenticator } from '@backstage/plugin-auth-backend-module-oauth2-provider';\n\n/**\n * Auth provider integration for generic OAuth2 auth\n *\n * @public\n * @deprecated Migrate the auth plugin to the new backend system https://backstage.io/docs/backend-system/building-backends/migrating#the-auth-plugin\n */\nexport const oauth2 = createAuthProviderIntegration({\n create(options?: {\n authHandler?: AuthHandler<OAuthResult>;\n\n signIn?: {\n resolver: SignInResolver<OAuthResult>;\n };\n }) {\n return createOAuthProviderFactory({\n authenticator: oauth2Authenticator,\n profileTransform: adaptLegacyOAuthHandler(options?.authHandler),\n signInResolver: adaptLegacyOAuthSignInResolver(options?.signIn?.resolver),\n });\n },\n});\n"],"names":["createAuthProviderIntegration","createOAuthProviderFactory","oauth2Authenticator","adaptLegacyOAuthHandler","adaptLegacyOAuthSignInResolver"],"mappings":";;;;;;;;AAmCO,MAAM,SAASA,2DAA8B,CAAA;AAAA,EAClD,OAAO,OAMJ,EAAA;AACD,IAAA,OAAOC,yCAA2B,CAAA;AAAA,MAChC,aAAe,EAAAC,yDAAA;AAAA,MACf,gBAAA,EAAkBC,+CAAwB,CAAA,OAAA,EAAS,WAAW,CAAA;AAAA,MAC9D,cAAgB,EAAAC,6DAAA,CAA+B,OAAS,EAAA,MAAA,EAAQ,QAAQ;AAAA,KACzE,CAAA;AAAA;AAEL,CAAC;;;;"}
@@ -1,18 +0,0 @@
1
- 'use strict';
2
-
3
- var pluginAuthNode = require('@backstage/plugin-auth-node');
4
- var createAuthProviderIntegration = require('../createAuthProviderIntegration.cjs.js');
5
- var pluginAuthBackendModuleOauth2ProxyProvider = require('@backstage/plugin-auth-backend-module-oauth2-proxy-provider');
6
-
7
- const oauth2Proxy = createAuthProviderIntegration.createAuthProviderIntegration({
8
- create(options) {
9
- return pluginAuthNode.createProxyAuthProviderFactory({
10
- authenticator: pluginAuthBackendModuleOauth2ProxyProvider.oauth2ProxyAuthenticator,
11
- profileTransform: options?.authHandler,
12
- signInResolver: options?.signIn?.resolver
13
- });
14
- }
15
- });
16
-
17
- exports.oauth2Proxy = oauth2Proxy;
18
- //# sourceMappingURL=provider.cjs.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"provider.cjs.js","sources":["../../../src/providers/oauth2-proxy/provider.ts"],"sourcesContent":["/*\n * Copyright 2021 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 SignInResolver,\n createProxyAuthProviderFactory,\n} from '@backstage/plugin-auth-node';\nimport { AuthHandler } from '../types';\nimport { createAuthProviderIntegration } from '../createAuthProviderIntegration';\nimport {\n type OAuth2ProxyResult,\n oauth2ProxyAuthenticator,\n} from '@backstage/plugin-auth-backend-module-oauth2-proxy-provider';\n\n/**\n * Auth provider integration for oauth2-proxy auth\n *\n * @public\n * @deprecated Migrate the auth plugin to the new backend system https://backstage.io/docs/backend-system/building-backends/migrating#the-auth-plugin\n */\nexport const oauth2Proxy = createAuthProviderIntegration({\n create(options: {\n /**\n * Configure an auth handler to generate a profile for the user.\n *\n * The default implementation uses the value of the `X-Forwarded-Preferred-Username`\n * header as the display name, falling back to `X-Forwarded-User`, and the value of\n * the `X-Forwarded-Email` header as the email address.\n */\n authHandler?: AuthHandler<OAuth2ProxyResult>;\n\n /**\n * Configure sign-in for this provider, without it the provider can not be used to sign users in.\n */\n signIn: {\n /**\n * Maps an auth result to a Backstage identity for the user.\n */\n resolver: SignInResolver<OAuth2ProxyResult>;\n };\n }) {\n return createProxyAuthProviderFactory({\n authenticator: oauth2ProxyAuthenticator,\n profileTransform: options?.authHandler,\n signInResolver: options?.signIn?.resolver,\n });\n },\n});\n"],"names":["createAuthProviderIntegration","createProxyAuthProviderFactory","oauth2ProxyAuthenticator"],"mappings":";;;;;;AAiCO,MAAM,cAAcA,2DAA8B,CAAA;AAAA,EACvD,OAAO,OAmBJ,EAAA;AACD,IAAA,OAAOC,6CAA+B,CAAA;AAAA,MACpC,aAAe,EAAAC,mEAAA;AAAA,MACf,kBAAkB,OAAS,EAAA,WAAA;AAAA,MAC3B,cAAA,EAAgB,SAAS,MAAQ,EAAA;AAAA,KAClC,CAAA;AAAA;AAEL,CAAC;;;;"}
@@ -1,37 +0,0 @@
1
- 'use strict';
2
-
3
- var createAuthProviderIntegration = require('../createAuthProviderIntegration.cjs.js');
4
- var pluginAuthNode = require('@backstage/plugin-auth-node');
5
- var pluginAuthBackendModuleOidcProvider = require('@backstage/plugin-auth-backend-module-oidc-provider');
6
- var resolvers = require('../resolvers.cjs.js');
7
-
8
- const oidc = createAuthProviderIntegration.createAuthProviderIntegration({
9
- create(options) {
10
- const authHandler = options?.authHandler;
11
- const signInResolver = options?.signIn?.resolver;
12
- return pluginAuthNode.createOAuthProviderFactory({
13
- authenticator: pluginAuthBackendModuleOidcProvider.oidcAuthenticator,
14
- profileTransform: authHandler && ((result, context) => authHandler(result.fullProfile, context)),
15
- signInResolver: signInResolver && ((info, context) => signInResolver(
16
- {
17
- result: info.result.fullProfile,
18
- profile: info.profile
19
- },
20
- context
21
- ))
22
- });
23
- },
24
- resolvers: {
25
- /**
26
- * Looks up the user by matching their email local part to the entity name.
27
- */
28
- emailLocalPartMatchingUserEntityName: () => resolvers.commonByEmailLocalPartResolver,
29
- /**
30
- * Looks up the user by matching their email to the entity email.
31
- */
32
- emailMatchingUserEntityProfileEmail: () => resolvers.commonByEmailResolver
33
- }
34
- });
35
-
36
- exports.oidc = oidc;
37
- //# sourceMappingURL=provider.cjs.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"provider.cjs.js","sources":["../../../src/providers/oidc/provider.ts"],"sourcesContent":["/*\n * Copyright 2020 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 { AuthHandler } from '../types';\nimport { createAuthProviderIntegration } from '../createAuthProviderIntegration';\nimport {\n createOAuthProviderFactory,\n AuthResolverContext,\n BackstageSignInResult,\n OAuthAuthenticatorResult,\n SignInInfo,\n SignInResolver,\n} from '@backstage/plugin-auth-node';\nimport {\n oidcAuthenticator,\n OidcAuthResult,\n} from '@backstage/plugin-auth-backend-module-oidc-provider';\nimport {\n commonByEmailLocalPartResolver,\n commonByEmailResolver,\n} from '../resolvers';\n\n/**\n * Auth provider integration for generic OpenID Connect auth\n *\n * @public\n * @deprecated Migrate the auth plugin to the new backend system https://backstage.io/docs/backend-system/building-backends/migrating#the-auth-plugin\n */\nexport const oidc = createAuthProviderIntegration({\n create(options?: {\n /**\n * The profile transformation function used to verify and convert the auth response\n * into the profile that will be presented to the user.\n */\n authHandler?: AuthHandler<OidcAuthResult>;\n\n /**\n * Configure sign-in for this provider; convert user profile respones into\n * Backstage identities.\n */\n signIn?: {\n resolver: SignInResolver<OidcAuthResult>;\n };\n }) {\n const authHandler = options?.authHandler;\n const signInResolver = options?.signIn?.resolver;\n return createOAuthProviderFactory({\n authenticator: oidcAuthenticator,\n profileTransform:\n authHandler &&\n ((\n result: OAuthAuthenticatorResult<OidcAuthResult>,\n context: AuthResolverContext,\n ) => authHandler(result.fullProfile, context)),\n signInResolver:\n signInResolver &&\n ((\n info: SignInInfo<OAuthAuthenticatorResult<OidcAuthResult>>,\n context: AuthResolverContext,\n ): Promise<BackstageSignInResult> =>\n signInResolver(\n {\n result: info.result.fullProfile,\n profile: info.profile,\n },\n context,\n )),\n });\n },\n resolvers: {\n /**\n * Looks up the user by matching their email local part to the entity name.\n */\n emailLocalPartMatchingUserEntityName: () => commonByEmailLocalPartResolver,\n /**\n * Looks up the user by matching their email to the entity email.\n */\n emailMatchingUserEntityProfileEmail: () => commonByEmailResolver,\n },\n});\n"],"names":["createAuthProviderIntegration","createOAuthProviderFactory","oidcAuthenticator","commonByEmailLocalPartResolver","commonByEmailResolver"],"mappings":";;;;;;;AAyCO,MAAM,OAAOA,2DAA8B,CAAA;AAAA,EAChD,OAAO,OAcJ,EAAA;AACD,IAAA,MAAM,cAAc,OAAS,EAAA,WAAA;AAC7B,IAAM,MAAA,cAAA,GAAiB,SAAS,MAAQ,EAAA,QAAA;AACxC,IAAA,OAAOC,yCAA2B,CAAA;AAAA,MAChC,aAAe,EAAAC,qDAAA;AAAA,MACf,gBAAA,EACE,gBACC,CACC,MAAA,EACA,YACG,WAAY,CAAA,MAAA,CAAO,aAAa,OAAO,CAAA,CAAA;AAAA,MAC9C,cACE,EAAA,cAAA,KACC,CACC,IAAA,EACA,OAEA,KAAA,cAAA;AAAA,QACE;AAAA,UACE,MAAA,EAAQ,KAAK,MAAO,CAAA,WAAA;AAAA,UACpB,SAAS,IAAK,CAAA;AAAA,SAChB;AAAA,QACA;AAAA,OACF;AAAA,KACL,CAAA;AAAA,GACH;AAAA,EACA,SAAW,EAAA;AAAA;AAAA;AAAA;AAAA,IAIT,sCAAsC,MAAMC,wCAAA;AAAA;AAAA;AAAA;AAAA,IAI5C,qCAAqC,MAAMC;AAAA;AAE/C,CAAC;;;;"}
@@ -1,47 +0,0 @@
1
- 'use strict';
2
-
3
- var createAuthProviderIntegration = require('../createAuthProviderIntegration.cjs.js');
4
- var pluginAuthNode = require('@backstage/plugin-auth-node');
5
- var adaptLegacyOAuthHandler = require('../../lib/legacy/adaptLegacyOAuthHandler.cjs.js');
6
- var adaptLegacyOAuthSignInResolver = require('../../lib/legacy/adaptLegacyOAuthSignInResolver.cjs.js');
7
- var pluginAuthBackendModuleOktaProvider = require('@backstage/plugin-auth-backend-module-okta-provider');
8
- var resolvers = require('../resolvers.cjs.js');
9
-
10
- const okta = createAuthProviderIntegration.createAuthProviderIntegration({
11
- create(options) {
12
- return pluginAuthNode.createOAuthProviderFactory({
13
- authenticator: pluginAuthBackendModuleOktaProvider.oktaAuthenticator,
14
- profileTransform: adaptLegacyOAuthHandler.adaptLegacyOAuthHandler(options?.authHandler),
15
- signInResolver: adaptLegacyOAuthSignInResolver.adaptLegacyOAuthSignInResolver(options?.signIn?.resolver)
16
- });
17
- },
18
- resolvers: {
19
- /**
20
- * Looks up the user by matching their email local part to the entity name.
21
- */
22
- emailLocalPartMatchingUserEntityName: () => resolvers.commonByEmailLocalPartResolver,
23
- /**
24
- * Looks up the user by matching their email to the entity email.
25
- */
26
- emailMatchingUserEntityProfileEmail: () => resolvers.commonByEmailResolver,
27
- /**
28
- * Looks up the user by matching their email to the `okta.com/email` annotation.
29
- */
30
- emailMatchingUserEntityAnnotation() {
31
- return async (info, ctx) => {
32
- const { profile } = info;
33
- if (!profile.email) {
34
- throw new Error("Okta profile contained no email");
35
- }
36
- return ctx.signInWithCatalogUser({
37
- annotations: {
38
- "okta.com/email": profile.email
39
- }
40
- });
41
- };
42
- }
43
- }
44
- });
45
-
46
- exports.okta = okta;
47
- //# sourceMappingURL=provider.cjs.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"provider.cjs.js","sources":["../../../src/providers/okta/provider.ts"],"sourcesContent":["/*\n * Copyright 2020 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 { AuthHandler } from '../types';\nimport { OAuthResult } from '../../lib/oauth';\n\nimport { createAuthProviderIntegration } from '../createAuthProviderIntegration';\nimport {\n SignInResolver,\n createOAuthProviderFactory,\n} from '@backstage/plugin-auth-node';\nimport {\n adaptLegacyOAuthHandler,\n adaptLegacyOAuthSignInResolver,\n} from '../../lib/legacy';\nimport { oktaAuthenticator } from '@backstage/plugin-auth-backend-module-okta-provider';\nimport {\n commonByEmailLocalPartResolver,\n commonByEmailResolver,\n} from '../resolvers';\n\n/**\n * Auth provider integration for Okta auth\n *\n * @public\n * @deprecated Migrate the auth plugin to the new backend system https://backstage.io/docs/backend-system/building-backends/migrating#the-auth-plugin\n */\nexport const okta = createAuthProviderIntegration({\n create(options?: {\n /**\n * The profile transformation function used to verify and convert the auth response\n * into the profile that will be presented to the user.\n */\n authHandler?: AuthHandler<OAuthResult>;\n /**\n * Configure sign-in for this provider, without it the provider can not be used to sign users in.\n */\n signIn?: {\n resolver: SignInResolver<OAuthResult>;\n };\n }) {\n return createOAuthProviderFactory({\n authenticator: oktaAuthenticator,\n profileTransform: adaptLegacyOAuthHandler(options?.authHandler),\n signInResolver: adaptLegacyOAuthSignInResolver(options?.signIn?.resolver),\n });\n },\n resolvers: {\n /**\n * Looks up the user by matching their email local part to the entity name.\n */\n emailLocalPartMatchingUserEntityName: () => commonByEmailLocalPartResolver,\n /**\n * Looks up the user by matching their email to the entity email.\n */\n emailMatchingUserEntityProfileEmail: () => commonByEmailResolver,\n /**\n * Looks up the user by matching their email to the `okta.com/email` annotation.\n */\n emailMatchingUserEntityAnnotation(): SignInResolver<OAuthResult> {\n return async (info, ctx) => {\n const { profile } = info;\n\n if (!profile.email) {\n throw new Error('Okta profile contained no email');\n }\n\n return ctx.signInWithCatalogUser({\n annotations: {\n 'okta.com/email': profile.email,\n },\n });\n };\n },\n },\n});\n"],"names":["createAuthProviderIntegration","createOAuthProviderFactory","oktaAuthenticator","adaptLegacyOAuthHandler","adaptLegacyOAuthSignInResolver","commonByEmailLocalPartResolver","commonByEmailResolver"],"mappings":";;;;;;;;;AAwCO,MAAM,OAAOA,2DAA8B,CAAA;AAAA,EAChD,OAAO,OAYJ,EAAA;AACD,IAAA,OAAOC,yCAA2B,CAAA;AAAA,MAChC,aAAe,EAAAC,qDAAA;AAAA,MACf,gBAAA,EAAkBC,+CAAwB,CAAA,OAAA,EAAS,WAAW,CAAA;AAAA,MAC9D,cAAgB,EAAAC,6DAAA,CAA+B,OAAS,EAAA,MAAA,EAAQ,QAAQ;AAAA,KACzE,CAAA;AAAA,GACH;AAAA,EACA,SAAW,EAAA;AAAA;AAAA;AAAA;AAAA,IAIT,sCAAsC,MAAMC,wCAAA;AAAA;AAAA;AAAA;AAAA,IAI5C,qCAAqC,MAAMC,+BAAA;AAAA;AAAA;AAAA;AAAA,IAI3C,iCAAiE,GAAA;AAC/D,MAAO,OAAA,OAAO,MAAM,GAAQ,KAAA;AAC1B,QAAM,MAAA,EAAE,SAAY,GAAA,IAAA;AAEpB,QAAI,IAAA,CAAC,QAAQ,KAAO,EAAA;AAClB,UAAM,MAAA,IAAI,MAAM,iCAAiC,CAAA;AAAA;AAGnD,QAAA,OAAO,IAAI,qBAAsB,CAAA;AAAA,UAC/B,WAAa,EAAA;AAAA,YACX,kBAAkB,OAAQ,CAAA;AAAA;AAC5B,SACD,CAAA;AAAA,OACH;AAAA;AACF;AAEJ,CAAC;;;;"}
@@ -1,20 +0,0 @@
1
- 'use strict';
2
-
3
- var pluginAuthBackendModuleOneloginProvider = require('@backstage/plugin-auth-backend-module-onelogin-provider');
4
- var pluginAuthNode = require('@backstage/plugin-auth-node');
5
- var adaptLegacyOAuthHandler = require('../../lib/legacy/adaptLegacyOAuthHandler.cjs.js');
6
- var adaptLegacyOAuthSignInResolver = require('../../lib/legacy/adaptLegacyOAuthSignInResolver.cjs.js');
7
- var createAuthProviderIntegration = require('../createAuthProviderIntegration.cjs.js');
8
-
9
- const onelogin = createAuthProviderIntegration.createAuthProviderIntegration({
10
- create(options) {
11
- return pluginAuthNode.createOAuthProviderFactory({
12
- authenticator: pluginAuthBackendModuleOneloginProvider.oneLoginAuthenticator,
13
- profileTransform: adaptLegacyOAuthHandler.adaptLegacyOAuthHandler(options?.authHandler),
14
- signInResolver: adaptLegacyOAuthSignInResolver.adaptLegacyOAuthSignInResolver(options?.signIn?.resolver)
15
- });
16
- }
17
- });
18
-
19
- exports.onelogin = onelogin;
20
- //# sourceMappingURL=provider.cjs.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"provider.cjs.js","sources":["../../../src/providers/onelogin/provider.ts"],"sourcesContent":["/*\n * Copyright 2020 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 { oneLoginAuthenticator } from '@backstage/plugin-auth-backend-module-onelogin-provider';\nimport {\n SignInResolver,\n createOAuthProviderFactory,\n} from '@backstage/plugin-auth-node';\nimport {\n adaptLegacyOAuthHandler,\n adaptLegacyOAuthSignInResolver,\n} from '../../lib/legacy';\nimport { OAuthResult } from '../../lib/oauth';\nimport { createAuthProviderIntegration } from '../createAuthProviderIntegration';\nimport { AuthHandler } from '../types';\n\n/**\n * Auth provider integration for OneLogin auth\n *\n * @public\n * @deprecated Migrate the auth plugin to the new backend system https://backstage.io/docs/backend-system/building-backends/migrating#the-auth-plugin\n */\nexport const onelogin = createAuthProviderIntegration({\n create(options?: {\n /**\n * The profile transformation function used to verify and convert the auth response\n * into the profile that will be presented to the user.\n */\n authHandler?: AuthHandler<OAuthResult>;\n\n /**\n * Configure sign-in for this provider, without it the provider can not be used to sign users in.\n */\n signIn?: {\n /**\n * Maps an auth result to a Backstage identity for the user.\n */\n resolver: SignInResolver<OAuthResult>;\n };\n }) {\n return createOAuthProviderFactory({\n authenticator: oneLoginAuthenticator,\n profileTransform: adaptLegacyOAuthHandler(options?.authHandler),\n signInResolver: adaptLegacyOAuthSignInResolver(options?.signIn?.resolver),\n });\n },\n});\n"],"names":["createAuthProviderIntegration","createOAuthProviderFactory","oneLoginAuthenticator","adaptLegacyOAuthHandler","adaptLegacyOAuthSignInResolver"],"mappings":";;;;;;;;AAmCO,MAAM,WAAWA,2DAA8B,CAAA;AAAA,EACpD,OAAO,OAgBJ,EAAA;AACD,IAAA,OAAOC,yCAA2B,CAAA;AAAA,MAChC,aAAe,EAAAC,6DAAA;AAAA,MACf,gBAAA,EAAkBC,+CAAwB,CAAA,OAAA,EAAS,WAAW,CAAA;AAAA,MAC9D,cAAgB,EAAAC,6DAAA,CAA+B,OAAS,EAAA,MAAA,EAAQ,QAAQ;AAAA,KACzE,CAAA;AAAA;AAEL,CAAC;;;;"}
@@ -1,8 +0,0 @@
1
- 'use strict';
2
-
3
- var pluginAuthNode = require('@backstage/plugin-auth-node');
4
-
5
- const prepareBackstageIdentityResponse = pluginAuthNode.prepareBackstageIdentityResponse;
6
-
7
- exports.prepareBackstageIdentityResponse = prepareBackstageIdentityResponse;
8
- //# sourceMappingURL=prepareBackstageIdentityResponse.cjs.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"prepareBackstageIdentityResponse.cjs.js","sources":["../../src/providers/prepareBackstageIdentityResponse.ts"],"sourcesContent":["/*\n * Copyright 2020 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 { prepareBackstageIdentityResponse as _prepareBackstageIdentityResponse } from '@backstage/plugin-auth-node';\n\n/**\n * @public\n * @deprecated import from `@backstage/plugin-auth-node` instead\n */\nexport const prepareBackstageIdentityResponse =\n _prepareBackstageIdentityResponse;\n"],"names":["_prepareBackstageIdentityResponse"],"mappings":";;;;AAsBO,MAAM,gCACX,GAAAA;;;;"}
@@ -1,62 +0,0 @@
1
- 'use strict';
2
-
3
- var provider$e = require('./atlassian/provider.cjs.js');
4
- var provider$5 = require('./auth0/provider.cjs.js');
5
- var provider$b = require('./aws-alb/provider.cjs.js');
6
- var provider$c = require('./bitbucket/provider.cjs.js');
7
- var provider$f = require('./cloudflare-access/provider.cjs.js');
8
- var provider$g = require('./gcp-iap/provider.cjs.js');
9
- var provider$1 = require('./github/provider.cjs.js');
10
- var provider$2 = require('./gitlab/provider.cjs.js');
11
- var provider = require('./google/provider.cjs.js');
12
- var provider$6 = require('./microsoft/provider.cjs.js');
13
- var provider$8 = require('./oauth2/provider.cjs.js');
14
- var provider$h = require('./oauth2-proxy/provider.cjs.js');
15
- var provider$9 = require('./oidc/provider.cjs.js');
16
- var provider$4 = require('./okta/provider.cjs.js');
17
- var provider$a = require('./onelogin/provider.cjs.js');
18
- var provider$3 = require('./saml/provider.cjs.js');
19
- var provider$d = require('./bitbucketServer/provider.cjs.js');
20
- var provider$7 = require('./azure-easyauth/provider.cjs.js');
21
-
22
- const providers = Object.freeze({
23
- atlassian: provider$e.atlassian,
24
- auth0: provider$5.auth0,
25
- awsAlb: provider$b.awsAlb,
26
- bitbucket: provider$c.bitbucket,
27
- bitbucketServer: provider$d.bitbucketServer,
28
- cfAccess: provider$f.cfAccess,
29
- gcpIap: provider$g.gcpIap,
30
- github: provider$1.github,
31
- gitlab: provider$2.gitlab,
32
- google: provider.google,
33
- microsoft: provider$6.microsoft,
34
- oauth2: provider$8.oauth2,
35
- oauth2Proxy: provider$h.oauth2Proxy,
36
- oidc: provider$9.oidc,
37
- okta: provider$4.okta,
38
- onelogin: provider$a.onelogin,
39
- saml: provider$3.saml,
40
- easyAuth: provider$7.easyAuth
41
- });
42
- const defaultAuthProviderFactories = {
43
- google: provider.google.create(),
44
- github: provider$1.github.create(),
45
- gitlab: provider$2.gitlab.create(),
46
- saml: provider$3.saml.create(),
47
- okta: provider$4.okta.create(),
48
- auth0: provider$5.auth0.create(),
49
- microsoft: provider$6.microsoft.create(),
50
- easyAuth: provider$7.easyAuth.create(),
51
- oauth2: provider$8.oauth2.create(),
52
- oidc: provider$9.oidc.create(),
53
- onelogin: provider$a.onelogin.create(),
54
- awsalb: provider$b.awsAlb.create(),
55
- bitbucket: provider$c.bitbucket.create(),
56
- bitbucketServer: provider$d.bitbucketServer.create(),
57
- atlassian: provider$e.atlassian.create()
58
- };
59
-
60
- exports.defaultAuthProviderFactories = defaultAuthProviderFactories;
61
- exports.providers = providers;
62
- //# sourceMappingURL=providers.cjs.js.map