@jskit-ai/workspaces-core 0.2.72 → 0.2.74
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 +1 -0
- package/package.json +9 -9
- package/src/server/workspaceDirectory/workspaceDirectoryRoutes.js +4 -0
- package/src/server/workspaceMembers/workspaceMembersRoutes.js +7 -0
- package/src/server/workspacePendingInvitations/workspacePendingInvitationsRoutes.js +3 -0
- package/src/server/workspaceSettings/workspaceSettingsRoutes.js +2 -0
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
## Unreleased
|
|
4
4
|
|
|
5
|
+
- The workspace, members, invites, settings and pending invitation routes name the action they run (`actionId`), so a member without the action's permission (`workspace.members.manage`, `workspace.settings.update` and the others) gets 403 before the route validates its query, path or body, instead of 400 with field errors (#497).
|
|
5
6
|
- The manifest marks `runtime.database`, which its migrations need and no server provider of the package requires, as install-time only (`jskit.capabilities.installRequires`), so an app's start-up no longer logs "Package manifest requires a capability its providers do not." for it.
|
|
6
7
|
- `config.workspaceInvitations.anyAccount` (default `false`, which keeps today's rule): with it on, any signed-in account holding an invitation's link may accept it. The invited address, in any letter case, accepts as before. Another address must confirm: the redeem request's new `acceptAs` attribute names the signed-in account's email; without it, or with another value, redeeming answers 409 `workspaces.invite.differentEmailUnconfirmed` ("This invitation was sent to {maskedEmail}. Confirm that you want to join as {email}.", `params.email` the account's address, `params.maskedEmail` the invited one) and changes nothing. A workspace whose new `invitesRequireSameEmail` setting is on still refuses another address with 403 `workspaces.invite.emailMismatchUser`, and refusing stays the invited address's alone. `GET /api/workspace/invitations/resolve` answers `requiresSameEmail`, and the invitation context resolver gives a registration or a provider sign-in from the link the invitation whatever the account's address unless its workspace requires the invited one, carrying the invitation's own email.
|
|
7
8
|
- The workspace setting `invitesRequireSameEmail` (the new migration `workspaces_core_settings_invites_require_same_email`, a `workspace_settings.invites_require_same_email` boolean, NOT NULL, default false; run `npm run db:migrate`), new workspaces' default from `config.workspaceSettings.defaults.invitesRequireSameEmail` (false when unset), written through `PATCH /api/w/:workspaceSlug/settings` under `workspace.settings.update` and optional in every settings write. Reads answer the effective value, true whenever `anyAccount` is off, and `invitesAnyAccountAvailable`.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jskit-ai/workspaces-core",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.74",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"test": "jskit test"
|
|
@@ -24,9 +24,9 @@
|
|
|
24
24
|
"./locales/en.json": "./locales/en.json"
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"@jskit-ai/resource-core": "0.1.
|
|
28
|
-
"@jskit-ai/resource-crud-core": "0.1.
|
|
29
|
-
"@jskit-ai/users-core": "0.2.
|
|
27
|
+
"@jskit-ai/resource-core": "0.1.227",
|
|
28
|
+
"@jskit-ai/resource-crud-core": "0.1.229",
|
|
29
|
+
"@jskit-ai/users-core": "0.2.74",
|
|
30
30
|
"json-rest-schema": "^1.0.20"
|
|
31
31
|
},
|
|
32
32
|
"description": "Workspace tenancy runtime plus HTTP routes, role catalog, and workspace config scaffolding.",
|
|
@@ -219,10 +219,10 @@
|
|
|
219
219
|
}
|
|
220
220
|
},
|
|
221
221
|
"peerDependencies": {
|
|
222
|
-
"@jskit-ai/auth-core": "0.2.
|
|
223
|
-
"@jskit-ai/database-runtime": "0.1.
|
|
224
|
-
"@jskit-ai/http-runtime": "0.2.
|
|
225
|
-
"@jskit-ai/kernel": "0.2.
|
|
226
|
-
"@jskit-ai/resource-runtime": "0.2.
|
|
222
|
+
"@jskit-ai/auth-core": "0.2.41",
|
|
223
|
+
"@jskit-ai/database-runtime": "0.1.293",
|
|
224
|
+
"@jskit-ai/http-runtime": "0.2.37",
|
|
225
|
+
"@jskit-ai/kernel": "0.2.36",
|
|
226
|
+
"@jskit-ai/resource-runtime": "0.2.59"
|
|
227
227
|
}
|
|
228
228
|
}
|
|
@@ -25,6 +25,7 @@ function registerWorkspaceDirectoryRoutes(router, { config, workspaceSelfCreateE
|
|
|
25
25
|
"/api/workspaces",
|
|
26
26
|
{
|
|
27
27
|
auth: "required",
|
|
28
|
+
actionId: "workspace.workspaces.create",
|
|
28
29
|
meta: {
|
|
29
30
|
tags: ["workspace"],
|
|
30
31
|
summary: "Create a workspace for the authenticated user"
|
|
@@ -56,6 +57,7 @@ function registerWorkspaceDirectoryRoutes(router, { config, workspaceSelfCreateE
|
|
|
56
57
|
"/api/workspaces",
|
|
57
58
|
{
|
|
58
59
|
auth: "required",
|
|
60
|
+
actionId: "workspace.workspaces.list",
|
|
59
61
|
meta: {
|
|
60
62
|
tags: ["workspace"],
|
|
61
63
|
summary: "List workspaces visible to authenticated user"
|
|
@@ -80,6 +82,7 @@ function registerWorkspaceDirectoryRoutes(router, { config, workspaceSelfCreateE
|
|
|
80
82
|
resolveWorkspaceRoutePath("/"),
|
|
81
83
|
{
|
|
82
84
|
auth: "required",
|
|
85
|
+
actionId: "workspace.workspaces.read",
|
|
83
86
|
surface: workspaceRouteSurfaceId,
|
|
84
87
|
visibility: "workspace",
|
|
85
88
|
meta: {
|
|
@@ -110,6 +113,7 @@ function registerWorkspaceDirectoryRoutes(router, { config, workspaceSelfCreateE
|
|
|
110
113
|
resolveWorkspaceRoutePath("/"),
|
|
111
114
|
{
|
|
112
115
|
auth: "required",
|
|
116
|
+
actionId: "workspace.workspaces.update",
|
|
113
117
|
surface: workspaceRouteSurfaceId,
|
|
114
118
|
visibility: "workspace",
|
|
115
119
|
meta: {
|
|
@@ -41,6 +41,7 @@ function registerWorkspaceMembersRoutes(router, { config, workspaceInvitationsEn
|
|
|
41
41
|
resolveWorkspaceRoutePath("/roles"),
|
|
42
42
|
{
|
|
43
43
|
auth: "required",
|
|
44
|
+
actionId: "workspace.roles.list",
|
|
44
45
|
surface: workspaceRouteSurfaceId,
|
|
45
46
|
visibility: "workspace",
|
|
46
47
|
contextPolicy: "required",
|
|
@@ -72,6 +73,7 @@ function registerWorkspaceMembersRoutes(router, { config, workspaceInvitationsEn
|
|
|
72
73
|
resolveWorkspaceRoutePath("/members"),
|
|
73
74
|
{
|
|
74
75
|
auth: "required",
|
|
76
|
+
actionId: "workspace.members.list",
|
|
75
77
|
surface: workspaceRouteSurfaceId,
|
|
76
78
|
visibility: "workspace",
|
|
77
79
|
contextPolicy: "required",
|
|
@@ -102,6 +104,7 @@ function registerWorkspaceMembersRoutes(router, { config, workspaceInvitationsEn
|
|
|
102
104
|
resolveWorkspaceRoutePath("/members/:memberUserId/role"),
|
|
103
105
|
{
|
|
104
106
|
auth: "required",
|
|
107
|
+
actionId: "workspace.member.role.update",
|
|
105
108
|
surface: workspaceRouteSurfaceId,
|
|
106
109
|
visibility: "workspace",
|
|
107
110
|
contextPolicy: "required",
|
|
@@ -137,6 +140,7 @@ function registerWorkspaceMembersRoutes(router, { config, workspaceInvitationsEn
|
|
|
137
140
|
resolveWorkspaceRoutePath("/members/:memberUserId"),
|
|
138
141
|
{
|
|
139
142
|
auth: "required",
|
|
143
|
+
actionId: "workspace.member.remove",
|
|
140
144
|
surface: workspaceRouteSurfaceId,
|
|
141
145
|
visibility: "workspace",
|
|
142
146
|
contextPolicy: "required",
|
|
@@ -170,6 +174,7 @@ function registerWorkspaceMembersRoutes(router, { config, workspaceInvitationsEn
|
|
|
170
174
|
resolveWorkspaceRoutePath("/invites"),
|
|
171
175
|
{
|
|
172
176
|
auth: "required",
|
|
177
|
+
actionId: "workspace.invites.list",
|
|
173
178
|
surface: workspaceRouteSurfaceId,
|
|
174
179
|
visibility: "workspace",
|
|
175
180
|
contextPolicy: "required",
|
|
@@ -200,6 +205,7 @@ function registerWorkspaceMembersRoutes(router, { config, workspaceInvitationsEn
|
|
|
200
205
|
resolveWorkspaceRoutePath("/invites"),
|
|
201
206
|
{
|
|
202
207
|
auth: "required",
|
|
208
|
+
actionId: "workspace.invite.create",
|
|
203
209
|
surface: workspaceRouteSurfaceId,
|
|
204
210
|
visibility: "workspace",
|
|
205
211
|
contextPolicy: "required",
|
|
@@ -235,6 +241,7 @@ function registerWorkspaceMembersRoutes(router, { config, workspaceInvitationsEn
|
|
|
235
241
|
resolveWorkspaceRoutePath("/invites/:inviteId"),
|
|
236
242
|
{
|
|
237
243
|
auth: "required",
|
|
244
|
+
actionId: "workspace.invite.revoke",
|
|
238
245
|
surface: workspaceRouteSurfaceId,
|
|
239
246
|
visibility: "workspace",
|
|
240
247
|
contextPolicy: "required",
|
|
@@ -37,6 +37,7 @@ function registerWorkspacePendingInvitationsRoutes(router) {
|
|
|
37
37
|
"/api/workspace/invitations/resolve",
|
|
38
38
|
{
|
|
39
39
|
auth: "public",
|
|
40
|
+
actionId: "workspace.invitation.resolve",
|
|
40
41
|
meta: {
|
|
41
42
|
tags: ["workspace"],
|
|
42
43
|
summary: "Resolve safe public workspace invitation metadata"
|
|
@@ -64,6 +65,7 @@ function registerWorkspacePendingInvitationsRoutes(router) {
|
|
|
64
65
|
"/api/workspace/invitations/pending",
|
|
65
66
|
{
|
|
66
67
|
auth: "required",
|
|
68
|
+
actionId: "workspace.invitations.pending.list",
|
|
67
69
|
meta: {
|
|
68
70
|
tags: ["workspace"],
|
|
69
71
|
summary: "List pending workspace invitations for authenticated user"
|
|
@@ -88,6 +90,7 @@ function registerWorkspacePendingInvitationsRoutes(router) {
|
|
|
88
90
|
"/api/workspace/invitations/redeem",
|
|
89
91
|
{
|
|
90
92
|
auth: "required",
|
|
93
|
+
actionId: "workspace.invite.redeem",
|
|
91
94
|
meta: {
|
|
92
95
|
tags: ["workspace"],
|
|
93
96
|
summary: "Accept or refuse a workspace invitation using an invite token"
|
|
@@ -18,6 +18,7 @@ function registerWorkspaceSettingsRoutes(router, { config }) {
|
|
|
18
18
|
resolveWorkspaceRoutePath("/settings"),
|
|
19
19
|
{
|
|
20
20
|
auth: "required",
|
|
21
|
+
actionId: "workspace.settings.read",
|
|
21
22
|
surface: workspaceRouteSurfaceId,
|
|
22
23
|
visibility: "workspace",
|
|
23
24
|
meta: {
|
|
@@ -48,6 +49,7 @@ function registerWorkspaceSettingsRoutes(router, { config }) {
|
|
|
48
49
|
resolveWorkspaceRoutePath("/settings"),
|
|
49
50
|
{
|
|
50
51
|
auth: "required",
|
|
52
|
+
actionId: "workspace.settings.update",
|
|
51
53
|
surface: workspaceRouteSurfaceId,
|
|
52
54
|
visibility: "workspace",
|
|
53
55
|
meta: {
|