@volter/supercode-teams 0.2.127 → 0.2.128

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@volter/supercode-teams",
3
- "version": "0.2.127",
3
+ "version": "0.2.128",
4
4
  "type": "module",
5
5
  "description": "A machine daemon serving this machine's doors, and a local or remote Teams server for shared session discovery, OpenTelemetry ingestion and access to enrolled machines.",
6
6
  "license": "MIT",
@@ -13,7 +13,8 @@ import { captureDigest, captureMessages, handleOtlpRoute, sha256, validateArtifa
13
13
  import { handleCatalogEvents, handleSessionEvents, sessionNames } from './event-routes.mjs';
14
14
  import { exact } from '@volter/teams/server/request-json';
15
15
  import { MESSAGE_AT, OPEN_REVISION } from '@volter/teams/server/migrations';
16
- import { delegatedSessionOf, looksDelegated } from '@volter/teams/server/delegated';
16
+ import { delegatedRoomNoticeOf, delegatedSessionOf, looksDelegated } from '@volter/teams/server/delegated';
17
+ import { deliverSessionRoomNotice } from '@volter/teams/server/machine-link';
17
18
  import { renderSourceCollectorConfig } from './otlp/collector-config.mjs';
18
19
  import { attachmentActionRoute, createAttachment, liveGrantRoute, machineEffectRoute } from './effects.mjs';
19
20
  import { exportSessionRoute, operationRoute } from './exports.mjs';
@@ -26,6 +27,14 @@ function unverifiedSubject(token){try{return String(JSON.parse(Buffer.from(Strin
26
27
 
27
28
  async function preAuth({ api, req, res, path, requestId }) {
28
29
  let early;
30
+ if(req.method==='POST'&&(early=/^\/api\/v1\/teams\/([^/]+)\/sessions\/([^/]+)\/room-notices$/.exec(path))){
31
+ const access=await delegatedRoomNoticeOf(api,bearer(req.headers.authorization));
32
+ if(!access || access.teamId!==early[1] || access.sessionRef!==decodeURIComponent(early[2])) fail(401,'authentication_required','authentication required');
33
+ checkRate(api,`room-notices:${access.issuer}:${access.teamId}`,120,10);
34
+ const receipt=await deliverSessionRoomNotice(api,access);
35
+ send(res,200,{data:receipt},requestId);return true;
36
+ }
37
+
29
38
  // A session view (RH2 ADR 0008): a workplace page reads one session with a token its workplace signed for a Room and
30
39
  // Conversation, which reaches only a session its owner bound to them (session_view_bindings). A member's own
31
40
  // credential takes the ordinary routes below.