@openclaw/synology-chat 2026.5.9-beta.1 → 2026.5.10-beta.1
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/dist/api.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { n as setSynologyRuntime, t as synologyChatPlugin } from "./channel-
|
|
1
|
+
import { n as setSynologyRuntime, t as synologyChatPlugin } from "./channel-IPqYKUxY.js";
|
|
2
2
|
import { t as collectSynologyChatSecurityAuditFindings } from "./security-audit-Zu_nkF2x.js";
|
|
3
3
|
export { collectSynologyChatSecurityAuditFindings, setSynologyRuntime, synologyChatPlugin };
|
|
@@ -21,6 +21,7 @@ import { beginWebhookRequestPipelineOrReject, createFixedWindowRateLimiter, crea
|
|
|
21
21
|
import { createPluginRuntimeStore } from "openclaw/plugin-sdk/runtime-store";
|
|
22
22
|
import { buildAgentSessionKey } from "openclaw/plugin-sdk/routing";
|
|
23
23
|
import * as querystring from "node:querystring";
|
|
24
|
+
import { resolveStableChannelMessageIngress } from "openclaw/plugin-sdk/channel-ingress-runtime";
|
|
24
25
|
import { safeEqualSecret } from "openclaw/plugin-sdk/security-runtime";
|
|
25
26
|
//#region extensions/synology-chat/src/approval-auth.ts
|
|
26
27
|
function normalizeSynologyChatApproverId(value) {
|
|
@@ -394,37 +395,23 @@ function validateToken(received, expected) {
|
|
|
394
395
|
if (!received || !expected) return false;
|
|
395
396
|
return safeEqualSecret(received, expected);
|
|
396
397
|
}
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
}
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
};
|
|
415
|
-
if (dmPolicy === "open") return checkUserAllowed(userId, allowedUserIds) ? { allowed: true } : {
|
|
416
|
-
allowed: false,
|
|
417
|
-
reason: "not-allowlisted"
|
|
418
|
-
};
|
|
419
|
-
if (allowedUserIds.length === 0) return {
|
|
420
|
-
allowed: false,
|
|
421
|
-
reason: "allowlist-empty"
|
|
422
|
-
};
|
|
423
|
-
if (!checkUserAllowed(userId, allowedUserIds)) return {
|
|
424
|
-
allowed: false,
|
|
425
|
-
reason: "not-allowlisted"
|
|
426
|
-
};
|
|
427
|
-
return { allowed: true };
|
|
398
|
+
async function authorizeUserForDmWithIngress(params) {
|
|
399
|
+
return await resolveStableChannelMessageIngress({
|
|
400
|
+
channelId: "synology-chat",
|
|
401
|
+
accountId: params.accountId,
|
|
402
|
+
identity: {
|
|
403
|
+
key: "sender-id",
|
|
404
|
+
entryIdPrefix: "synology-chat-entry"
|
|
405
|
+
},
|
|
406
|
+
subject: { stableId: params.userId },
|
|
407
|
+
conversation: {
|
|
408
|
+
kind: "direct",
|
|
409
|
+
id: "direct"
|
|
410
|
+
},
|
|
411
|
+
event: { mayPair: false },
|
|
412
|
+
dmPolicy: params.dmPolicy,
|
|
413
|
+
allowFrom: params.allowedUserIds
|
|
414
|
+
});
|
|
428
415
|
}
|
|
429
416
|
/**
|
|
430
417
|
* Sanitize user input to prevent prompt injection attacks.
|
|
@@ -722,7 +709,7 @@ async function parseWebhookPayloadRequest(params) {
|
|
|
722
709
|
payload
|
|
723
710
|
};
|
|
724
711
|
}
|
|
725
|
-
function authorizeSynologyWebhook(params) {
|
|
712
|
+
async function authorizeSynologyWebhook(params) {
|
|
726
713
|
const invalidTokenRateLimitKey = getSynologyWebhookInvalidTokenRateLimitKey(params.req);
|
|
727
714
|
if (params.invalidTokenRateLimiter.isLocked(invalidTokenRateLimitKey)) {
|
|
728
715
|
params.log?.warn(`Rate limit exceeded for remote IP: ${invalidTokenRateLimitKey}`);
|
|
@@ -748,14 +735,19 @@ function authorizeSynologyWebhook(params) {
|
|
|
748
735
|
error: "Invalid token"
|
|
749
736
|
};
|
|
750
737
|
}
|
|
751
|
-
const auth =
|
|
752
|
-
|
|
753
|
-
|
|
738
|
+
const auth = await authorizeUserForDmWithIngress({
|
|
739
|
+
accountId: params.account.accountId,
|
|
740
|
+
userId: params.payload.user_id,
|
|
741
|
+
dmPolicy: params.account.dmPolicy,
|
|
742
|
+
allowedUserIds: params.account.allowedUserIds
|
|
743
|
+
});
|
|
744
|
+
if (!auth.senderAccess.allowed) {
|
|
745
|
+
if (auth.senderAccess.reasonCode === "dm_policy_disabled") return {
|
|
754
746
|
ok: false,
|
|
755
747
|
statusCode: 403,
|
|
756
748
|
error: "DMs are disabled"
|
|
757
749
|
};
|
|
758
|
-
if (
|
|
750
|
+
if (params.account.dmPolicy === "allowlist" && params.account.allowedUserIds.length === 0) {
|
|
759
751
|
params.log?.warn("Synology Chat allowlist is empty while dmPolicy=allowlist; rejecting message");
|
|
760
752
|
return {
|
|
761
753
|
ok: false,
|
|
@@ -780,7 +772,7 @@ function authorizeSynologyWebhook(params) {
|
|
|
780
772
|
}
|
|
781
773
|
return {
|
|
782
774
|
ok: true,
|
|
783
|
-
commandAuthorized: auth.allowed
|
|
775
|
+
commandAuthorized: auth.senderAccess.allowed
|
|
784
776
|
};
|
|
785
777
|
}
|
|
786
778
|
function sanitizeSynologyWebhookText(payload) {
|
|
@@ -791,7 +783,7 @@ function sanitizeSynologyWebhookText(payload) {
|
|
|
791
783
|
async function parseAndAuthorizeSynologyWebhook(params) {
|
|
792
784
|
const parsed = await parseWebhookPayloadRequest(params);
|
|
793
785
|
if (!parsed.ok) return { ok: false };
|
|
794
|
-
const authorized = authorizeSynologyWebhook({
|
|
786
|
+
const authorized = await authorizeSynologyWebhook({
|
|
795
787
|
req: params.req,
|
|
796
788
|
account: params.account,
|
|
797
789
|
payload: parsed.payload,
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as synologyChatPlugin } from "./channel-
|
|
1
|
+
import { t as synologyChatPlugin } from "./channel-IPqYKUxY.js";
|
|
2
2
|
export { synologyChatPlugin };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openclaw/synology-chat",
|
|
3
|
-
"version": "2026.5.
|
|
3
|
+
"version": "2026.5.10-beta.1",
|
|
4
4
|
"description": "Synology Chat channel plugin for OpenClaw",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -30,10 +30,10 @@
|
|
|
30
30
|
"minHostVersion": ">=2026.4.10"
|
|
31
31
|
},
|
|
32
32
|
"compat": {
|
|
33
|
-
"pluginApi": ">=2026.5.
|
|
33
|
+
"pluginApi": ">=2026.5.10-beta.1"
|
|
34
34
|
},
|
|
35
35
|
"build": {
|
|
36
|
-
"openclawVersion": "2026.5.
|
|
36
|
+
"openclawVersion": "2026.5.10-beta.1"
|
|
37
37
|
},
|
|
38
38
|
"release": {
|
|
39
39
|
"publishToClawHub": true,
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
"openclaw.plugin.json"
|
|
50
50
|
],
|
|
51
51
|
"peerDependencies": {
|
|
52
|
-
"openclaw": ">=2026.5.
|
|
52
|
+
"openclaw": ">=2026.5.10-beta.1"
|
|
53
53
|
},
|
|
54
54
|
"peerDependenciesMeta": {
|
|
55
55
|
"openclaw": {
|