@backstage/plugin-auth-node 0.6.3-next.2 → 0.6.3
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 +51 -0
- package/package.json +10 -10
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,56 @@
|
|
|
1
1
|
# @backstage/plugin-auth-node
|
|
2
2
|
|
|
3
|
+
## 0.6.3
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 332e934: Added the `identity` property to `BackstageSignInResult`.
|
|
8
|
+
|
|
9
|
+
The `prepareBackstageIdentityResponse` function will now also forward the `identity` to the response if present in the provided sign-in result.
|
|
10
|
+
|
|
11
|
+
- ab53e6f: Added a new `dangerousEntityRefFallback` option to the `signInWithCatalogUser` method in `AuthResolverContext`. The option will cause the provided entity reference to be used as a fallback in case the user is not found in the catalog. It is up to the caller to provide the fallback entity reference.
|
|
12
|
+
|
|
13
|
+
Auth providers that include pre-defined sign-in resolvers are encouraged to define a flag named `dangerouslyAllowSignInWithoutUserInCatalog` in their config, which in turn enables use of the `dangerousEntityRefFallback` option. For example:
|
|
14
|
+
|
|
15
|
+
```ts
|
|
16
|
+
export const usernameMatchingUserEntityName = createSignInResolverFactory({
|
|
17
|
+
optionsSchema: z
|
|
18
|
+
.object({
|
|
19
|
+
dangerouslyAllowSignInWithoutUserInCatalog: z.boolean().optional(),
|
|
20
|
+
})
|
|
21
|
+
.optional(),
|
|
22
|
+
create(options = {}) {
|
|
23
|
+
return async (
|
|
24
|
+
info: SignInInfo<OAuthAuthenticatorResult<PassportProfile>>,
|
|
25
|
+
ctx,
|
|
26
|
+
) => {
|
|
27
|
+
const { username } = info.result.fullProfile;
|
|
28
|
+
if (!username) {
|
|
29
|
+
throw new Error('User profile does not contain a username');
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
return ctx.signInWithCatalogUser(
|
|
33
|
+
{ entityRef: { name: username } },
|
|
34
|
+
{
|
|
35
|
+
dangerousEntityRefFallback:
|
|
36
|
+
options?.dangerouslyAllowSignInWithoutUserInCatalog
|
|
37
|
+
? { entityRef: { name: username } }
|
|
38
|
+
: undefined,
|
|
39
|
+
},
|
|
40
|
+
);
|
|
41
|
+
};
|
|
42
|
+
},
|
|
43
|
+
});
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
- Updated dependencies
|
|
47
|
+
- @backstage/catalog-model@1.7.4
|
|
48
|
+
- @backstage/backend-plugin-api@1.3.1
|
|
49
|
+
- @backstage/catalog-client@1.10.0
|
|
50
|
+
- @backstage/config@1.3.2
|
|
51
|
+
- @backstage/errors@1.2.7
|
|
52
|
+
- @backstage/types@1.2.1
|
|
53
|
+
|
|
3
54
|
## 0.6.3-next.2
|
|
4
55
|
|
|
5
56
|
### Patch Changes
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@backstage/plugin-auth-node",
|
|
3
|
-
"version": "0.6.3
|
|
3
|
+
"version": "0.6.3",
|
|
4
4
|
"backstage": {
|
|
5
5
|
"role": "node-library",
|
|
6
6
|
"pluginId": "auth",
|
|
@@ -37,12 +37,12 @@
|
|
|
37
37
|
"test": "backstage-cli package test"
|
|
38
38
|
},
|
|
39
39
|
"dependencies": {
|
|
40
|
-
"@backstage/backend-plugin-api": "1.3.1
|
|
41
|
-
"@backstage/catalog-client": "1.10.0
|
|
42
|
-
"@backstage/catalog-model": "1.7.
|
|
43
|
-
"@backstage/config": "1.3.2",
|
|
44
|
-
"@backstage/errors": "1.2.7",
|
|
45
|
-
"@backstage/types": "1.2.1",
|
|
40
|
+
"@backstage/backend-plugin-api": "^1.3.1",
|
|
41
|
+
"@backstage/catalog-client": "^1.10.0",
|
|
42
|
+
"@backstage/catalog-model": "^1.7.4",
|
|
43
|
+
"@backstage/config": "^1.3.2",
|
|
44
|
+
"@backstage/errors": "^1.2.7",
|
|
45
|
+
"@backstage/types": "^1.2.1",
|
|
46
46
|
"@types/express": "^4.17.6",
|
|
47
47
|
"@types/passport": "^1.0.3",
|
|
48
48
|
"express": "^4.17.1",
|
|
@@ -54,9 +54,9 @@
|
|
|
54
54
|
"zod-validation-error": "^3.4.0"
|
|
55
55
|
},
|
|
56
56
|
"devDependencies": {
|
|
57
|
-
"@backstage/backend-defaults": "0.10.0
|
|
58
|
-
"@backstage/backend-test-utils": "1.5.0
|
|
59
|
-
"@backstage/cli": "0.32.1
|
|
57
|
+
"@backstage/backend-defaults": "^0.10.0",
|
|
58
|
+
"@backstage/backend-test-utils": "^1.5.0",
|
|
59
|
+
"@backstage/cli": "^0.32.1",
|
|
60
60
|
"cookie-parser": "^1.4.6",
|
|
61
61
|
"express-promise-router": "^4.1.1",
|
|
62
62
|
"lodash": "^4.17.21",
|