@7365admin1/core 3.32.2-staging.9 → 3.32.2-staging.91
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/.changeset/camera-engagement-site-scope.md +15 -0
- package/.changeset/camera-entitlement-engagement.md +45 -0
- package/.changeset/camera-functions-for-patrol.md +42 -0
- package/.changeset/camera-integration-layer.md +60 -0
- package/.changeset/camera-list-site-scoping.md +42 -0
- package/.changeset/camera-monitoring-wall.md +32 -0
- package/.changeset/camera-setup-from-recorder.md +43 -0
- package/.changeset/camera-write-authorization.md +35 -0
- package/.changeset/dahua-credential-logging.md +19 -0
- package/.changeset/dahua-spec-defects.md +20 -0
- package/.changeset/notification-preferences.md +20 -0
- package/.changeset/notifications-session-scoping.md +17 -0
- package/.changeset/service-provider-invite-approval.md +31 -0
- package/.changeset/service-provider-invite-pending-check.md +17 -0
- package/.changeset/site-name-similarity-check.md +26 -0
- package/.github/workflows/publish-staging.yml +11 -0
- package/CHANGELOG.md +515 -0
- package/dist/index.d.ts +2447 -203
- package/dist/index.js +45506 -36611
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +41400 -32593
- package/dist/index.mjs.map +1 -1
- package/docs/camera-integration-config.md +191 -0
- package/package.json +6 -2
- package/scripts/hid-sip-provisioner.mjs +175 -0
- package/test/camera-alert.util.test.mjs +109 -0
- package/test/camera-capability.util.test.mjs +545 -0
- package/test/camera-device-http.test.mjs +792 -0
- package/test/camera-entitlement-wiring.test.mjs +134 -0
- package/test/camera-view.util.test.mjs +892 -0
- package/test/camera-write-gate.test.mjs +121 -0
- package/test/dahua-protocol.util.test.mjs +217 -0
- package/test/e2e/harness.mjs +499 -0
- package/test/e2e/notification-preference.e2e.test.mjs +642 -0
- package/test/e2e/notification-scoping.e2e.test.mjs +332 -0
- package/test/e2e/service-provider-invite-approval.e2e.test.mjs +801 -0
- package/test/e2e/service-provider-invite.e2e.test.mjs +501 -0
- package/test/notification-category.util.test.mjs +147 -0
- package/test/service-provider-invite.test.mjs +321 -0
- package/test/site-name.util.test.mjs +146 -0
- package/.changeset/invite-payload-logging.md +0 -5
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
---
|
|
2
|
+
"@7365admin1/core": patch
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
Camera entitlement: an engagement grants a site only to an org-level membership, and permissions resolve against the granting role
|
|
6
|
+
|
|
7
|
+
Two follow-ups to the camera entitlement change:
|
|
8
|
+
|
|
9
|
+
- the engagement branch of `cameraGrant` ignored `members.siteId`, so a member
|
|
10
|
+
pinned to one site could reach every site their organisation is engaged at.
|
|
11
|
+
It now requires an org-level membership, matching the owning-org branch above
|
|
12
|
+
it: a membership pinned to a site never grants a different site.
|
|
13
|
+
- `getUserPermissions` accepts the granting membership's `role`, so a caller
|
|
14
|
+
holding several memberships in one organisation is no longer resolved by
|
|
15
|
+
whichever member document Mongo returns first.
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
---
|
|
2
|
+
"@7365admin1/core": patch
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
Let camera authorization understand engagements, and resolve it against the
|
|
6
|
+
right organisation.
|
|
7
|
+
|
|
8
|
+
Three defects in the same decision, fixed together because they are the same
|
|
9
|
+
question: "may this person reach this site, and on whose behalf?"
|
|
10
|
+
|
|
11
|
+
**1. An engagement was not an entitlement.** The product routes a service
|
|
12
|
+
provider - a security agency, a property management agency - to a customer's
|
|
13
|
+
site through an ACTIVE `customer.sites` record (`{org: provider, siteOrg: owner,
|
|
14
|
+
site}`). 227 of those are active on staging, 53 of them cross-organisation. It
|
|
15
|
+
is the same list the web apps' own site switcher is drawn from
|
|
16
|
+
(`useCustomerSite().getAll()`). No camera authorization code read it, so a guard
|
|
17
|
+
whose agency is contracted at a site was refused the cameras of the site the
|
|
18
|
+
switcher had just offered them. Measured on staging: **11 people reach a site
|
|
19
|
+
holding an active IP camera by this route and no other, 7 of them on wildcard
|
|
20
|
+
`owner` / `Super Admin` roles** - and across all 200 sites the figure is 125
|
|
21
|
+
people, 43 of them on wildcard roles. Nobody loses access; the change is
|
|
22
|
+
additive.
|
|
23
|
+
|
|
24
|
+
**2. `site.org` does not exist.** `authorizeSite` and `authorizeCamera`
|
|
25
|
+
projected `{org: 1}` and tested `site?.org`. All 200 site documents carry
|
|
26
|
+
`orgId`; not one carries `org`. So the org-level branch of the rule - the branch
|
|
27
|
+
for the 90 membership rows (56 people) that carry no `siteId` - could never
|
|
28
|
+
match. It reads `orgId` now, with `org` kept as a fallback. This WIDENS access,
|
|
29
|
+
so it was measured before it was enabled: on staging it admits **0** additional
|
|
30
|
+
people to a site holding a camera, and 14 across all 200 sites.
|
|
31
|
+
|
|
32
|
+
**3. Permissions resolved against an arbitrary organisation.**
|
|
33
|
+
`getUserPermissions({user, org: memberships[0]?.org})` took whichever membership
|
|
34
|
+
Mongo returned first, which for the 22 people who belong to more than one
|
|
35
|
+
organisation is a coin toss - it could read the permissions of an organisation
|
|
36
|
+
that has nothing to do with the site being asked about. It now resolves against
|
|
37
|
+
the membership that actually granted access.
|
|
38
|
+
|
|
39
|
+
Also splits `entitleSite` (may this person reach this site) out of
|
|
40
|
+
`authorizeSite` (that, plus the permission this particular use needs), so a
|
|
41
|
+
plain read of a site's own camera list can be scoped without also being gated on
|
|
42
|
+
a permission that would strand people who are legitimately at the site.
|
|
43
|
+
|
|
44
|
+
No response field changed. No route changed. No device is contacted by any of
|
|
45
|
+
this.
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
---
|
|
2
|
+
"@7365admin1/core": minor
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
Camera functions for Virtual Patrol, proxied server-side.
|
|
6
|
+
|
|
7
|
+
Adds authenticated camera endpoints so the apps can use a site camera without ever
|
|
8
|
+
holding its credential. Dahua devices authenticate with digest and the cleartext
|
|
9
|
+
password on every request (HTTP API V3.37 §3.4) and the specification offers no
|
|
10
|
+
session or usable token, so the only safe shape is a server-side proxy.
|
|
11
|
+
|
|
12
|
+
- `useCameraViewController` — snapshot, snapshot-to-file for evidence, and
|
|
13
|
+
per-recorder health.
|
|
14
|
+
- A camera record does not hold a device address: `site.cameras.host` is the CCTV
|
|
15
|
+
relay's page URL and its numeric last path segment is the stream channel. A
|
|
16
|
+
camera is therefore resolved as **recorder (from `CAMERA_RTSP_DEVICES`, keyed by
|
|
17
|
+
relay authority) + channel (from the stored host)**. The address and credential
|
|
18
|
+
live in deployment configuration only — never in the database, never in a client.
|
|
19
|
+
- Pictures come off the video stream (one `ffmpeg` frame per snapshot, substream
|
|
20
|
+
for a tile, main stream for an evidence capture). The recorder in use exposes
|
|
21
|
+
RTSP only; its HTTP CGI ports are not reachable, so `snapshot.cgi`, firmware
|
|
22
|
+
(§4.6.14), device clock (§4.6.2) and PTZ (§8.1.5) cannot be used against it.
|
|
23
|
+
Firmware and clock are reported as unavailable with a reason, and PTZ refuses.
|
|
24
|
+
`GET /site-cameras/capabilities` reports `ptz: false` whatever
|
|
25
|
+
`CAMERA_PTZ_ENABLED` says, so a client hides the control rather than drawing a
|
|
26
|
+
pad whose every press fails.
|
|
27
|
+
- A camera whose relay has no configured recorder, or whose address carries no
|
|
28
|
+
channel, is refused up-front with a reason rather than failing as a blank picture.
|
|
29
|
+
- At most `CAMERA_MAX_CONCURRENT_GRABS` (4) pictures are taken at once across the
|
|
30
|
+
process, so the endpoint cannot fill the API host with ffmpeg or overpull the
|
|
31
|
+
recorder; over that, the caller is told the cameras are busy.
|
|
32
|
+
- Access is decided by the caller's site/org membership and their role's
|
|
33
|
+
permissions, never by the camera id in the URL.
|
|
34
|
+
- ANPR units are refused: ANPR belongs to visitor and vehicle management, not to
|
|
35
|
+
Virtual Patrol or CCTV.
|
|
36
|
+
- Camera host, username, password and the RTSP URL are never returned and never
|
|
37
|
+
logged; ffmpeg's stderr is discarded because it echoes the credential.
|
|
38
|
+
- No retry on a camera call: the device locks an account for 1800 s after 3
|
|
39
|
+
failures in 30 s (§4.7.x).
|
|
40
|
+
|
|
41
|
+
Requires `ffmpeg` on the API host (or `CAMERA_FFMPEG_PATH`); where it is absent the
|
|
42
|
+
snapshot endpoints answer with "Video tooling is not available on this server."
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
---
|
|
2
|
+
"@7365admin1/core": minor
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
Camera integration layer: a capability descriptor, a transport registry, and the
|
|
6
|
+
Dahua device HTTP adapter (written, tested, switched off).
|
|
7
|
+
|
|
8
|
+
Every camera in the wall and status responses now carries a `capabilities`
|
|
9
|
+
descriptor: `liveVideo`, `stillFrame`, `digitalZoom`, `ptz`, `presets`,
|
|
10
|
+
`playback`, `events`, `audio`, `deviceInfo`, each `supported` / `unsupported` /
|
|
11
|
+
`unknown` with a machine-readable reason code and one sentence. A client renders
|
|
12
|
+
itself from it without knowing anything about relays, recorders or networks.
|
|
13
|
+
`unknown` is distinct on purpose: "we have not been allowed to ask" is not the
|
|
14
|
+
same fact as "this camera cannot".
|
|
15
|
+
|
|
16
|
+
Capabilities resolve through a transport registry instead of the service picking
|
|
17
|
+
a path. `RELAY_PLAYER` is the stored player-page URL rendered in a WebView (the
|
|
18
|
+
live product's picture path, live video only, no control channel). `RTSP_FRAME`
|
|
19
|
+
is one ffmpeg still off the recorder. `DEVICE_HTTP` is the camera's own CGI API.
|
|
20
|
+
Registration order is preference order, so one camera serves live video over the
|
|
21
|
+
relay and evidence stills over RTSP at the same time, and adding a transport
|
|
22
|
+
later needs no service change.
|
|
23
|
+
|
|
24
|
+
`DEVICE_HTTP` covers device info/version, snapshot, PTZ (continuous, absolute,
|
|
25
|
+
stop), presets (list and recall), recorded-file query with playback URL
|
|
26
|
+
construction, and event subscription - digest auth only, values percent-encoded,
|
|
27
|
+
403 treated as bad credentials and 401 as an ordinary challenge. It contacts
|
|
28
|
+
nothing today: the recorder in this estate answers on RTSP only. Enabling it is
|
|
29
|
+
configuration, not a code change.
|
|
30
|
+
|
|
31
|
+
A shared, persistent authentication failure budget is mandatory on that path. The
|
|
32
|
+
device locks an account for 1800 s after 3 failed logins in 30 s, so failures are
|
|
33
|
+
counted per device in the cache, the budget stops at 2, and once spent no request
|
|
34
|
+
leaves the process. Nothing retries anywhere.
|
|
35
|
+
|
|
36
|
+
Mutating operations are structurally unreachable while disabled: the adapter is
|
|
37
|
+
`null` without `CAMERA_DEVICE_HTTP_ENABLED`, and its `control` object is `null`
|
|
38
|
+
without `CAMERA_DEVICE_CONTROL_ENABLED`. Movement codes are an allow-list;
|
|
39
|
+
`SetPreset`, `ClearPreset`, tours, patterns, `configManager` writes and reboot are
|
|
40
|
+
absent.
|
|
41
|
+
|
|
42
|
+
Capability probing is read-only, cached, budget-aware, never throws, and happens
|
|
43
|
+
only on a deliberate single-camera status request - never as a side effect of a
|
|
44
|
+
list.
|
|
45
|
+
|
|
46
|
+
`host` is now returned for `type: "ip"` cameras on the wall response. It is the
|
|
47
|
+
video relay's player-page URL, not a device address and not a credential, and
|
|
48
|
+
`GET /site-cameras` already returns it to every authenticated caller. `anpr`
|
|
49
|
+
records, whose `host` is a real device endpoint, are excluded by the allow-list
|
|
50
|
+
itself.
|
|
51
|
+
|
|
52
|
+
New configuration, all optional and all off by default: `CAMERA_DEVICE_HTTP`
|
|
53
|
+
(JSON keyed by relay authority, credential referenced by environment variable
|
|
54
|
+
name), `CAMERA_DEVICE_HTTP_ENABLED`, `CAMERA_DEVICE_CONTROL_ENABLED`,
|
|
55
|
+
`CAMERA_DEVICE_HTTP_TIMEOUT_MS` (8000),
|
|
56
|
+
`CAMERA_DEVICE_HTTP_PROBE_TTL_SECONDS` (900). See
|
|
57
|
+
`docs/camera-integration-config.md`.
|
|
58
|
+
|
|
59
|
+
Existing responses keep every field they had, with the same wording, so current
|
|
60
|
+
consumers are unaffected.
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
---
|
|
2
|
+
"@7365admin1/core": patch
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
Scope `GET /site-cameras` to the caller's own site.
|
|
6
|
+
|
|
7
|
+
The site was an OPTIONAL query parameter and nothing on the handler looked at
|
|
8
|
+
the session beyond `requireAuth`. So any signed-in account, in any organisation,
|
|
9
|
+
could page the whole estate's cameras - on staging that is all 15 active IP
|
|
10
|
+
cameras across 3 owner organisations, each record carrying its `host` and its
|
|
11
|
+
`username`. It is the plainest cross-tenant read left in the camera module.
|
|
12
|
+
|
|
13
|
+
`site` is now required, and the caller is authorised against it with
|
|
14
|
+
`entitleSite`: membership of the site, of its owning organisation, or an ACTIVE
|
|
15
|
+
`customer.sites` engagement with it. "Not yours" and "does not exist" answer
|
|
16
|
+
identically, so site ids cannot be enumerated from the difference.
|
|
17
|
+
|
|
18
|
+
**Every caller in the estate already sends `site`** - checked across every
|
|
19
|
+
repository, not assumed:
|
|
20
|
+
|
|
21
|
+
| caller | sends |
|
|
22
|
+
|---|---|
|
|
23
|
+
| `iservice365-mobile-app-security` `pages/cctv/index.vue` (live) | `site`, `type: ip`, `page` |
|
|
24
|
+
| `iservice365-mobile-app-security` `useAnprEnabled` (live) | `site`, `type: anpr` |
|
|
25
|
+
| `iservice365-layer-common` `CameraMain.vue` (Site Settings) | `site`, `type`, `page` |
|
|
26
|
+
| `iservice365-layer-common` `CameraWall.vue` | `site`, `type: ip`, `page` |
|
|
27
|
+
| `iservice365-web-app-security` `VirtualPatrolRoutesForm.vue` | `site`, `type: ip`, `page: 1` |
|
|
28
|
+
| `isecure365-mobile-app` `site.service.ts` `getAnprCameras` | `site`, `type: anpr` |
|
|
29
|
+
|
|
30
|
+
So no running client breaks.
|
|
31
|
+
|
|
32
|
+
Deliberately NOT gated on a camera permission. This is the same list the site's
|
|
33
|
+
own Settings panel and the guard's app have always read; on staging only 25 of
|
|
34
|
+
the 118 people entitled to a site with a camera hold a camera-view permission,
|
|
35
|
+
so a permission gate here would strand people who are legitimately at the site.
|
|
36
|
+
Restricting the read to the caller's own sites is the fix; who among them may
|
|
37
|
+
look is a separate decision that needs its own measurement.
|
|
38
|
+
|
|
39
|
+
The repository's 15-minute cache key already carries the site, so a cached page
|
|
40
|
+
can only be served to callers authorised for that same site. No caller id was
|
|
41
|
+
added to the key - it would make the cache per-person for an answer that is
|
|
42
|
+
identical per site.
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
---
|
|
2
|
+
"@7365admin1/core": minor
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
CCTV monitoring wall: a site-scoped camera list and a batched health sweep.
|
|
6
|
+
|
|
7
|
+
Two additions to the camera proxy so a supervisor can watch a whole site rather
|
|
8
|
+
than one checkpoint at a time.
|
|
9
|
+
|
|
10
|
+
`getSiteWall` returns the cameras of one site from `site.cameras` - the
|
|
11
|
+
collection the real cameras are in - together with the polling intervals and
|
|
12
|
+
fan-out caps the client should use. No device is contacted, so opening a wall is
|
|
13
|
+
one database read. Entitlement is by site membership, not by the id in the URL,
|
|
14
|
+
and a caller outside the site gets the same answer as one asking for a site that
|
|
15
|
+
does not exist.
|
|
16
|
+
|
|
17
|
+
`getSiteHealth` probes the cameras currently on screen with at most
|
|
18
|
+
`CAMERA_WALL_MAX_CONCURRENT_PROBES` in flight. Reachability is a **per-recorder**
|
|
19
|
+
answer, cached per recorder: twelve of this estate's cameras are twelve channels
|
|
20
|
+
on one device, so a full wall is one connect rather than one per tile. It never
|
|
21
|
+
throws for a camera that is down; unreachable is the answer, and a camera whose
|
|
22
|
+
relay has no configured recorder is refused with a reason instead.
|
|
23
|
+
|
|
24
|
+
Firmware version and device clock are reported as unavailable with a reason: they
|
|
25
|
+
are HTTP CGI facts and the recorder in use exposes RTSP only.
|
|
26
|
+
|
|
27
|
+
Snapshots now record when a camera last returned a picture, so a tile can say
|
|
28
|
+
"last frame 40 minutes ago" instead of "never".
|
|
29
|
+
|
|
30
|
+
New, all optional and conservative by default: `CAMERA_WALL_POLL_MS` (5000),
|
|
31
|
+
`CAMERA_SINGLE_POLL_MS` (2000), `CAMERA_WALL_MAX_TILES` (9),
|
|
32
|
+
`CAMERA_WALL_MAX_CONCURRENT_PROBES` (4), `CAMERA_HEALTH_CACHE_SECONDS` (20).
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
---
|
|
2
|
+
"@7365admin1/core": minor
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
Camera setup from the recorder and channel, and a read-only test before saving.
|
|
6
|
+
|
|
7
|
+
A CCTV camera record stores a video-relay player-page URL. Nothing printed on a
|
|
8
|
+
camera or shown in a recorder's own screens tells anybody what that URL is, so
|
|
9
|
+
adding a camera meant asking whoever runs the video service for one address per
|
|
10
|
+
camera and pasting it in unverified.
|
|
11
|
+
|
|
12
|
+
`POST /site-cameras` and `PATCH /site-cameras/id/:id` now also accept
|
|
13
|
+
`recorderHost`, `recorderPort` and `channel`. The server reads the existing
|
|
14
|
+
`CAMERA_RTSP_DEVICES` map backwards - relay authority to recorder becomes
|
|
15
|
+
recorder to relay authority - and derives the same `https://<relay>/<channel>`
|
|
16
|
+
address it has always stored. There is deliberately no second map and no new
|
|
17
|
+
stored field: the recorder fields are consumed by the controller and never reach
|
|
18
|
+
the model, so `site.cameras` keeps exactly the shape it has today.
|
|
19
|
+
|
|
20
|
+
Additive and ordered so: a request that sends `host` behaves exactly as it
|
|
21
|
+
always has, so every camera configured that way and anyone holding a ready-made
|
|
22
|
+
address is unaffected. A recorder with no configured entry is refused with a
|
|
23
|
+
sentence a property manager can act on rather than a code.
|
|
24
|
+
|
|
25
|
+
New: `POST /site-cameras/site/:siteId/test` - does this address actually show a
|
|
26
|
+
picture? Site-scoped because the camera does not exist yet, and it requires
|
|
27
|
+
`site-settings:manage-cctv-camera`. The probe is read only: one TCP connect with
|
|
28
|
+
no credential, then at most one video frame off the stream. There is no mutating
|
|
29
|
+
call in the path.
|
|
30
|
+
|
|
31
|
+
It is rationed before it can reach a device - one test per camera per 15 s, four
|
|
32
|
+
per recorder per 5 minutes - and it consults the shared authentication failure
|
|
33
|
+
budget first, so pressing the button cannot walk a recorder into its own
|
|
34
|
+
3-failures-in-30-seconds, 1800-second lockout. It answers with one of five plain
|
|
35
|
+
sentences and never an address, port, credential or device message.
|
|
36
|
+
|
|
37
|
+
`ffmpeg`'s stderr is now read for one fact - was the handshake rejected - and
|
|
38
|
+
discarded chunk by chunk without being accumulated, logged or returned, so "the
|
|
39
|
+
recorder refused the credential" can be told apart from "the channel is not
|
|
40
|
+
sending video". Snapshot failures gain that distinction too.
|
|
41
|
+
|
|
42
|
+
`authorizeSite` takes an optional permission list; existing callers are unchanged
|
|
43
|
+
and still require the camera view permissions.
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
---
|
|
2
|
+
"@7365admin1/core": minor
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
Authorize creating, editing and deleting a site camera.
|
|
6
|
+
|
|
7
|
+
`POST /site-cameras`, `PATCH /site-cameras/id/:id` and `DELETE
|
|
8
|
+
/site-cameras/id/:id` carried `requireAuth` and nothing else. There was no
|
|
9
|
+
permission check and no site scoping, so any signed-in account in any
|
|
10
|
+
organisation could add a camera to a site it has no relationship with, rewrite
|
|
11
|
+
another customer's camera address, or hard-delete one - the delete is a real
|
|
12
|
+
`deleteOne`, not a soft delete, and it reported success whether or not it matched
|
|
13
|
+
anything.
|
|
14
|
+
|
|
15
|
+
All three now go through `authorizeSite`, the same rule the read paths already
|
|
16
|
+
use: the caller must be a member of the camera's site, and their role must hold
|
|
17
|
+
the permission the Settings panel that draws the button is drawn on -
|
|
18
|
+
`site-settings:manage-cctv-camera` for a CCTV camera, `site-settings:manage-anpr-camera`
|
|
19
|
+
for an ANPR one. One endpoint serves both panels, so the permission follows the
|
|
20
|
+
camera's own `type` rather than being one string for both; asking only for the
|
|
21
|
+
CCTV string would have refused a role provisioned to manage ANPR alone.
|
|
22
|
+
|
|
23
|
+
For `PATCH` and `DELETE` the site and the type are read off the stored camera,
|
|
24
|
+
never off the request - `schemaUpdateSiteCamera` carries neither, and a caller
|
|
25
|
+
must not be able to supply either. A camera the caller may not reach is reported
|
|
26
|
+
exactly as a camera that does not exist, so the difference cannot be used to
|
|
27
|
+
enumerate camera ids.
|
|
28
|
+
|
|
29
|
+
Measured on staging before shipping: of the 107 users entitled to a site that has
|
|
30
|
+
a CCTV camera, 12 pass this gate and every one of them passes on the `*`
|
|
31
|
+
wildcard. No role that would now be refused holds any `site-settings:` string at
|
|
32
|
+
all, so no account that can open the CCTV or ANPR panel today is refused by this
|
|
33
|
+
change.
|
|
34
|
+
|
|
35
|
+
No response shape, status code or field changed for a permitted caller.
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
---
|
|
2
|
+
"@7365admin1/core": patch
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
Stop logging camera and mailer credentials
|
|
6
|
+
|
|
7
|
+
Six places wrote a secret or a resident's details to stdout on an ordinary code
|
|
8
|
+
path. `getTrafficJunction` dumped the whole `TSiteCamera` object — including the
|
|
9
|
+
camera's `username` and plaintext `password` — on every reconnect, and
|
|
10
|
+
`addPlateNumber` logged its argument, which carries the same password plus a
|
|
11
|
+
resident's plate number and owner name. `checkOutBySiteAndPlate` logged the
|
|
12
|
+
matched visitor transaction. `siteCameraRepo.updateById` logged the re-read
|
|
13
|
+
camera document, and `vehicleService.add` logged the whole array of a site's
|
|
14
|
+
cameras, both with credentials in them. `sendEmail` printed `MAILER_PASSWORD`
|
|
15
|
+
itself on every message sent.
|
|
16
|
+
|
|
17
|
+
All now log identifiers, counts and outcomes only, through the module's logger
|
|
18
|
+
rather than `console.log`; the mailer line is removed outright because it
|
|
19
|
+
carried nothing but the secret.
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
---
|
|
2
|
+
"@7365admin1/core": patch
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
Fix three Dahua HTTP API defects found by checking our integration against the
|
|
6
|
+
vendor specification (V3.37):
|
|
7
|
+
|
|
8
|
+
- The ANPR reconnect loop retried authentication ten times at one-second
|
|
9
|
+
intervals. The device locks the account for 1800 seconds after three failed
|
|
10
|
+
logins in thirty, so our own recovery could take ANPR down at a site for half
|
|
11
|
+
an hour. Authentication now backs off well past the device's counting window,
|
|
12
|
+
and a network fault is distinguished from an authentication failure.
|
|
13
|
+
- 401 and 403 were handled backwards. Per spec §3.4, 401 is the digest
|
|
14
|
+
challenge (retry) and 403 is a credentials rejection (stop). We treated 403 as
|
|
15
|
+
an account lock and killed the listener, and counted 401s toward a "wrong
|
|
16
|
+
password" warning.
|
|
17
|
+
- `updatePlateNumber`, `bulkInsertPlateNumber` and `removePlateNumber`
|
|
18
|
+
interpolated values into the CGI query string unencoded, against the spec's
|
|
19
|
+
stated RFC 3986 requirement. A plate or owner name containing a space or "&"
|
|
20
|
+
broke the request or appended extra parameters to it.
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
---
|
|
2
|
+
"@7365admin1/core": patch
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
Let a person choose which notifications they get, and enforce it where they are
|
|
6
|
+
sent.
|
|
7
|
+
|
|
8
|
+
Adds a `notification-preferences` collection (one row per user, storing only what
|
|
9
|
+
they switched OFF), a catalogue of what the product can notify about and on which
|
|
10
|
+
routes, and an authenticated pair of endpoints for reading and changing your own
|
|
11
|
+
settings — the user comes from the session, never from the request.
|
|
12
|
+
|
|
13
|
+
The guard runs inside `NotificationService.send`, so a switch actually stops the
|
|
14
|
+
message: the in-app copy and the phone alert are filtered independently. Somebody
|
|
15
|
+
with no saved row is never filtered, so behaviour is unchanged until they choose
|
|
16
|
+
to change it.
|
|
17
|
+
|
|
18
|
+
Two notice-board senders tag their messages `module: "feedback"`; they now pass
|
|
19
|
+
the honest category to the guard while leaving the stored tag alone, so switching
|
|
20
|
+
Feedback off does not silence the notice board.
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
---
|
|
2
|
+
"@7365admin1/core": patch
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
Scope the notification inbox to the signed-in person.
|
|
6
|
+
|
|
7
|
+
Every handler on `/notifications` read the user id out of the query string or
|
|
8
|
+
the URL and acted on it without comparing it to the session, so any signed-in
|
|
9
|
+
account could list another person's notifications, mark them read, and read
|
|
10
|
+
their unread count. Whose inbox is opened now comes from the session; a request
|
|
11
|
+
naming somebody else is refused rather than quietly served.
|
|
12
|
+
|
|
13
|
+
`POST /notifications` writes into up to 5000 inboxes at once and had no
|
|
14
|
+
authorisation beyond being signed in. It now requires a Seven365 super admin.
|
|
15
|
+
|
|
16
|
+
The `user` parameter is still accepted, so no app has to be released in step
|
|
17
|
+
with this: every caller in the organisation already sends its own id.
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
---
|
|
2
|
+
"@7365admin1/core": minor
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
Hold property-manager service-provider invitations for Seven365 approval, and give an invitation a life
|
|
6
|
+
|
|
7
|
+
A property management company inviting a service provider used to reach that
|
|
8
|
+
provider immediately. It now waits for the Seven365 super admin, and the
|
|
9
|
+
provider is told nothing at all until it is approved — no email, no in-app
|
|
10
|
+
message, and the invitation is not even readable to them. Approval is the one
|
|
11
|
+
place an invitation reaches the provider, so there is a single function that can
|
|
12
|
+
leak an unapproved one. An invitation Seven365 sends itself is not held.
|
|
13
|
+
|
|
14
|
+
An invitation now has seven states instead of two: waiting for Seven365, waiting
|
|
15
|
+
for the provider, accepted, not approved (with a reason the property manager
|
|
16
|
+
sees word for word), declined, cancelled and expired. Every change goes through
|
|
17
|
+
one conditional update that moves the row only from an expected state and
|
|
18
|
+
appends an immutable history line in the same write — so approving or accepting
|
|
19
|
+
twice writes nothing the second time, and no path can move an invitation
|
|
20
|
+
silently. Deleting is a soft delete: the row leaves the property manager's list,
|
|
21
|
+
the record and its history stay and remain visible to Seven365.
|
|
22
|
+
|
|
23
|
+
Authorization, which this endpoint did not have: the caller is resolved from the
|
|
24
|
+
session and must belong to the organisation the invitation is sent for — being
|
|
25
|
+
signed in used to be enough to invite a provider to any organisation's site.
|
|
26
|
+
Approving and rejecting require the Seven365 super-admin membership (an org-less
|
|
27
|
+
`members` row of type `admin` whose role is also of type `admin`), not an email
|
|
28
|
+
address, so it behaves the same in staging and production.
|
|
29
|
+
|
|
30
|
+
An already-onboarded provider still never sees sign-up or a one-time code, and
|
|
31
|
+
the sign-up path for a brand-new company is unchanged.
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
---
|
|
2
|
+
"@7365admin1/core": patch
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
Make the "an invitation is already waiting" check actually find the invitation
|
|
6
|
+
|
|
7
|
+
The duplicate-invitation guard added with the existing-provider invite fix never
|
|
8
|
+
fired. Invitations are written with `metadata.siteId` as an ObjectId, but the
|
|
9
|
+
lookup searched for the site id as the plain string it arrived as on the request,
|
|
10
|
+
and MongoDB does not treat the two as equal. The query therefore always came back
|
|
11
|
+
empty: a property manager could send the same service provider a second, third
|
|
12
|
+
and fourth invitation for the same site while the first was still valid, and each
|
|
13
|
+
one produced another email and another pending row for them to chase.
|
|
14
|
+
|
|
15
|
+
The lookup now matches either form, so older records that hold the string are
|
|
16
|
+
still found. Nothing else changes: the refusal message and the status code are
|
|
17
|
+
the ones already shipped.
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
---
|
|
2
|
+
"@7365admin1/core": patch
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
Stop rejecting site names that only differ by their building number
|
|
6
|
+
|
|
7
|
+
Adding a site refused any name within a Levenshtein distance of 2 of an
|
|
8
|
+
existing site in the same organisation, and told the user to contact support.
|
|
9
|
+
That is exactly one character, so "Winsland House II" could not be added next
|
|
10
|
+
to "Winsland House I". The same rule blocked "Tower A" beside "Tower B",
|
|
11
|
+
"Phase 2" beside "Phase 1" and "Block 15" beside "Block 5" — the standard way
|
|
12
|
+
buildings are named here.
|
|
13
|
+
|
|
14
|
+
The check now treats trailing numbers, Roman numerals and single letters as the
|
|
15
|
+
part that tells two buildings apart: if they differ, the names are different
|
|
16
|
+
sites and the distance is never measured. Real duplicates are still refused —
|
|
17
|
+
an exact repeat, a different capitalisation, stray or doubled whitespace,
|
|
18
|
+
punctuation-only differences, and a one or two character typo within the same
|
|
19
|
+
building. "House 1" and "House I" are still read as the same building.
|
|
20
|
+
|
|
21
|
+
The refusal now names the site it matched and says what to do about it instead
|
|
22
|
+
of pointing the user at support.
|
|
23
|
+
|
|
24
|
+
`site.repo.getByExactName` also built its case-insensitive regex from the raw
|
|
25
|
+
name; a name containing regex characters either threw or matched a site it is
|
|
26
|
+
not. It is escaped.
|
|
@@ -34,3 +34,14 @@ jobs:
|
|
|
34
34
|
|
|
35
35
|
- name: Publish to npm with staging tag
|
|
36
36
|
run: npm publish --tag staging --registry https://registry.npmjs.org
|
|
37
|
+
|
|
38
|
+
- name: Notify Discord on failure
|
|
39
|
+
if: failure()
|
|
40
|
+
env:
|
|
41
|
+
DISCORD_WEBHOOK_URL: ${{ secrets.DISCORD_WEBHOOK_URL }}
|
|
42
|
+
run: |
|
|
43
|
+
MESSAGE="@everyone :rotating_light: **Publish Staging** failed in \`${{ github.repository }}\` (\`${{ github.workflow }}\`)
|
|
44
|
+
${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
|
|
45
|
+
curl -s -X POST -H "Content-Type: application/json" \
|
|
46
|
+
-d "$(jq -n --arg content "$MESSAGE" '{content: $content}')" \
|
|
47
|
+
"$DISCORD_WEBHOOK_URL"
|