@7365admin1/core 3.52.16-staging.267 → 3.52.17
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 +23 -0
- package/dist/index.js +5 -7
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +5 -7
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/test/e2e/harness.mjs +2 -5
- package/test/e2e/user-email-lookup-leak.e2e.test.mjs +1 -68
- package/.changeset/patrol-email-scope-restore.md +0 -16
- package/.changeset/role-read-self-arm.md +0 -5
- package/.changeset/user-email-allowlist-subscription-authz.md +0 -21
- package/test/e2e/subscription-read-scope.e2e.test.mjs +0 -182
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,28 @@
|
|
|
1
1
|
# @iservice365/core
|
|
2
2
|
|
|
3
|
+
## 3.52.17
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- edf3a60: Restore and extend the site scoping on the patrol-log email endpoints.
|
|
8
|
+
|
|
9
|
+
#1967 added a `requireSiteReach` guard to `POST /api/patrol-logs/email`. #1981,
|
|
10
|
+
branched before #1967 landed, rewrote the same controller to add the history
|
|
11
|
+
endpoints and dropped the guard. Neither repo runs its tests in CI, so the e2e
|
|
12
|
+
test #1967 shipped has been failing on `main` unnoticed ever since.
|
|
13
|
+
|
|
14
|
+
All five endpoints now resolve the caller from the session: the two that name a
|
|
15
|
+
site (`send`, `getAll`) check that site, and the three that name a record
|
|
16
|
+
(`resend`, `getById`, `deleteById`) check the site stored on the record. The
|
|
17
|
+
`createdBy` pinning is restored with them, so a send cannot be filed under
|
|
18
|
+
another user's name.
|
|
19
|
+
|
|
20
|
+
## 3.52.16
|
|
21
|
+
|
|
22
|
+
### Patch Changes
|
|
23
|
+
|
|
24
|
+
- e9419b3: Scope `GET /api/roles/id/:id`: a caller may read a role they themselves hold (resolved from the session's own `members` rows), otherwise the role's organisation rule applies. Closes the cross-tenant read of any organisation's role name and permissions.
|
|
25
|
+
|
|
3
26
|
## 3.52.15
|
|
4
27
|
|
|
5
28
|
### Patch Changes
|
package/dist/index.js
CHANGED
|
@@ -18680,11 +18680,11 @@ async function requireUserFieldWrite(req, userId, field) {
|
|
|
18680
18680
|
}
|
|
18681
18681
|
|
|
18682
18682
|
// src/utils/user-response.util.ts
|
|
18683
|
-
function
|
|
18683
|
+
function withoutCredentials(user) {
|
|
18684
18684
|
if (!user || typeof user !== "object")
|
|
18685
18685
|
return user;
|
|
18686
|
-
const {
|
|
18687
|
-
return
|
|
18686
|
+
const { password, sid, ...rest } = user;
|
|
18687
|
+
return rest;
|
|
18688
18688
|
}
|
|
18689
18689
|
|
|
18690
18690
|
// src/controllers/user.controller.ts
|
|
@@ -18776,7 +18776,7 @@ function useUserController() {
|
|
|
18776
18776
|
return;
|
|
18777
18777
|
}
|
|
18778
18778
|
const user = await _getByEmail(email);
|
|
18779
|
-
res.json(
|
|
18779
|
+
res.json(withoutCredentials(user));
|
|
18780
18780
|
return;
|
|
18781
18781
|
} catch (error2) {
|
|
18782
18782
|
import_node_server_utils43.logger.log({ level: "error", message: `${error2.message}` });
|
|
@@ -31692,7 +31692,6 @@ function useSubscriptionController() {
|
|
|
31692
31692
|
return;
|
|
31693
31693
|
}
|
|
31694
31694
|
try {
|
|
31695
|
-
await requireOrgAccess(req, _id);
|
|
31696
31695
|
const data = await _getByOrgId(_id);
|
|
31697
31696
|
res.json(data);
|
|
31698
31697
|
return;
|
|
@@ -31719,7 +31718,6 @@ function useSubscriptionController() {
|
|
|
31719
31718
|
const page = parseInt(req.query.page ?? "1");
|
|
31720
31719
|
const status = req.query.status ?? "active";
|
|
31721
31720
|
try {
|
|
31722
|
-
await requirePlatformStaff(req);
|
|
31723
31721
|
const data = await _getSubscriptions({ search, page, status });
|
|
31724
31722
|
res.json(data);
|
|
31725
31723
|
return;
|
|
@@ -86096,7 +86094,7 @@ function useUserControllerV2() {
|
|
|
86096
86094
|
return rejectValidation(error, next);
|
|
86097
86095
|
try {
|
|
86098
86096
|
const user = await _getUserByEmail(value);
|
|
86099
|
-
res.json(
|
|
86097
|
+
res.json(withoutCredentials(user));
|
|
86100
86098
|
return;
|
|
86101
86099
|
} catch (err) {
|
|
86102
86100
|
import_node_server_utils269.logger.log({ level: "error", message: `${err.message}` });
|