Skip to content

Commit 8b23c81

Browse files
rhdh-gh-app[bot]Omar-AlJaljuliJessicaJHee04kash
authored
feat: update Backstage to 1.36.1 (#2526)
* feat: update Backstage to 1.36.1 Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * chore: reinclude Dependencies/backstage 1.36.1 changes (#2595) * add auth provider related patches and changes (#2533) Signed-off-by: Jessica He <[email protected]> * add the 2 new services introduced with backstage 1.36 rh-pre-commit.version: 2.3.2 rh-pre-commit.check-secrets: ENABLED * disable audit log tests until new audit log service is investigated and adopted fully rh-pre-commit.version: 2.3.2 rh-pre-commit.check-secrets: ENABLED * yarn.lock update rh-pre-commit.version: 2.3.2 rh-pre-commit.check-secrets: ENABLED * modify yarn.lock to be closer to older version rh-pre-commit.version: 2.3.2 rh-pre-commit.check-secrets: ENABLED --------- Signed-off-by: Jessica He <[email protected]> Co-authored-by: Jessica He <[email protected]> * chore: update audit log patches (#2600) * chore: remove audit log patches Signed-off-by: Kashish Mittal <[email protected]> * fix package.json rh-pre-commit.version: 2.3.2 rh-pre-commit.check-secrets: ENABLED * update yarn.lock after previous fix rh-pre-commit.version: 2.3.2 rh-pre-commit.check-secrets: ENABLED --------- Signed-off-by: Kashish Mittal <[email protected]> Co-authored-by: Kashish Mittal <[email protected]> --------- Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Signed-off-by: Jessica He <[email protected]> Signed-off-by: Kashish Mittal <[email protected]> Co-authored-by: rhdh-gh-app[bot] <158537950+rhdh-gh-app[bot]@users.noreply.github.com> Co-authored-by: Omar Al Jaljuli <[email protected]> Co-authored-by: Jessica He <[email protected]> Co-authored-by: Kashish Mittal <[email protected]>
1 parent 4d65f5a commit 8b23c81

File tree

114 files changed

+2779
-6214
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

114 files changed

+2779
-6214
lines changed

.yarn/patches/@backstage-plugin-auth-backend-module-atlassian-provider-npm-0.3.4-c82f4982c5.patch .yarn/patches/@backstage-plugin-auth-backend-module-atlassian-provider-npm-0.4.0-e8dd78a36d.patch

+9-14
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@ index 48136a1320584e3af0abfd4b7e5d28bfc77368f6..bde4ec87b64984d49397a85564264bbb
1414

1515
export { atlassianAuthenticator, atlassianSignInResolvers, authModuleAtlassianProvider as default };
1616
diff --git a/dist/resolvers.cjs.js b/dist/resolvers.cjs.js
17-
index 58621485a7d045b7c26dc1e28814c8f5c9f15729..326f6070dfbb4b7e5fe854d7f497d916d75c0a3a 100644
17+
index 58621485a7d045b7c26dc1e28814c8f5c9f15729..8e98243547fc5c8d3bbfef50489b34bdc47843ac 100644
1818
--- a/dist/resolvers.cjs.js
1919
+++ b/dist/resolvers.cjs.js
20-
@@ -1,18 +1,31 @@
20+
@@ -1,18 +1,26 @@
2121
'use strict';
2222

2323
var pluginAuthNode = require('@backstage/plugin-auth-node');
@@ -38,25 +38,20 @@ index 58621485a7d045b7c26dc1e28814c8f5c9f15729..326f6070dfbb4b7e5fe854d7f497d916
3838
throw new Error(`Atlassian user profile does not contain a username`);
3939
}
4040
- return ctx.signInWithCatalogUser({ entityRef: { name: id } });
41-
+ try {
42-
+ return await ctx.signInWithCatalogUser({ entityRef: { name: id } });
43-
+ } catch (error) {
44-
+ return await pluginAuthNode.handleSignInUserNotFound({
45-
+ ctx,
46-
+ error,
47-
+ userEntityName: id,
48-
+ dangerouslyAllowSignInWithoutUserInCatalog: options?.dangerouslyAllowSignInWithoutUserInCatalog
49-
+ });
50-
+ }
41+
+ return ctx.signInWithCatalogUser(
42+
+ { entityRef: { name: id } },
43+
+ id,
44+
+ options?.dangerouslyAllowSignInWithoutUserInCatalog
45+
+ );
5146
};
5247
}
5348
});
5449
diff --git a/dist/resolvers.cjs.js.map b/dist/resolvers.cjs.js.map
55-
index 050a899e3e01fa6023a99fc63ce5fbcbfb14450e..89e1c3f72e24ae552f8a944953d16633a37deb54 100644
50+
index 050a899e3e01fa6023a99fc63ce5fbcbfb14450e..21de910979770f9109f5ce05924ba42d499e05e9 100644
5651
--- a/dist/resolvers.cjs.js.map
5752
+++ b/dist/resolvers.cjs.js.map
5853
@@ -1 +1 @@
5954
-{"version":3,"file":"resolvers.cjs.js","sources":["../src/resolvers.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 {\n createSignInResolverFactory,\n OAuthAuthenticatorResult,\n PassportProfile,\n SignInInfo,\n} from '@backstage/plugin-auth-node';\n\n/**\n * Available sign-in resolvers for the Atlassian auth provider.\n *\n * @public\n */\nexport namespace atlassianSignInResolvers {\n /**\n * Looks up the user by matching their Atlassian username to the entity name.\n */\n export const usernameMatchingUserEntityName = createSignInResolverFactory({\n create() {\n return async (\n info: SignInInfo<OAuthAuthenticatorResult<PassportProfile>>,\n ctx,\n ) => {\n const { result } = info;\n\n const id = result.fullProfile.username;\n if (!id) {\n throw new Error(`Atlassian user profile does not contain a username`);\n }\n\n return ctx.signInWithCatalogUser({ entityRef: { name: id } });\n };\n },\n });\n}\n"],"names":["atlassianSignInResolvers","createSignInResolverFactory"],"mappings":";;;;AA4BiBA;AAAA,CAAV,CAAUA,yBAAV,KAAA;AAIE,EAAMA,yBAAAA,CAAA,iCAAiCC,0CAA4B,CAAA;AAAA,IACxE,MAAS,GAAA;AACP,MAAO,OAAA,OACL,MACA,GACG,KAAA;AACH,QAAM,MAAA,EAAE,QAAW,GAAA,IAAA;AAEnB,QAAM,MAAA,EAAA,GAAK,OAAO,WAAY,CAAA,QAAA;AAC9B,QAAA,IAAI,CAAC,EAAI,EAAA;AACP,UAAM,MAAA,IAAI,MAAM,CAAoD,kDAAA,CAAA,CAAA;AAAA;AAGtE,QAAO,OAAA,GAAA,CAAI,sBAAsB,EAAE,SAAA,EAAW,EAAE,IAAM,EAAA,EAAA,IAAM,CAAA;AAAA,OAC9D;AAAA;AACF,GACD,CAAA;AAAA,CApBc,EAAAD,gCAAA,KAAAA,gCAAA,GAAA,EAAA,CAAA,CAAA;;"}
6055
\ No newline at end of file
61-
+{"version":3,"file":"resolvers.cjs.js","sources":["../src/resolvers.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 {\n createSignInResolverFactory,\n handleSignInUserNotFound,\n OAuthAuthenticatorResult,\n PassportProfile,\n SignInInfo,\n} from '@backstage/plugin-auth-node';\nimport { z } from 'zod';\n\n/**\n * Available sign-in resolvers for the Atlassian auth provider.\n *\n * @public\n */\nexport namespace atlassianSignInResolvers {\n /**\n * Looks up the user by matching their Atlassian username to the entity name.\n */\n export const usernameMatchingUserEntityName = createSignInResolverFactory({\n optionsSchema: z\n .object({\n dangerouslyAllowSignInWithoutUserInCatalog: z.boolean().optional(),\n })\n .optional(),\n create(options = {}) {\n return async (\n info: SignInInfo<OAuthAuthenticatorResult<PassportProfile>>,\n ctx,\n ) => {\n const { result } = info;\n\n const id = result.fullProfile.username;\n if (!id) {\n throw new Error(`Atlassian user profile does not contain a username`);\n }\n\n try {\n return await ctx.signInWithCatalogUser({ entityRef: { name: id } });\n } catch (error) {\n return await handleSignInUserNotFound({\n ctx,\n error,\n userEntityName: id,\n dangerouslyAllowSignInWithoutUserInCatalog:\n options?.dangerouslyAllowSignInWithoutUserInCatalog,\n });\n }\n };\n },\n });\n}\n"],"names":["atlassianSignInResolvers","createSignInResolverFactory","z","handleSignInUserNotFound"],"mappings":";;;;;AA8BiBA;AAAA,CAAV,CAAUA,yBAAV,KAAA;AAIE,EAAMA,yBAAAA,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,OACL,MACA,GACG,KAAA;AACH,QAAM,MAAA,EAAE,QAAW,GAAA,IAAA;AAEnB,QAAM,MAAA,EAAA,GAAK,OAAO,WAAY,CAAA,QAAA;AAC9B,QAAA,IAAI,CAAC,EAAI,EAAA;AACP,UAAM,MAAA,IAAI,MAAM,CAAoD,kDAAA,CAAA,CAAA;AAAA;AAGtE,QAAI,IAAA;AACF,UAAO,OAAA,MAAM,IAAI,qBAAsB,CAAA,EAAE,WAAW,EAAE,IAAA,EAAM,EAAG,EAAA,EAAG,CAAA;AAAA,iBAC3D,KAAO,EAAA;AACd,UAAA,OAAO,MAAMC,uCAAyB,CAAA;AAAA,YACpC,GAAA;AAAA,YACA,KAAA;AAAA,YACA,cAAgB,EAAA,EAAA;AAAA,YAChB,4CACE,OAAS,EAAA;AAAA,WACZ,CAAA;AAAA;AACH,OACF;AAAA;AACF,GACD,CAAA;AAAA,CAnCc,EAAAH,gCAAA,KAAAA,gCAAA,GAAA,EAAA,CAAA,CAAA;;"}
56+
+{"version":3,"file":"resolvers.cjs.js","sources":["../src/resolvers.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 {\n createSignInResolverFactory,\n OAuthAuthenticatorResult,\n PassportProfile,\n SignInInfo,\n} from '@backstage/plugin-auth-node';\nimport { z } from 'zod';\n\n/**\n * Available sign-in resolvers for the Atlassian auth provider.\n *\n * @public\n */\nexport namespace atlassianSignInResolvers {\n /**\n * Looks up the user by matching their Atlassian username to the entity name.\n */\n export const usernameMatchingUserEntityName = createSignInResolverFactory({\n optionsSchema: z\n .object({\n dangerouslyAllowSignInWithoutUserInCatalog: z.boolean().optional(),\n })\n .optional(),\n create(options = {}) {\n return async (\n info: SignInInfo<OAuthAuthenticatorResult<PassportProfile>>,\n ctx,\n ) => {\n const { result } = info;\n\n const id = result.fullProfile.username;\n if (!id) {\n throw new Error(`Atlassian user profile does not contain a username`);\n }\n\n return ctx.signInWithCatalogUser(\n { entityRef: { name: id } },\n id,\n options?.dangerouslyAllowSignInWithoutUserInCatalog,\n );\n };\n },\n });\n}\n"],"names":["atlassianSignInResolvers","createSignInResolverFactory","z"],"mappings":";;;;;AA6BiBA;AAAA,CAAV,CAAUA,yBAAV,KAAA;AAIE,EAAMA,yBAAAA,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,OACL,MACA,GACG,KAAA;AACH,QAAM,MAAA,EAAE,QAAW,GAAA,IAAA;AAEnB,QAAM,MAAA,EAAA,GAAK,OAAO,WAAY,CAAA,QAAA;AAC9B,QAAA,IAAI,CAAC,EAAI,EAAA;AACP,UAAM,MAAA,IAAI,MAAM,CAAoD,kDAAA,CAAA,CAAA;AAAA;AAGtE,QAAA,OAAO,GAAI,CAAA,qBAAA;AAAA,UACT,EAAE,SAAA,EAAW,EAAE,IAAA,EAAM,IAAK,EAAA;AAAA,UAC1B,EAAA;AAAA,UACA,OAAS,EAAA;AAAA,SACX;AAAA,OACF;AAAA;AACF,GACD,CAAA;AAAA,CA7Bc,EAAAF,gCAAA,KAAAA,gCAAA,GAAA,EAAA,CAAA,CAAA;;"}
6257
\ No newline at end of file

.yarn/patches/@backstage-plugin-auth-backend-module-azure-easyauth-provider-npm-0.2.4-a2db8644ad.patch .yarn/patches/@backstage-plugin-auth-backend-module-azure-easyauth-provider-npm-0.2.5-3db4ae0598.patch

+10-15
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ index d10c3f272d0d204402a70d8ce848b745eb9d17c4..fa9d82893de040aa056e3e34cf6ba791
1414

1515
export { type AzureEasyAuthResult, azureEasyAuthAuthenticator, azureEasyAuthSignInResolvers, authModuleAzureEasyAuthProvider as default };
1616
diff --git a/dist/resolvers.cjs.js b/dist/resolvers.cjs.js
17-
index 3da68275e976cc5550755d31c753ad51290a1a8a..907923a989c73acd2d2880e041d3c3d0923e645e 100644
17+
index 3da68275e976cc5550755d31c753ad51290a1a8a..34717c6c4cb6688a078625273e46b2144bd98962 100644
1818
--- a/dist/resolvers.cjs.js
1919
+++ b/dist/resolvers.cjs.js
2020
@@ -1,11 +1,15 @@
@@ -34,7 +34,7 @@ index 3da68275e976cc5550755d31c753ad51290a1a8a..907923a989c73acd2d2880e041d3c3d0
3434
return async (info, ctx) => {
3535
const {
3636
fullProfile: { id }
37-
@@ -13,11 +17,20 @@ exports.azureEasyAuthSignInResolvers = void 0;
37+
@@ -13,11 +17,15 @@ exports.azureEasyAuthSignInResolvers = void 0;
3838
if (!id) {
3939
throw new Error("User profile contained no id");
4040
}
@@ -43,29 +43,24 @@ index 3da68275e976cc5550755d31c753ad51290a1a8a..907923a989c73acd2d2880e041d3c3d0
4343
- "graph.microsoft.com/user-id": id
4444
- }
4545
- });
46-
+ try {
47-
+ return await ctx.signInWithCatalogUser({
46+
+ return ctx.signInWithCatalogUser(
47+
+ {
4848
+ annotations: {
4949
+ "graph.microsoft.com/user-id": id
5050
+ }
51-
+ });
52-
+ } catch (error) {
53-
+ return await pluginAuthNode.handleSignInUserNotFound({
54-
+ ctx,
55-
+ error,
56-
+ userEntityName: id,
57-
+ dangerouslyAllowSignInWithoutUserInCatalog: options?.dangerouslyAllowSignInWithoutUserInCatalog
58-
+ });
59-
+ }
51+
+ },
52+
+ id,
53+
+ options?.dangerouslyAllowSignInWithoutUserInCatalog
54+
+ );
6055
};
6156
}
6257
});
6358
diff --git a/dist/resolvers.cjs.js.map b/dist/resolvers.cjs.js.map
64-
index 4bbdf9fca4676bed9a1545d4208071414aaec854..3680d98a7b72c83224b51f8371869dbe2cf1c5b4 100644
59+
index 4bbdf9fca4676bed9a1545d4208071414aaec854..245b90ff5a09ffde4cadff934465393b52efedf7 100644
6560
--- a/dist/resolvers.cjs.js.map
6661
+++ b/dist/resolvers.cjs.js.map
6762
@@ -1 +1 @@
6863
-{"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;;"}
6964
\ No newline at end of file
70-
+{"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 handleSignInUserNotFound,\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\n try {\n return await ctx.signInWithCatalogUser({\n annotations: {\n 'graph.microsoft.com/user-id': id,\n },\n });\n } catch (error) {\n return await handleSignInUserNotFound({\n ctx,\n error,\n userEntityName: id,\n dangerouslyAllowSignInWithoutUserInCatalog:\n options?.dangerouslyAllowSignInWithoutUserInCatalog,\n });\n }\n };\n },\n });\n}\n"],"names":["azureEasyAuthSignInResolvers","createSignInResolverFactory","z","handleSignInUserNotFound"],"mappings":";;;;;AAyBiBA;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;AAGhD,QAAI,IAAA;AACF,UAAO,OAAA,MAAM,IAAI,qBAAsB,CAAA;AAAA,YACrC,WAAa,EAAA;AAAA,cACX,6BAA+B,EAAA;AAAA;AACjC,WACD,CAAA;AAAA,iBACM,KAAO,EAAA;AACd,UAAA,OAAO,MAAMC,uCAAyB,CAAA;AAAA,YACpC,GAAA;AAAA,YACA,KAAA;AAAA,YACA,cAAgB,EAAA,EAAA;AAAA,YAChB,4CACE,OAAS,EAAA;AAAA,WACZ,CAAA;AAAA;AACH,OACF;AAAA;AACF,GACD,CAAA;AAAA,CAlCc,EAAAH,oCAAA,KAAAA,oCAAA,GAAA,EAAA,CAAA,CAAA;;"}
65+
+{"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 id,\n options?.dangerouslyAllowSignInWithoutUserInCatalog,\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,EAAA;AAAA,UACA,OAAS,EAAA;AAAA,SACX;AAAA,OACF;AAAA;AACF,GACD,CAAA;AAAA,CA3Bc,EAAAF,oCAAA,KAAAA,oCAAA,GAAA,EAAA,CAAA,CAAA;;"}
7166
\ No newline at end of file

0 commit comments

Comments
 (0)