@backstage/plugin-auth-backend-module-azure-easyauth-provider 0.1.1 → 0.1.2-next.1
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 +20 -0
- package/dist/index.cjs.js +5 -7
- package/dist/index.cjs.js.map +1 -1
- package/package.json +6 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,25 @@
|
|
|
1
1
|
# @backstage/plugin-auth-backend-module-azure-easyauth-provider
|
|
2
2
|
|
|
3
|
+
## 0.1.2-next.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies
|
|
8
|
+
- @backstage/backend-plugin-api@0.6.19-next.2
|
|
9
|
+
- @backstage/plugin-auth-node@0.4.14-next.2
|
|
10
|
+
- @backstage/catalog-model@1.5.0
|
|
11
|
+
- @backstage/errors@1.2.4
|
|
12
|
+
|
|
13
|
+
## 0.1.2-next.0
|
|
14
|
+
|
|
15
|
+
### Patch Changes
|
|
16
|
+
|
|
17
|
+
- Updated dependencies
|
|
18
|
+
- @backstage/backend-plugin-api@0.6.19-next.0
|
|
19
|
+
- @backstage/plugin-auth-node@0.4.14-next.0
|
|
20
|
+
- @backstage/catalog-model@1.5.0
|
|
21
|
+
- @backstage/errors@1.2.4
|
|
22
|
+
|
|
3
23
|
## 0.1.1
|
|
4
24
|
|
|
5
25
|
### Patch Changes
|
package/dist/index.cjs.js
CHANGED
|
@@ -11,12 +11,11 @@ const ID_TOKEN_HEADER = "x-ms-token-aad-id-token";
|
|
|
11
11
|
const ACCESS_TOKEN_HEADER = "x-ms-token-aad-access-token";
|
|
12
12
|
const azureEasyAuthAuthenticator = pluginAuthNode.createProxyAuthenticator({
|
|
13
13
|
defaultProfileTransform: async (result) => {
|
|
14
|
-
var _a, _b;
|
|
15
14
|
return {
|
|
16
15
|
profile: {
|
|
17
16
|
displayName: result.fullProfile.displayName,
|
|
18
|
-
email:
|
|
19
|
-
picture:
|
|
17
|
+
email: result.fullProfile.emails?.[0].value,
|
|
18
|
+
picture: result.fullProfile.photos?.[0].value
|
|
20
19
|
}
|
|
21
20
|
};
|
|
22
21
|
},
|
|
@@ -103,17 +102,16 @@ const authModuleAzureEasyAuthProvider = backendPluginApi.createBackendModule({
|
|
|
103
102
|
}
|
|
104
103
|
});
|
|
105
104
|
function validateAppServiceConfiguration(env) {
|
|
106
|
-
var _a, _b, _c;
|
|
107
105
|
if (env.WEBSITE_SKU === void 0) {
|
|
108
106
|
throw new Error("Backstage is not running on Azure App Services");
|
|
109
107
|
}
|
|
110
|
-
if (
|
|
108
|
+
if (env.WEBSITE_AUTH_ENABLED?.toLocaleLowerCase("en-US") !== "true") {
|
|
111
109
|
throw new Error("Azure App Services does not have authentication enabled");
|
|
112
110
|
}
|
|
113
|
-
if (
|
|
111
|
+
if (env.WEBSITE_AUTH_DEFAULT_PROVIDER?.toLocaleLowerCase("en-US") !== "azureactivedirectory") {
|
|
114
112
|
throw new Error("Authentication provider is not Entra ID");
|
|
115
113
|
}
|
|
116
|
-
if (
|
|
114
|
+
if (env.WEBSITE_AUTH_TOKEN_STORE?.toLocaleLowerCase("en-US") !== "true") {
|
|
117
115
|
throw new Error("Token Store is not enabled");
|
|
118
116
|
}
|
|
119
117
|
}
|
package/dist/index.cjs.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs.js","sources":["../src/authenticator.ts","../src/resolvers.ts","../src/module.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 { AuthenticationError } from '@backstage/errors';\nimport { createProxyAuthenticator } from '@backstage/plugin-auth-node';\nimport { AzureEasyAuthResult } from './types';\nimport { Request } from 'express';\nimport { Profile } from 'passport';\nimport { decodeJwt } from 'jose';\n\nexport const ID_TOKEN_HEADER = 'x-ms-token-aad-id-token';\nexport const ACCESS_TOKEN_HEADER = 'x-ms-token-aad-access-token';\n\n/** @public */\nexport const azureEasyAuthAuthenticator = createProxyAuthenticator({\n defaultProfileTransform: async (result: AzureEasyAuthResult) => {\n return {\n profile: {\n displayName: result.fullProfile.displayName,\n email: result.fullProfile.emails?.[0].value,\n picture: result.fullProfile.photos?.[0].value,\n },\n };\n },\n initialize() {},\n async authenticate({ req }) {\n const result = await getResult(req);\n return {\n result,\n providerInfo: {\n accessToken: result.accessToken,\n },\n };\n },\n});\n\nasync function getResult(req: Request): Promise<AzureEasyAuthResult> {\n const idToken = req.header(ID_TOKEN_HEADER);\n const accessToken = req.header(ACCESS_TOKEN_HEADER);\n if (idToken === undefined) {\n throw new AuthenticationError(`Missing ${ID_TOKEN_HEADER} header`);\n }\n\n return {\n fullProfile: idTokenToProfile(idToken),\n accessToken: accessToken,\n };\n}\n\nfunction idTokenToProfile(idToken: string) {\n const claims = decodeJwt(idToken);\n\n if (claims.ver !== '2.0') {\n throw new Error('id_token is not version 2.0 ');\n }\n\n return {\n id: claims.oid,\n displayName: claims.name,\n provider: 'easyauth',\n emails: [{ value: claims.email }],\n username: claims.preferred_username,\n } as Profile;\n}\n","/*\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","/*\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 { createBackendModule } from '@backstage/backend-plugin-api';\nimport {\n authProvidersExtensionPoint,\n commonSignInResolvers,\n createProxyAuthProviderFactory,\n} from '@backstage/plugin-auth-node';\nimport { azureEasyAuthAuthenticator } from './authenticator';\nimport { azureEasyAuthSignInResolvers } from './resolvers';\n\n/** @public */\nexport const authModuleAzureEasyAuthProvider = createBackendModule({\n pluginId: 'auth',\n moduleId: 'azure-easyauth-provider',\n register(reg) {\n reg.registerInit({\n deps: {\n providers: authProvidersExtensionPoint,\n },\n async init({ providers }) {\n validateAppServiceConfiguration(process.env);\n providers.registerProvider({\n providerId: 'azureEasyAuth',\n factory: createProxyAuthProviderFactory({\n authenticator: azureEasyAuthAuthenticator,\n signInResolverFactories: {\n ...commonSignInResolvers,\n ...azureEasyAuthSignInResolvers,\n },\n }),\n });\n },\n });\n },\n});\n\nfunction validateAppServiceConfiguration(env: NodeJS.ProcessEnv) {\n // Based on https://github.com/AzureAD/microsoft-identity-web/blob/f7403779d1a91f4a3fec0ed0993bd82f50f299e1/src/Microsoft.Identity.Web/AppServicesAuth/AppServicesAuthenticationInformation.cs#L38-L59\n //\n // It's critical to validate we're really running in a correctly configured Azure App Services,\n // As we rely on App Services to manage & validate the ID and Access Token headers\n // Without that, this users can be trivially impersonated.\n if (env.WEBSITE_SKU === undefined) {\n throw new Error('Backstage is not running on Azure App Services');\n }\n if (env.WEBSITE_AUTH_ENABLED?.toLocaleLowerCase('en-US') !== 'true') {\n throw new Error('Azure App Services does not have authentication enabled');\n }\n if (\n env.WEBSITE_AUTH_DEFAULT_PROVIDER?.toLocaleLowerCase('en-US') !==\n 'azureactivedirectory'\n ) {\n throw new Error('Authentication provider is not Entra ID');\n }\n if (env.WEBSITE_AUTH_TOKEN_STORE?.toLocaleLowerCase('en-US') !== 'true') {\n throw new Error('Token Store is not enabled');\n }\n}\n"],"names":["createProxyAuthenticator","AuthenticationError","decodeJwt","azureEasyAuthSignInResolvers","createSignInResolverFactory","createBackendModule","authProvidersExtensionPoint","createProxyAuthProviderFactory","commonSignInResolvers"],"mappings":";;;;;;;;;AAuBO,MAAM,eAAkB,GAAA,yBAAA,CAAA;AACxB,MAAM,mBAAsB,GAAA,6BAAA,CAAA;AAG5B,MAAM,6BAA6BA,uCAAyB,CAAA;AAAA,EACjE,uBAAA,EAAyB,OAAO,MAAgC,KAAA;AA5BlE,IAAA,IAAA,EAAA,EAAA,EAAA,CAAA;AA6BI,IAAO,OAAA;AAAA,MACL,OAAS,EAAA;AAAA,QACP,WAAA,EAAa,OAAO,WAAY,CAAA,WAAA;AAAA,QAChC,KAAO,EAAA,CAAA,EAAA,GAAA,MAAA,CAAO,WAAY,CAAA,MAAA,KAAnB,mBAA4B,CAAG,CAAA,CAAA,KAAA;AAAA,QACtC,OAAS,EAAA,CAAA,EAAA,GAAA,MAAA,CAAO,WAAY,CAAA,MAAA,KAAnB,mBAA4B,CAAG,CAAA,CAAA,KAAA;AAAA,OAC1C;AAAA,KACF,CAAA;AAAA,GACF;AAAA,EACA,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AwB,EAAA;AAnDjE,EAAA,IAAA,EAAA,EAAA,EAAA,EAAA,EAAA,CAAA;AAyDE,EAAI,IAAA,GAAA,CAAI,gBAAgB,KAAW,CAAA,EAAA;AACjC,IAAM,MAAA,IAAI,MAAM,gDAAgD,CAAA,CAAA;AAAA,GAClE;AACA,EAAA,IAAA,CAAA,CAAI,EAAI,GAAA,GAAA,CAAA,oBAAA,KAAJ,IAA0B,GAAA,KAAA,CAAA,GAAA,EAAA,CAAA,iBAAA,CAAkB,cAAa,MAAQ,EAAA;AACnE,IAAM,MAAA,IAAI,MAAM,yDAAyD,CAAA,CAAA;AAAA,GAC3E;AACA,EAAA,IAAA,CAAA,CACE,EAAI,GAAA,GAAA,CAAA,6BAAA,KAAJ,IAAmC,GAAA,KAAA,CAAA,GAAA,EAAA,CAAA,iBAAA,CAAkB,cACrD,sBACA,EAAA;AACA,IAAM,MAAA,IAAI,MAAM,yCAAyC,CAAA,CAAA;AAAA,GAC3D;AACA,EAAA,IAAA,CAAA,CAAI,EAAI,GAAA,GAAA,CAAA,wBAAA,KAAJ,IAA8B,GAAA,KAAA,CAAA,GAAA,EAAA,CAAA,iBAAA,CAAkB,cAAa,MAAQ,EAAA;AACvE,IAAM,MAAA,IAAI,MAAM,4BAA4B,CAAA,CAAA;AAAA,GAC9C;AACF;;;;;"}
|
|
1
|
+
{"version":3,"file":"index.cjs.js","sources":["../src/authenticator.ts","../src/resolvers.ts","../src/module.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 { AuthenticationError } from '@backstage/errors';\nimport { createProxyAuthenticator } from '@backstage/plugin-auth-node';\nimport { AzureEasyAuthResult } from './types';\nimport { Request } from 'express';\nimport { Profile } from 'passport';\nimport { decodeJwt } from 'jose';\n\nexport const ID_TOKEN_HEADER = 'x-ms-token-aad-id-token';\nexport const ACCESS_TOKEN_HEADER = 'x-ms-token-aad-access-token';\n\n/** @public */\nexport const azureEasyAuthAuthenticator = createProxyAuthenticator({\n defaultProfileTransform: async (result: AzureEasyAuthResult) => {\n return {\n profile: {\n displayName: result.fullProfile.displayName,\n email: result.fullProfile.emails?.[0].value,\n picture: result.fullProfile.photos?.[0].value,\n },\n };\n },\n initialize() {},\n async authenticate({ req }) {\n const result = await getResult(req);\n return {\n result,\n providerInfo: {\n accessToken: result.accessToken,\n },\n };\n },\n});\n\nasync function getResult(req: Request): Promise<AzureEasyAuthResult> {\n const idToken = req.header(ID_TOKEN_HEADER);\n const accessToken = req.header(ACCESS_TOKEN_HEADER);\n if (idToken === undefined) {\n throw new AuthenticationError(`Missing ${ID_TOKEN_HEADER} header`);\n }\n\n return {\n fullProfile: idTokenToProfile(idToken),\n accessToken: accessToken,\n };\n}\n\nfunction idTokenToProfile(idToken: string) {\n const claims = decodeJwt(idToken);\n\n if (claims.ver !== '2.0') {\n throw new Error('id_token is not version 2.0 ');\n }\n\n return {\n id: claims.oid,\n displayName: claims.name,\n provider: 'easyauth',\n emails: [{ value: claims.email }],\n username: claims.preferred_username,\n } as Profile;\n}\n","/*\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","/*\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 { createBackendModule } from '@backstage/backend-plugin-api';\nimport {\n authProvidersExtensionPoint,\n commonSignInResolvers,\n createProxyAuthProviderFactory,\n} from '@backstage/plugin-auth-node';\nimport { azureEasyAuthAuthenticator } from './authenticator';\nimport { azureEasyAuthSignInResolvers } from './resolvers';\n\n/** @public */\nexport const authModuleAzureEasyAuthProvider = createBackendModule({\n pluginId: 'auth',\n moduleId: 'azure-easyauth-provider',\n register(reg) {\n reg.registerInit({\n deps: {\n providers: authProvidersExtensionPoint,\n },\n async init({ providers }) {\n validateAppServiceConfiguration(process.env);\n providers.registerProvider({\n providerId: 'azureEasyAuth',\n factory: createProxyAuthProviderFactory({\n authenticator: azureEasyAuthAuthenticator,\n signInResolverFactories: {\n ...commonSignInResolvers,\n ...azureEasyAuthSignInResolvers,\n },\n }),\n });\n },\n });\n },\n});\n\nfunction validateAppServiceConfiguration(env: NodeJS.ProcessEnv) {\n // Based on https://github.com/AzureAD/microsoft-identity-web/blob/f7403779d1a91f4a3fec0ed0993bd82f50f299e1/src/Microsoft.Identity.Web/AppServicesAuth/AppServicesAuthenticationInformation.cs#L38-L59\n //\n // It's critical to validate we're really running in a correctly configured Azure App Services,\n // As we rely on App Services to manage & validate the ID and Access Token headers\n // Without that, this users can be trivially impersonated.\n if (env.WEBSITE_SKU === undefined) {\n throw new Error('Backstage is not running on Azure App Services');\n }\n if (env.WEBSITE_AUTH_ENABLED?.toLocaleLowerCase('en-US') !== 'true') {\n throw new Error('Azure App Services does not have authentication enabled');\n }\n if (\n env.WEBSITE_AUTH_DEFAULT_PROVIDER?.toLocaleLowerCase('en-US') !==\n 'azureactivedirectory'\n ) {\n throw new Error('Authentication provider is not Entra ID');\n }\n if (env.WEBSITE_AUTH_TOKEN_STORE?.toLocaleLowerCase('en-US') !== 'true') {\n throw new Error('Token Store is not enabled');\n }\n}\n"],"names":["createProxyAuthenticator","AuthenticationError","decodeJwt","azureEasyAuthSignInResolvers","createSignInResolverFactory","createBackendModule","authProvidersExtensionPoint","createProxyAuthProviderFactory","commonSignInResolvers"],"mappings":";;;;;;;;;AAuBO,MAAM,eAAkB,GAAA,yBAAA,CAAA;AACxB,MAAM,mBAAsB,GAAA,6BAAA,CAAA;AAG5B,MAAM,6BAA6BA,uCAAyB,CAAA;AAAA,EACjE,uBAAA,EAAyB,OAAO,MAAgC,KAAA;AAC9D,IAAO,OAAA;AAAA,MACL,OAAS,EAAA;AAAA,QACP,WAAA,EAAa,OAAO,WAAY,CAAA,WAAA;AAAA,QAChC,KAAO,EAAA,MAAA,CAAO,WAAY,CAAA,MAAA,GAAS,CAAC,CAAE,CAAA,KAAA;AAAA,QACtC,OAAS,EAAA,MAAA,CAAO,WAAY,CAAA,MAAA,GAAS,CAAC,CAAE,CAAA,KAAA;AAAA,OAC1C;AAAA,KACF,CAAA;AAAA,GACF;AAAA,EACA,UAAa,GAAA;AAAA,GAAC;AAAA,EACd,MAAM,YAAA,CAAa,EAAE,GAAA,EAAO,EAAA;AAC1B,IAAM,MAAA,MAAA,GAAS,MAAM,SAAA,CAAU,GAAG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AACA,EAAA,IAAI,GAAI,CAAA,oBAAA,EAAsB,iBAAkB,CAAA,OAAO,MAAM,MAAQ,EAAA;AACnE,IAAM,MAAA,IAAI,MAAM,yDAAyD,CAAA,CAAA;AAAA,GAC3E;AACA,EAAA,IACE,GAAI,CAAA,6BAAA,EAA+B,iBAAkB,CAAA,OAAO,MAC5D,sBACA,EAAA;AACA,IAAM,MAAA,IAAI,MAAM,yCAAyC,CAAA,CAAA;AAAA,GAC3D;AACA,EAAA,IAAI,GAAI,CAAA,wBAAA,EAA0B,iBAAkB,CAAA,OAAO,MAAM,MAAQ,EAAA;AACvE,IAAM,MAAA,IAAI,MAAM,4BAA4B,CAAA,CAAA;AAAA,GAC9C;AACF;;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@backstage/plugin-auth-backend-module-azure-easyauth-provider",
|
|
3
|
-
"version": "0.1.1",
|
|
3
|
+
"version": "0.1.2-next.1",
|
|
4
4
|
"description": "The azure-easyauth-provider backend module for the auth plugin.",
|
|
5
5
|
"backstage": {
|
|
6
6
|
"role": "backend-plugin-module"
|
|
@@ -31,18 +31,18 @@
|
|
|
31
31
|
"test": "backstage-cli package test"
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
|
-
"@backstage/backend-plugin-api": "^0.6.
|
|
34
|
+
"@backstage/backend-plugin-api": "^0.6.19-next.2",
|
|
35
35
|
"@backstage/catalog-model": "^1.5.0",
|
|
36
36
|
"@backstage/errors": "^1.2.4",
|
|
37
|
-
"@backstage/plugin-auth-node": "^0.4.
|
|
37
|
+
"@backstage/plugin-auth-node": "^0.4.14-next.2",
|
|
38
38
|
"@types/passport": "^1.0.16",
|
|
39
39
|
"express": "^4.19.2",
|
|
40
40
|
"jose": "^5.0.0",
|
|
41
41
|
"passport": "^0.7.0"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
44
|
-
"@backstage/backend-test-utils": "^0.
|
|
45
|
-
"@backstage/cli": "^0.26.
|
|
46
|
-
"@backstage/plugin-auth-backend": "^0.22.
|
|
44
|
+
"@backstage/backend-test-utils": "^0.4.0-next.2",
|
|
45
|
+
"@backstage/cli": "^0.26.7-next.2",
|
|
46
|
+
"@backstage/plugin-auth-backend": "^0.22.6-next.2"
|
|
47
47
|
}
|
|
48
48
|
}
|