@backstage/plugin-auth-backend-module-azure-easyauth-provider 0.2.8-next.1 → 0.2.8-next.2

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,16 @@
1
1
  # @backstage/plugin-auth-backend-module-azure-easyauth-provider
2
2
 
3
+ ## 0.2.8-next.2
4
+
5
+ ### Patch Changes
6
+
7
+ - 5cc1f7f: Introduce `dangerouslyAllowSignInWithoutUserInCatalog` auth resolver config.
8
+ - Updated dependencies
9
+ - @backstage/plugin-auth-node@0.6.3-next.2
10
+ - @backstage/backend-plugin-api@1.3.1-next.2
11
+ - @backstage/catalog-model@1.7.3
12
+ - @backstage/errors@1.2.7
13
+
3
14
  ## 0.2.8-next.1
4
15
 
5
16
  ### Patch Changes
package/dist/index.d.ts CHANGED
@@ -18,7 +18,9 @@ declare const azureEasyAuthAuthenticator: _backstage_plugin_auth_node.ProxyAuthe
18
18
 
19
19
  /** @public */
20
20
  declare namespace azureEasyAuthSignInResolvers {
21
- const idMatchingUserEntityAnnotation: _backstage_plugin_auth_node.SignInResolverFactory<AzureEasyAuthResult, unknown>;
21
+ const idMatchingUserEntityAnnotation: _backstage_plugin_auth_node.SignInResolverFactory<AzureEasyAuthResult, {
22
+ dangerouslyAllowSignInWithoutUserInCatalog?: boolean | undefined;
23
+ } | undefined>;
22
24
  }
23
25
 
24
26
  export { type AzureEasyAuthResult, azureEasyAuthAuthenticator, azureEasyAuthSignInResolvers, authModuleAzureEasyAuthProvider as default };
@@ -1,11 +1,15 @@
1
1
  'use strict';
2
2
 
3
3
  var pluginAuthNode = require('@backstage/plugin-auth-node');
4
+ var zod = require('zod');
4
5
 
5
6
  exports.azureEasyAuthSignInResolvers = void 0;
6
7
  ((azureEasyAuthSignInResolvers2) => {
7
8
  azureEasyAuthSignInResolvers2.idMatchingUserEntityAnnotation = pluginAuthNode.createSignInResolverFactory({
8
- create() {
9
+ optionsSchema: zod.z.object({
10
+ dangerouslyAllowSignInWithoutUserInCatalog: zod.z.boolean().optional()
11
+ }).optional(),
12
+ create(options = {}) {
9
13
  return async (info, ctx) => {
10
14
  const {
11
15
  fullProfile: { id }
@@ -13,11 +17,16 @@ exports.azureEasyAuthSignInResolvers = void 0;
13
17
  if (!id) {
14
18
  throw new Error("User profile contained no id");
15
19
  }
16
- return await ctx.signInWithCatalogUser({
17
- annotations: {
18
- "graph.microsoft.com/user-id": id
20
+ return ctx.signInWithCatalogUser(
21
+ {
22
+ annotations: {
23
+ "graph.microsoft.com/user-id": id
24
+ }
25
+ },
26
+ {
27
+ dangerousEntityRefFallback: options?.dangerouslyAllowSignInWithoutUserInCatalog ? { entityRef: { name: id } } : void 0
19
28
  }
20
- });
29
+ );
21
30
  };
22
31
  }
23
32
  });
@@ -1 +1 @@
1
- {"version":3,"file":"resolvers.cjs.js","sources":["../src/resolvers.ts"],"sourcesContent":["/*\n * Copyright 2024 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 { AzureEasyAuthResult } from './types';\n\n/** @public */\nexport namespace azureEasyAuthSignInResolvers {\n export const idMatchingUserEntityAnnotation = createSignInResolverFactory({\n create() {\n return async (info: SignInInfo<AzureEasyAuthResult>, ctx) => {\n const {\n fullProfile: { id },\n } = info.result;\n\n if (!id) {\n throw new Error('User profile contained no id');\n }\n\n return await ctx.signInWithCatalogUser({\n annotations: {\n 'graph.microsoft.com/user-id': id,\n },\n });\n };\n },\n });\n}\n"],"names":["azureEasyAuthSignInResolvers","createSignInResolverFactory"],"mappings":";;;;AAuBiBA;AAAA,CAAV,CAAUA,6BAAV,KAAA;AACE,EAAMA,6BAAAA,CAAA,iCAAiCC,0CAA4B,CAAA;AAAA,IACxE,MAAS,GAAA;AACP,MAAO,OAAA,OAAO,MAAuC,GAAQ,KAAA;AAC3D,QAAM,MAAA;AAAA,UACJ,WAAA,EAAa,EAAE,EAAG;AAAA,YAChB,IAAK,CAAA,MAAA;AAET,QAAA,IAAI,CAAC,EAAI,EAAA;AACP,UAAM,MAAA,IAAI,MAAM,8BAA8B,CAAA;AAAA;AAGhD,QAAO,OAAA,MAAM,IAAI,qBAAsB,CAAA;AAAA,UACrC,WAAa,EAAA;AAAA,YACX,6BAA+B,EAAA;AAAA;AACjC,SACD,CAAA;AAAA,OACH;AAAA;AACF,GACD,CAAA;AAAA,CAnBc,EAAAD,oCAAA,KAAAA,oCAAA,GAAA,EAAA,CAAA,CAAA;;"}
1
+ {"version":3,"file":"resolvers.cjs.js","sources":["../src/resolvers.ts"],"sourcesContent":["/*\n * Copyright 2024 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 { AzureEasyAuthResult } from './types';\nimport { z } from 'zod';\n\n/** @public */\nexport namespace azureEasyAuthSignInResolvers {\n export const idMatchingUserEntityAnnotation = createSignInResolverFactory({\n optionsSchema: z\n .object({\n dangerouslyAllowSignInWithoutUserInCatalog: z.boolean().optional(),\n })\n .optional(),\n create(options = {}) {\n return async (info: SignInInfo<AzureEasyAuthResult>, ctx) => {\n const {\n fullProfile: { id },\n } = info.result;\n\n if (!id) {\n throw new Error('User profile contained no id');\n }\n return ctx.signInWithCatalogUser(\n {\n annotations: {\n 'graph.microsoft.com/user-id': id,\n },\n },\n {\n dangerousEntityRefFallback:\n options?.dangerouslyAllowSignInWithoutUserInCatalog\n ? { entityRef: { name: id } }\n : undefined,\n },\n );\n };\n },\n });\n}\n"],"names":["azureEasyAuthSignInResolvers","createSignInResolverFactory","z"],"mappings":";;;;;AAwBiBA;AAAA,CAAV,CAAUA,6BAAV,KAAA;AACE,EAAMA,6BAAAA,CAAA,iCAAiCC,0CAA4B,CAAA;AAAA,IACxE,aAAA,EAAeC,MACZ,MAAO,CAAA;AAAA,MACN,0CAA4C,EAAAA,KAAA,CAAE,OAAQ,EAAA,CAAE,QAAS;AAAA,KAClE,EACA,QAAS,EAAA;AAAA,IACZ,MAAA,CAAO,OAAU,GAAA,EAAI,EAAA;AACnB,MAAO,OAAA,OAAO,MAAuC,GAAQ,KAAA;AAC3D,QAAM,MAAA;AAAA,UACJ,WAAA,EAAa,EAAE,EAAG;AAAA,YAChB,IAAK,CAAA,MAAA;AAET,QAAA,IAAI,CAAC,EAAI,EAAA;AACP,UAAM,MAAA,IAAI,MAAM,8BAA8B,CAAA;AAAA;AAEhD,QAAA,OAAO,GAAI,CAAA,qBAAA;AAAA,UACT;AAAA,YACE,WAAa,EAAA;AAAA,cACX,6BAA+B,EAAA;AAAA;AACjC,WACF;AAAA,UACA;AAAA,YACE,0BAAA,EACE,SAAS,0CACL,GAAA,EAAE,WAAW,EAAE,IAAA,EAAM,EAAG,EAAA,EACxB,GAAA,KAAA;AAAA;AACR,SACF;AAAA,OACF;AAAA;AACF,GACD,CAAA;AAAA,CA/Bc,EAAAF,oCAAA,KAAAA,oCAAA,GAAA,EAAA,CAAA,CAAA;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@backstage/plugin-auth-backend-module-azure-easyauth-provider",
3
- "version": "0.2.8-next.1",
3
+ "version": "0.2.8-next.2",
4
4
  "description": "The azure-easyauth-provider backend module for the auth plugin.",
5
5
  "backstage": {
6
6
  "role": "backend-plugin-module",
@@ -36,19 +36,20 @@
36
36
  "test": "backstage-cli package test"
37
37
  },
38
38
  "dependencies": {
39
- "@backstage/backend-plugin-api": "1.3.1-next.1",
39
+ "@backstage/backend-plugin-api": "1.3.1-next.2",
40
40
  "@backstage/catalog-model": "1.7.3",
41
41
  "@backstage/errors": "1.2.7",
42
- "@backstage/plugin-auth-node": "0.6.3-next.1",
42
+ "@backstage/plugin-auth-node": "0.6.3-next.2",
43
43
  "@types/passport": "^1.0.16",
44
44
  "express": "^4.19.2",
45
45
  "jose": "^5.0.0",
46
- "passport": "^0.7.0"
46
+ "passport": "^0.7.0",
47
+ "zod": "^3.22.4"
47
48
  },
48
49
  "devDependencies": {
49
- "@backstage/backend-test-utils": "1.5.0-next.1",
50
- "@backstage/cli": "0.32.1-next.1",
51
- "@backstage/plugin-auth-backend": "0.25.0-next.1"
50
+ "@backstage/backend-test-utils": "1.5.0-next.3",
51
+ "@backstage/cli": "0.32.1-next.3",
52
+ "@backstage/plugin-auth-backend": "0.25.0-next.2"
52
53
  },
53
54
  "typesVersions": {
54
55
  "*": {