Skip to content

Commit c7053e7

Browse files
committed
chore(release): pryv 3.4.0 + @pryv/cmc 1.1.0 + monitor/socket.io 3.4.0 lockstep
Minor release shipping the SDK side of @pryv/cmc Phase 2 + Phase 4 + companion CHANGELOG. The server-side counterpart is open-pryv.io 2.0.0-pre.4 (cmc plugin commit 0306c7e). @pryv/cmc@1.1.0 (MINOR bump — additive error ids): - 7 new ids on cmc.errorIds: CAPABILITY_TTL_OUT_OF_RANGE, HANDLER_MISSING_CAPABILITY_ID, CHAT_DISABLED, SYSTEM_MESSAGING_DISABLED, CLIENTDATA_CMC_FORBIDDEN, RESERVED_STREAM_UNDELETABLE, COUNTERPARTY_IDENTITY_MISSING. - New [CMCXEC] J9 catalogue-match test pinning all 7 against the server-side strings (fails at unit-test time if SDK + server drift). - No source-level breaking change. Existing apps on pryv@3.3.x + @pryv/cmc@1.0.x continue to work. pryv@3.4.0, @pryv/monitor@3.4.0, @pryv/socket.io@3.4.0: - No code changes. Versions bumped in lockstep with @pryv/cmc@1.1.0 so operators upgrade with one `npm install pryv@3.4.0 @pryv/cmc@1.1.0` and the monitor / socket.io packages follow via transitive resolution. The ^3.3.0 peer-dep selector on @pryv/cmc resolves cleanly against pryv@3.4.0. Tests: 55 -> 56 passing (+1 J9 catalogue test). The earlier J3-J10 suite already in 1.0.2 stays green.
1 parent 79b08a6 commit c7053e7

9 files changed

Lines changed: 133 additions & 12 deletions

File tree

CHANGELOG.md

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,88 @@
22

33
<!-- Format based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) -->
44

5+
## [3.4.0]
6+
7+
Lockstep release of `pryv@3.4.0` + `@pryv/monitor@3.4.0` +
8+
`@pryv/socket.io@3.4.0`, plus `@pryv/cmc@1.1.0` (additive — new error
9+
ids on the catalogue + new wire-shape contract tests).
10+
11+
### `@pryv/cmc@1.1.0`
12+
13+
#### Added
14+
- **7 new error ids** on `cmc.errorIds`, mirroring the server-side
15+
`CmcErrorIds` additions shipped in `open-pryv.io` 2.0.0-pre.4 (cmc
16+
plugin commit `0306c7e`):
17+
- `CAPABILITY_TTL_OUT_OF_RANGE` (`cmc-capability-ttl-out-of-range`)
18+
— server now bounds `content.expiresAt` to `[60s, 30d]` at mint.
19+
Omit `expiresAt` to use the 7-day default; pick a value in range
20+
to override.
21+
- `HANDLER_MISSING_CAPABILITY_ID` (`cmc-handler-missing-capability-id`)
22+
— was on the server catalog but missing from the SDK mirror.
23+
- `CHAT_DISABLED` (`cmc-chat-disabled`) — feature-gating: writes
24+
rejected when the relationship's `clientData.cmc.features.chat ===
25+
false`. Default-permit on omission.
26+
- `SYSTEM_MESSAGING_DISABLED` (`cmc-system-messaging-disabled`) —
27+
same for `features.systemMessaging`. Scope-request /
28+
scope-update remain protocol-level and permitted regardless.
29+
- `CLIENTDATA_CMC_FORBIDDEN` (`cmc-clientdata-cmc-forbidden`) —
30+
`accesses.create` / `accesses.update` reject any user-supplied
31+
`clientData.cmc.*`. Use this to catch hand-crafted forge attempts
32+
surfacing as 400-not-200 from the api-server.
33+
- `RESERVED_STREAM_UNDELETABLE` (`cmc-reserved-stream-undeletable`)
34+
`streams.delete` rejects the five reserved CMC parents +
35+
`:_cmc:_internal:*` + plugin-managed `chats`/`collectors` segments
36+
even from personal tokens. App code should not target these.
37+
- `COUNTERPARTY_IDENTITY_MISSING` (`cmc-counterparty-identity-missing`)
38+
— peer-side `content.from` stamping hook rejects a write when the
39+
counterparty access has no stored `{username,host}` identity.
40+
Surfaced for ops; app developers shouldn't see it under normal
41+
flow.
42+
43+
#### Tests
44+
- New `[CMCXEC]` J9 catalogue-match test pinning all 7 ids against
45+
the server-side strings. Future drift between SDK + server will
46+
fail at unit-test time.
47+
- New `[CMCL1OB]``[CMCL1OH]` wire-shape contract tests (J3, J4, J5,
48+
J7, J8) covering `listInvites` (uses `streams` not `streamIds`),
49+
`listAcceptedRelationships` counterparty-mapping precedence
50+
(content.from > content.acceptedBy > null fallback), `waitForAccept`
51+
`sinceTime` filter (defensive passthrough when `ev.time` missing),
52+
`acceptInvite` `scopeStreamId` requirement, `acceptInvite`
53+
`dataGrantAccessId` resolution post-completion.
54+
55+
#### Compatibility
56+
- **No source-level breaking changes.** Existing apps using
57+
`pryv@3.3.x` + `@pryv/cmc@1.0.x` continue to work; the new error ids
58+
are additive. The `^3.3.0` peer-dep selector on `@pryv/cmc` resolves
59+
cleanly against `pryv@3.4.0` so apps that pin only `@pryv/cmc` get
60+
the new `pryv` transitively without action.
61+
62+
### `pryv@3.4.0`, `@pryv/monitor@3.4.0`, `@pryv/socket.io@3.4.0`
63+
64+
- No code changes. Versions bumped in lockstep with `@pryv/cmc@1.1.0`
65+
so operators upgrade with `npm install pryv@3.4.0 @pryv/cmc@1.1.0`
66+
and pick up the new ids + the monitor / socket.io packages follow
67+
via transitive resolution.
68+
69+
### Server-side coverage
70+
71+
This SDK release pairs with `open-pryv.io` 2.0.0-pre.4 (cmc plugin
72+
commit `0306c7e`+) which ships:
73+
- Plugin field-stamping completion (`inviteEventId` on inbox mirrors,
74+
`requestEventId` on capability accesses via post-create hook).
75+
- Capability TTL configurable per-invite, bounded `[60s, 30d]`.
76+
- Feature-gating enforced at send time on `handleChat` / `handleSystem`.
77+
- Forge-prevention on `accesses.create` / `accesses.update` /
78+
`streams.delete` (new route-level hooks).
79+
- `content.from` stamping extended from `:_cmc:inbox` to per-app
80+
chats/collectors writes by counterparty-marked accesses.
81+
- `:_cmc:_internal:*` defense-in-depth filter on `events.get` /
82+
`events.getOne` / `streams.get`.
83+
84+
See `open-pryv.io/components/cmc/CHANGELOG-v2.md` for the server-side
85+
detail.
86+
587
## [3.3.2]
688

789
Lockstep patch release of `pryv@3.3.2` + `@pryv/monitor@3.3.2` +

components/pryv-cmc/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@pryv/cmc",
3-
"version": "1.0.2",
3+
"version": "1.1.0",
44
"description": "Cross-account Messaging & Consent client helpers for Pryv.io",
55
"keywords": [
66
"Pryv",

components/pryv-cmc/src/index.js

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -249,8 +249,13 @@ const errorIds = Object.freeze({
249249
CAPABILITY_TIMEOUT: 'cmc-capability-timeout',
250250
CAPABILITY_EMPTY: 'cmc-capability-empty',
251251
CAPABILITY_MULTIPLE_OFFERS: 'cmc-capability-multiple-offers',
252+
// Caller's `content.expiresAt` on the trigger event resolves to a
253+
// TTL outside the platform-allowed bounds [60s, 30d]. Either omit
254+
// `expiresAt` to use the 7-day default or pick a bounded value.
255+
CAPABILITY_TTL_OUT_OF_RANGE: 'cmc-capability-ttl-out-of-range',
252256
// Trigger-event content shape
253257
HANDLER_MISSING_CAPABILITY_URL: 'cmc-handler-missing-capability-url',
258+
HANDLER_MISSING_CAPABILITY_ID: 'cmc-handler-missing-capability-id',
254259
HANDLER_OFFER_MISSING_CAPABILITY_ID: 'cmc-handler-offer-missing-capability-id',
255260
OFFER_EMPTY_PERMISSIONS: 'cmc-offer-empty-permissions',
256261
// Handler routing
@@ -272,7 +277,28 @@ const errorIds = Object.freeze({
272277
CHAT_STREAM_NOT_CHAT: 'cmc-chat-stream-not-chat',
273278
CHAT_COUNTERPARTY_ACCESS_NOT_FOUND: 'cmc-chat-counterparty-access-not-found',
274279
CHAT_NO_REMOTE_APIENDPOINT: 'cmc-chat-no-remote-apiendpoint',
275-
CHAT_NO_REMOTE_CHAT_STREAM: 'cmc-chat-no-remote-chat-stream'
280+
CHAT_NO_REMOTE_CHAT_STREAM: 'cmc-chat-no-remote-chat-stream',
281+
// Feature-gating: a relationship with negotiated `features.chat:
282+
// false` or `features.systemMessaging: false` rejects sends on the
283+
// disabled channel. Default-permit on omission (matches the
284+
// offer-side default).
285+
CHAT_DISABLED: 'cmc-chat-disabled',
286+
SYSTEM_MESSAGING_DISABLED: 'cmc-system-messaging-disabled',
287+
// Route-level forge prevention: `accesses.create` / `accesses.update`
288+
// reject any user-supplied `clientData.cmc.*`. That namespace is
289+
// plugin-owned end-to-end (role, appCode, counterparty, capability,
290+
// requestEventId, features); allowing user-set values would let an
291+
// app forge a counterparty role and bypass the handshake.
292+
CLIENTDATA_CMC_FORBIDDEN: 'cmc-clientdata-cmc-forbidden',
293+
// streams.delete reject on the five reserved CMC parents +
294+
// :_cmc:_internal:* + plugin-managed chats/collectors segments —
295+
// even from a personal token. Deleting :_cmc: would silently break
296+
// every active relationship on the account.
297+
RESERVED_STREAM_UNDELETABLE: 'cmc-reserved-stream-undeletable',
298+
// The peer-side `content.from` stamping hook rejects when the
299+
// writer's counterparty access has no stored `{username,host}`
300+
// identity — wiring bug at handshake time; surface for ops.
301+
COUNTERPARTY_IDENTITY_MISSING: 'cmc-counterparty-identity-missing'
276302
});
277303

278304
// --- Level-1 protocol functions ---

components/pryv-cmc/test/cmc.test.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,19 @@ describe('[CMCX] @pryv/cmc Level-0 helpers', function () {
139139
it('[CMCXEB] does not carry the dropped CHAT_RATE_LIMITED', function () {
140140
expect(cmc.errorIds).to.not.have.property('CHAT_RATE_LIMITED');
141141
});
142+
143+
it('[CMCXEC] J9 catalogue mirrors @pryv/cmc 1.1.0 server-side additions', function () {
144+
// Server-side errorIds shipped in open-pryv.io 2.0.0-pre.4 / cmc
145+
// plugin commit 0306c7e. SDK must expose the same kebab strings so
146+
// apps can pattern-match without parsing message text.
147+
expect(cmc.errorIds.CAPABILITY_TTL_OUT_OF_RANGE).to.equal('cmc-capability-ttl-out-of-range');
148+
expect(cmc.errorIds.CHAT_DISABLED).to.equal('cmc-chat-disabled');
149+
expect(cmc.errorIds.SYSTEM_MESSAGING_DISABLED).to.equal('cmc-system-messaging-disabled');
150+
expect(cmc.errorIds.CLIENTDATA_CMC_FORBIDDEN).to.equal('cmc-clientdata-cmc-forbidden');
151+
expect(cmc.errorIds.RESERVED_STREAM_UNDELETABLE).to.equal('cmc-reserved-stream-undeletable');
152+
expect(cmc.errorIds.COUNTERPARTY_IDENTITY_MISSING).to.equal('cmc-counterparty-identity-missing');
153+
expect(cmc.errorIds.HANDLER_MISSING_CAPABILITY_ID).to.equal('cmc-handler-missing-capability-id');
154+
});
142155
});
143156
});
144157

components/pryv-monitor/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@pryv/monitor",
3-
"version": "3.3.2",
3+
"version": "3.4.0",
44
"description": "Extends `pryv` with event-driven notifications for changes on a Pryv.io account",
55
"keywords": [
66
"Pryv",

components/pryv-socket.io/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@pryv/socket.io",
3-
"version": "3.3.2",
3+
"version": "3.4.0",
44
"description": "Extends `pryv` with Socket.IO transport",
55
"keywords": [
66
"Pryv",

components/pryv/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "pryv",
3-
"version": "3.3.2",
3+
"version": "3.4.0",
44
"description": "Pryv JavaScript library",
55
"keywords": [
66
"Pryv",

package-lock.json

Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "lib-js",
3-
"version": "3.3.2",
3+
"version": "3.4.0",
44
"private": false,
55
"description": "Pryv JavaScript library and add-ons",
66
"keywords": [

0 commit comments

Comments
 (0)