@backstage/plugin-auth-backend-module-vmware-cloud-provider 0.0.0-nightly-20241008023419 → 0.0.0-nightly-20241010023300
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 +22 -3
- package/dist/index.cjs.js +0 -5
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +2 -15
- package/dist/module.cjs.js +0 -2
- package/dist/module.cjs.js.map +1 -1
- package/package.json +7 -7
- package/dist/resolvers.cjs.js +0 -42
- package/dist/resolvers.cjs.js.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,12 +1,31 @@
|
|
|
1
1
|
# @backstage/plugin-auth-backend-module-vmware-cloud-provider
|
|
2
2
|
|
|
3
|
-
## 0.0.0-nightly-
|
|
3
|
+
## 0.0.0-nightly-20241010023300
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- d0edfec: **BREAKING**: The `profileEmailMatchingUserEntityEmail` sign-in resolver has been removed as it was using an insecure fallback for resolving user identities. See https://backstage.io/docs/auth/identity-resolver#sign-in-without-users-in-the-catalog for how to create a custom sign-in resolver if needed as a replacement.
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- 217458a: Updated configuration schema to include the new `allowedDomains` option for the `emailLocalPartMatchingUserEntityName` sign-in resolver.
|
|
12
|
+
- Updated dependencies
|
|
13
|
+
- @backstage/plugin-auth-node@0.0.0-nightly-20241010023300
|
|
14
|
+
- @backstage/backend-plugin-api@0.0.0-nightly-20241010023300
|
|
15
|
+
- @backstage/catalog-model@1.7.0
|
|
16
|
+
|
|
17
|
+
## 0.4.0-next.1
|
|
18
|
+
|
|
19
|
+
### Minor Changes
|
|
20
|
+
|
|
21
|
+
- d0edfec: **BREAKING**: The `profileEmailMatchingUserEntityEmail` sign-in resolver has been removed as it was using an insecure fallback for resolving user identities. See https://backstage.io/docs/auth/identity-resolver#sign-in-without-users-in-the-catalog for how to create a custom sign-in resolver if needed as a replacement.
|
|
4
22
|
|
|
5
23
|
### Patch Changes
|
|
6
24
|
|
|
25
|
+
- 217458a: Updated configuration schema to include the new `allowedDomains` option for the `emailLocalPartMatchingUserEntityName` sign-in resolver.
|
|
7
26
|
- Updated dependencies
|
|
8
|
-
- @backstage/plugin-auth-node@0.
|
|
9
|
-
- @backstage/backend-plugin-api@
|
|
27
|
+
- @backstage/plugin-auth-node@0.5.3-next.1
|
|
28
|
+
- @backstage/backend-plugin-api@1.0.1-next.1
|
|
10
29
|
- @backstage/catalog-model@1.7.0
|
|
11
30
|
|
|
12
31
|
## 0.3.1-next.0
|
package/dist/index.cjs.js
CHANGED
|
@@ -4,14 +4,9 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
var authenticator = require('./authenticator.cjs.js');
|
|
6
6
|
var module$1 = require('./module.cjs.js');
|
|
7
|
-
var resolvers = require('./resolvers.cjs.js');
|
|
8
7
|
|
|
9
8
|
|
|
10
9
|
|
|
11
10
|
exports.vmwareCloudAuthenticator = authenticator.vmwareCloudAuthenticator;
|
|
12
11
|
exports.default = module$1.authModuleVmwareCloudProvider;
|
|
13
|
-
Object.defineProperty(exports, "vmwareCloudSignInResolvers", {
|
|
14
|
-
enumerable: true,
|
|
15
|
-
get: function () { return resolvers.vmwareCloudSignInResolvers; }
|
|
16
|
-
});
|
|
17
12
|
//# sourceMappingURL=index.cjs.js.map
|
package/dist/index.cjs.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.cjs.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as _backstage_plugin_auth_node from '@backstage/plugin-auth-node';
|
|
2
|
-
import { PassportOAuthAuthenticatorHelper, PassportProfile
|
|
2
|
+
import { PassportOAuthAuthenticatorHelper, PassportProfile } from '@backstage/plugin-auth-node';
|
|
3
3
|
import { Strategy } from 'passport-oauth2';
|
|
4
4
|
import * as _backstage_backend_plugin_api from '@backstage/backend-plugin-api';
|
|
5
5
|
|
|
@@ -27,17 +27,4 @@ declare const vmwareCloudAuthenticator: _backstage_plugin_auth_node.OAuthAuthent
|
|
|
27
27
|
*/
|
|
28
28
|
declare const authModuleVmwareCloudProvider: _backstage_backend_plugin_api.BackendFeature;
|
|
29
29
|
|
|
30
|
-
|
|
31
|
-
* Available sign-in resolvers for the VMware Cloud auth provider.
|
|
32
|
-
*
|
|
33
|
-
* @public
|
|
34
|
-
*/
|
|
35
|
-
declare namespace vmwareCloudSignInResolvers {
|
|
36
|
-
/**
|
|
37
|
-
* Looks up the user by matching their profile email to the entity's profile email.
|
|
38
|
-
* If that fails, sign in the user without associating with a catalog user.
|
|
39
|
-
*/
|
|
40
|
-
const profileEmailMatchingUserEntityEmail: _backstage_plugin_auth_node.SignInResolverFactory<OAuthAuthenticatorResult<PassportProfile>, unknown>;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
export { type VMwareCloudAuthenticatorContext, type VMwarePassportProfile, authModuleVmwareCloudProvider as default, vmwareCloudAuthenticator, vmwareCloudSignInResolvers };
|
|
30
|
+
export { type VMwareCloudAuthenticatorContext, type VMwarePassportProfile, authModuleVmwareCloudProvider as default, vmwareCloudAuthenticator };
|
package/dist/module.cjs.js
CHANGED
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
var backendPluginApi = require('@backstage/backend-plugin-api');
|
|
4
4
|
var pluginAuthNode = require('@backstage/plugin-auth-node');
|
|
5
5
|
var authenticator = require('./authenticator.cjs.js');
|
|
6
|
-
var resolvers = require('./resolvers.cjs.js');
|
|
7
6
|
|
|
8
7
|
const authModuleVmwareCloudProvider = backendPluginApi.createBackendModule({
|
|
9
8
|
pluginId: "auth",
|
|
@@ -17,7 +16,6 @@ const authModuleVmwareCloudProvider = backendPluginApi.createBackendModule({
|
|
|
17
16
|
factory: pluginAuthNode.createOAuthProviderFactory({
|
|
18
17
|
authenticator: authenticator.vmwareCloudAuthenticator,
|
|
19
18
|
signInResolverFactories: {
|
|
20
|
-
...resolvers.vmwareCloudSignInResolvers,
|
|
21
19
|
...pluginAuthNode.commonSignInResolvers
|
|
22
20
|
}
|
|
23
21
|
})
|
package/dist/module.cjs.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"module.cjs.js","sources":["../src/module.ts"],"sourcesContent":["/*\n * Copyright 2023 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { createBackendModule } from '@backstage/backend-plugin-api';\nimport {\n authProvidersExtensionPoint,\n commonSignInResolvers,\n createOAuthProviderFactory,\n} from '@backstage/plugin-auth-node';\n\nimport { vmwareCloudAuthenticator } from './authenticator';\
|
|
1
|
+
{"version":3,"file":"module.cjs.js","sources":["../src/module.ts"],"sourcesContent":["/*\n * Copyright 2023 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { createBackendModule } from '@backstage/backend-plugin-api';\nimport {\n authProvidersExtensionPoint,\n commonSignInResolvers,\n createOAuthProviderFactory,\n} from '@backstage/plugin-auth-node';\n\nimport { vmwareCloudAuthenticator } from './authenticator';\n\n/**\n * VMware Cloud Provider backend module for the auth plugin\n *\n * @public\n */\nexport const authModuleVmwareCloudProvider = createBackendModule({\n pluginId: 'auth',\n moduleId: 'vmware-cloud-provider',\n register(reg) {\n reg.registerInit({\n deps: { providers: authProvidersExtensionPoint },\n async init({ providers }) {\n providers.registerProvider({\n providerId: 'vmwareCloudServices',\n factory: createOAuthProviderFactory({\n authenticator: vmwareCloudAuthenticator,\n signInResolverFactories: {\n ...commonSignInResolvers,\n },\n }),\n });\n },\n });\n },\n});\n"],"names":["createBackendModule","authProvidersExtensionPoint","createOAuthProviderFactory","vmwareCloudAuthenticator","commonSignInResolvers"],"mappings":";;;;;;AA6BO,MAAM,gCAAgCA,oCAAoB,CAAA;AAAA,EAC/D,QAAU,EAAA,MAAA;AAAA,EACV,QAAU,EAAA,uBAAA;AAAA,EACV,SAAS,GAAK,EAAA;AACZ,IAAA,GAAA,CAAI,YAAa,CAAA;AAAA,MACf,IAAA,EAAM,EAAE,SAAA,EAAWC,0CAA4B,EAAA;AAAA,MAC/C,MAAM,IAAA,CAAK,EAAE,SAAA,EAAa,EAAA;AACxB,QAAA,SAAA,CAAU,gBAAiB,CAAA;AAAA,UACzB,UAAY,EAAA,qBAAA;AAAA,UACZ,SAASC,yCAA2B,CAAA;AAAA,YAClC,aAAe,EAAAC,sCAAA;AAAA,YACf,uBAAyB,EAAA;AAAA,cACvB,GAAGC,oCAAA;AAAA,aACL;AAAA,WACD,CAAA;AAAA,SACF,CAAA,CAAA;AAAA,OACH;AAAA,KACD,CAAA,CAAA;AAAA,GACH;AACF,CAAC;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@backstage/plugin-auth-backend-module-vmware-cloud-provider",
|
|
3
|
-
"version": "0.0.0-nightly-
|
|
3
|
+
"version": "0.0.0-nightly-20241010023300",
|
|
4
4
|
"description": "The vmware-cloud-provider backend module for the auth plugin.",
|
|
5
5
|
"backstage": {
|
|
6
6
|
"role": "backend-plugin-module",
|
|
@@ -33,20 +33,20 @@
|
|
|
33
33
|
"test": "backstage-cli package test"
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@backstage/backend-plugin-api": "0.0.0-nightly-
|
|
36
|
+
"@backstage/backend-plugin-api": "0.0.0-nightly-20241010023300",
|
|
37
37
|
"@backstage/catalog-model": "1.7.0",
|
|
38
|
-
"@backstage/plugin-auth-node": "0.0.0-nightly-
|
|
38
|
+
"@backstage/plugin-auth-node": "0.0.0-nightly-20241010023300",
|
|
39
39
|
"@types/passport-oauth2": "^1.4.15",
|
|
40
40
|
"jose": "^5.0.0",
|
|
41
41
|
"passport-oauth2": "^1.6.1"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
44
|
-
"@backstage/backend-defaults": "0.0.0-nightly-
|
|
45
|
-
"@backstage/backend-test-utils": "0.0.0-nightly-
|
|
46
|
-
"@backstage/cli": "0.0.0-nightly-
|
|
44
|
+
"@backstage/backend-defaults": "0.0.0-nightly-20241010023300",
|
|
45
|
+
"@backstage/backend-test-utils": "0.0.0-nightly-20241010023300",
|
|
46
|
+
"@backstage/cli": "0.0.0-nightly-20241010023300",
|
|
47
47
|
"@backstage/config": "1.2.0",
|
|
48
48
|
"@backstage/errors": "1.2.4",
|
|
49
|
-
"@backstage/plugin-auth-backend": "0.0.0-nightly-
|
|
49
|
+
"@backstage/plugin-auth-backend": "0.0.0-nightly-20241010023300",
|
|
50
50
|
"msw": "^2.0.8",
|
|
51
51
|
"supertest": "^7.0.0"
|
|
52
52
|
}
|
package/dist/resolvers.cjs.js
DELETED
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var catalogModel = require('@backstage/catalog-model');
|
|
4
|
-
var pluginAuthNode = require('@backstage/plugin-auth-node');
|
|
5
|
-
|
|
6
|
-
exports.vmwareCloudSignInResolvers = void 0;
|
|
7
|
-
((vmwareCloudSignInResolvers2) => {
|
|
8
|
-
vmwareCloudSignInResolvers2.profileEmailMatchingUserEntityEmail = pluginAuthNode.createSignInResolverFactory({
|
|
9
|
-
create() {
|
|
10
|
-
return async (info, ctx) => {
|
|
11
|
-
const email = info.profile.email;
|
|
12
|
-
if (!email) {
|
|
13
|
-
throw new Error(
|
|
14
|
-
"VMware login failed, user profile does not contain an email"
|
|
15
|
-
);
|
|
16
|
-
}
|
|
17
|
-
const userEntityRef = catalogModel.stringifyEntityRef({
|
|
18
|
-
kind: "User",
|
|
19
|
-
name: email
|
|
20
|
-
});
|
|
21
|
-
try {
|
|
22
|
-
return await ctx.signInWithCatalogUser({
|
|
23
|
-
filter: {
|
|
24
|
-
"spec.profile.email": email
|
|
25
|
-
}
|
|
26
|
-
});
|
|
27
|
-
} catch (e) {
|
|
28
|
-
if (e.name !== "NotFoundError") {
|
|
29
|
-
throw e;
|
|
30
|
-
}
|
|
31
|
-
return ctx.issueToken({
|
|
32
|
-
claims: {
|
|
33
|
-
sub: userEntityRef,
|
|
34
|
-
ent: [userEntityRef]
|
|
35
|
-
}
|
|
36
|
-
});
|
|
37
|
-
}
|
|
38
|
-
};
|
|
39
|
-
}
|
|
40
|
-
});
|
|
41
|
-
})(exports.vmwareCloudSignInResolvers || (exports.vmwareCloudSignInResolvers = {}));
|
|
42
|
-
//# sourceMappingURL=resolvers.cjs.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"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 */\nimport { stringifyEntityRef } from '@backstage/catalog-model';\nimport {\n createSignInResolverFactory,\n OAuthAuthenticatorResult,\n PassportProfile,\n SignInInfo,\n} from '@backstage/plugin-auth-node';\n\n/**\n * Available sign-in resolvers for the VMware Cloud auth provider.\n *\n * @public\n */\nexport namespace vmwareCloudSignInResolvers {\n /**\n * Looks up the user by matching their profile email to the entity's profile email.\n * If that fails, sign in the user without associating with a catalog user.\n */\n export const profileEmailMatchingUserEntityEmail =\n createSignInResolverFactory({\n create() {\n return async (\n info: SignInInfo<OAuthAuthenticatorResult<PassportProfile>>,\n ctx,\n ) => {\n const email = info.profile.email;\n\n if (!email) {\n throw new Error(\n 'VMware login failed, user profile does not contain an email',\n );\n }\n\n const userEntityRef = stringifyEntityRef({\n kind: 'User',\n name: email,\n });\n\n try {\n // we await here so that signInWithCatalogUser throws in the current `try`\n return await ctx.signInWithCatalogUser({\n filter: {\n 'spec.profile.email': email,\n },\n });\n } catch (e) {\n if (e.name !== 'NotFoundError') {\n throw e;\n }\n return ctx.issueToken({\n claims: {\n sub: userEntityRef,\n ent: [userEntityRef],\n },\n });\n }\n };\n },\n });\n}\n"],"names":["vmwareCloudSignInResolvers","createSignInResolverFactory","stringifyEntityRef"],"mappings":";;;;;AA4BiBA,4CAAA;AAAA,CAAV,CAAUA,2BAAV,KAAA;AAKE,EAAMA,2BAAAA,CAAA,sCACXC,0CAA4B,CAAA;AAAA,IAC1B,MAAS,GAAA;AACP,MAAO,OAAA,OACL,MACA,GACG,KAAA;AACH,QAAM,MAAA,KAAA,GAAQ,KAAK,OAAQ,CAAA,KAAA,CAAA;AAE3B,QAAA,IAAI,CAAC,KAAO,EAAA;AACV,UAAA,MAAM,IAAI,KAAA;AAAA,YACR,6DAAA;AAAA,WACF,CAAA;AAAA,SACF;AAEA,QAAA,MAAM,gBAAgBC,+BAAmB,CAAA;AAAA,UACvC,IAAM,EAAA,MAAA;AAAA,UACN,IAAM,EAAA,KAAA;AAAA,SACP,CAAA,CAAA;AAED,QAAI,IAAA;AAEF,UAAO,OAAA,MAAM,IAAI,qBAAsB,CAAA;AAAA,YACrC,MAAQ,EAAA;AAAA,cACN,oBAAsB,EAAA,KAAA;AAAA,aACxB;AAAA,WACD,CAAA,CAAA;AAAA,iBACM,CAAG,EAAA;AACV,UAAI,IAAA,CAAA,CAAE,SAAS,eAAiB,EAAA;AAC9B,YAAM,MAAA,CAAA,CAAA;AAAA,WACR;AACA,UAAA,OAAO,IAAI,UAAW,CAAA;AAAA,YACpB,MAAQ,EAAA;AAAA,cACN,GAAK,EAAA,aAAA;AAAA,cACL,GAAA,EAAK,CAAC,aAAa,CAAA;AAAA,aACrB;AAAA,WACD,CAAA,CAAA;AAAA,SACH;AAAA,OACF,CAAA;AAAA,KACF;AAAA,GACD,CAAA,CAAA;AAAA,CA7CY,EAAAF,kCAAA,KAAAA,kCAAA,GAAA,EAAA,CAAA,CAAA;;"}
|