@openclaw/synology-chat 2026.7.1-beta.6 → 2026.7.2-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-DJNRGYkN.js";
|
|
2
2
|
import { t as collectSynologyChatSecurityAuditFindings } from "./security-audit-DIsaxIaB.js";
|
|
3
3
|
export { collectSynologyChatSecurityAuditFindings, setSynologyRuntime, synologyChatPlugin };
|
|
@@ -8,8 +8,9 @@ import { composeWarningCollectors, createConditionalWarningCollector, projectAcc
|
|
|
8
8
|
import { createEmptyChannelDirectoryAdapter } from "openclaw/plugin-sdk/directory-runtime";
|
|
9
9
|
import { finiteSecondsToTimerSafeMilliseconds, parseStrictNonNegativeInteger } from "openclaw/plugin-sdk/number-runtime";
|
|
10
10
|
import { normalizeLowercaseStringOrEmpty, normalizeStringEntriesLower } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
11
|
+
import { sanitizeAssistantVisibleText } from "openclaw/plugin-sdk/text-chunking";
|
|
11
12
|
import { DEFAULT_ACCOUNT_ID as DEFAULT_ACCOUNT_ID$1 } from "openclaw/plugin-sdk/account-resolution";
|
|
12
|
-
import {
|
|
13
|
+
import { createChannelApprovalAuth } from "openclaw/plugin-sdk/approval-auth-runtime";
|
|
13
14
|
import * as http from "node:http";
|
|
14
15
|
import * as https from "node:https";
|
|
15
16
|
import { safeParseJsonWithSchema, safeParseWithSchema } from "openclaw/plugin-sdk/extension-shared";
|
|
@@ -17,7 +18,7 @@ import { sleep } from "openclaw/plugin-sdk/runtime-env";
|
|
|
17
18
|
import { formatErrorMessage, resolvePinnedHostnameWithPolicy } from "openclaw/plugin-sdk/ssrf-runtime";
|
|
18
19
|
import { z } from "zod";
|
|
19
20
|
import { buildChannelConfigSchema } from "openclaw/plugin-sdk/channel-config-schema";
|
|
20
|
-
import { beginWebhookRequestPipelineOrReject, createFixedWindowRateLimiter, createWebhookInFlightLimiter, isRequestBodyLimitError, readRequestBodyWithLimit, registerPluginHttpRoute, requestBodyErrorToText } from "openclaw/plugin-sdk/webhook-ingress";
|
|
21
|
+
import { beginWebhookRequestPipelineOrReject, createFixedWindowRateLimiter, createWebhookInFlightLimiter, isRequestBodyLimitError, readRequestBodyWithLimit, registerPluginHttpRoute, requestBodyErrorToText, resolveRequestClientIp } from "openclaw/plugin-sdk/webhook-ingress";
|
|
21
22
|
import { createPluginRuntimeStore } from "openclaw/plugin-sdk/runtime-store";
|
|
22
23
|
import { buildAgentSessionKey } from "openclaw/plugin-sdk/routing";
|
|
23
24
|
import * as querystring from "node:querystring";
|
|
@@ -29,16 +30,13 @@ function normalizeSynologyChatApproverId(value) {
|
|
|
29
30
|
const trimmed = String(value).trim();
|
|
30
31
|
return /^\d+$/.test(trimmed) ? trimmed : void 0;
|
|
31
32
|
}
|
|
32
|
-
const synologyChatApprovalAuth =
|
|
33
|
+
const synologyChatApprovalAuth = createChannelApprovalAuth({
|
|
33
34
|
channelLabel: "Synology Chat",
|
|
34
|
-
|
|
35
|
-
return
|
|
36
|
-
allowFrom: resolveAccount(cfg ?? {}, accountId).allowedUserIds,
|
|
37
|
-
normalizeApprover: normalizeSynologyChatApproverId
|
|
38
|
-
});
|
|
35
|
+
resolveInputs: ({ cfg, accountId }) => {
|
|
36
|
+
return { allowFrom: resolveAccount(cfg ?? {}, accountId).allowedUserIds };
|
|
39
37
|
},
|
|
40
|
-
|
|
41
|
-
});
|
|
38
|
+
normalizeApprover: normalizeSynologyChatApproverId
|
|
39
|
+
}).approvalAuth;
|
|
42
40
|
//#endregion
|
|
43
41
|
//#region extensions/synology-chat/src/client.ts
|
|
44
42
|
/**
|
|
@@ -554,8 +552,8 @@ function getInvalidTokenRateLimiter(account) {
|
|
|
554
552
|
}
|
|
555
553
|
return rl;
|
|
556
554
|
}
|
|
557
|
-
function getSynologyWebhookInvalidTokenRateLimitKey(
|
|
558
|
-
return req.socket?.remoteAddress ?? "unknown";
|
|
555
|
+
function getSynologyWebhookInvalidTokenRateLimitKey(params) {
|
|
556
|
+
return resolveRequestClientIp(params.req, params.trustedProxies, params.allowRealIpFallback === true) ?? params.req.socket?.remoteAddress ?? "unknown";
|
|
559
557
|
}
|
|
560
558
|
function getSynologyWebhookInFlightKey(account) {
|
|
561
559
|
return account.accountId;
|
|
@@ -736,7 +734,11 @@ async function parseWebhookPayloadRequest(params) {
|
|
|
736
734
|
};
|
|
737
735
|
}
|
|
738
736
|
async function authorizeSynologyWebhook(params) {
|
|
739
|
-
const invalidTokenRateLimitKey = getSynologyWebhookInvalidTokenRateLimitKey(
|
|
737
|
+
const invalidTokenRateLimitKey = getSynologyWebhookInvalidTokenRateLimitKey({
|
|
738
|
+
req: params.req,
|
|
739
|
+
trustedProxies: params.trustedProxies,
|
|
740
|
+
allowRealIpFallback: params.allowRealIpFallback
|
|
741
|
+
});
|
|
740
742
|
if (params.invalidTokenRateLimiter.isLocked(invalidTokenRateLimitKey)) {
|
|
741
743
|
params.log?.warn(`Rate limit exceeded for remote IP: ${invalidTokenRateLimitKey}`);
|
|
742
744
|
return {
|
|
@@ -815,6 +817,8 @@ async function parseAndAuthorizeSynologyWebhook(params) {
|
|
|
815
817
|
payload: parsed.payload,
|
|
816
818
|
invalidTokenRateLimiter: params.invalidTokenRateLimiter,
|
|
817
819
|
rateLimiter: params.rateLimiter,
|
|
820
|
+
trustedProxies: params.trustedProxies,
|
|
821
|
+
allowRealIpFallback: params.allowRealIpFallback,
|
|
818
822
|
log: params.log
|
|
819
823
|
});
|
|
820
824
|
if (!authorized.ok) {
|
|
@@ -902,6 +906,8 @@ function createWebhookHandler(deps) {
|
|
|
902
906
|
account,
|
|
903
907
|
invalidTokenRateLimiter,
|
|
904
908
|
rateLimiter,
|
|
909
|
+
trustedProxies: deps.trustedProxies,
|
|
910
|
+
allowRealIpFallback: deps.allowRealIpFallback,
|
|
905
911
|
log,
|
|
906
912
|
bodyTimeoutMs: deps.bodyTimeoutMs
|
|
907
913
|
});
|
|
@@ -988,7 +994,7 @@ function validateSynologyGatewayAccountStartup(params) {
|
|
|
988
994
|
return { ok: true };
|
|
989
995
|
}
|
|
990
996
|
function registerSynologyWebhookRoute(params) {
|
|
991
|
-
const { account, log } = params;
|
|
997
|
+
const { cfg, account, log } = params;
|
|
992
998
|
const routeKey = getRouteKey(account);
|
|
993
999
|
const prevUnregister = activeRouteUnregisters.get(routeKey);
|
|
994
1000
|
if (prevUnregister) {
|
|
@@ -998,6 +1004,8 @@ function registerSynologyWebhookRoute(params) {
|
|
|
998
1004
|
}
|
|
999
1005
|
const handler = createWebhookHandler({
|
|
1000
1006
|
account,
|
|
1007
|
+
trustedProxies: cfg.gateway?.trustedProxies,
|
|
1008
|
+
allowRealIpFallback: cfg.gateway?.allowRealIpFallback === true,
|
|
1001
1009
|
deliver: async (msg) => await dispatchSynologyChatInboundEvent({
|
|
1002
1010
|
account,
|
|
1003
1011
|
msg,
|
|
@@ -1198,6 +1206,7 @@ function createSynologyChatPlugin() {
|
|
|
1198
1206
|
}).ok) return waitUntilAbort(abortSignal);
|
|
1199
1207
|
log?.info?.(`Starting Synology Chat channel (account: ${accountId}, path: ${account.webhookPath})`);
|
|
1200
1208
|
const unregister = registerSynologyWebhookRoute({
|
|
1209
|
+
cfg,
|
|
1201
1210
|
account,
|
|
1202
1211
|
accountId,
|
|
1203
1212
|
log
|
|
@@ -1255,6 +1264,7 @@ function createSynologyChatPlugin() {
|
|
|
1255
1264
|
outbound: {
|
|
1256
1265
|
deliveryMode: "gateway",
|
|
1257
1266
|
textChunkLimit: 2e3,
|
|
1267
|
+
sanitizeText: ({ text }) => sanitizeAssistantVisibleText(text),
|
|
1258
1268
|
sendText: sendSynologyChatText,
|
|
1259
1269
|
sendMedia: async (ctx) => {
|
|
1260
1270
|
if (!ctx.mediaUrl) throw new Error("Synology Chat media send requires mediaUrl");
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as synologyChatPlugin } from "./channel-
|
|
1
|
+
import { t as synologyChatPlugin } from "./channel-DJNRGYkN.js";
|
|
2
2
|
export { synologyChatPlugin };
|
package/npm-shrinkwrap.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openclaw/synology-chat",
|
|
3
|
-
"version": "2026.7.
|
|
3
|
+
"version": "2026.7.2-beta.1",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "@openclaw/synology-chat",
|
|
9
|
-
"version": "2026.7.
|
|
9
|
+
"version": "2026.7.2-beta.1",
|
|
10
10
|
"dependencies": {
|
|
11
11
|
"zod": "4.4.3"
|
|
12
12
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openclaw/synology-chat",
|
|
3
|
-
"version": "2026.7.
|
|
3
|
+
"version": "2026.7.2-beta.1",
|
|
4
4
|
"description": "Synology Chat channel plugin for OpenClaw channels and direct messages.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -27,10 +27,10 @@
|
|
|
27
27
|
"minHostVersion": ">=2026.4.10"
|
|
28
28
|
},
|
|
29
29
|
"compat": {
|
|
30
|
-
"pluginApi": ">=2026.7.
|
|
30
|
+
"pluginApi": ">=2026.7.2-beta.1"
|
|
31
31
|
},
|
|
32
32
|
"build": {
|
|
33
|
-
"openclawVersion": "2026.7.
|
|
33
|
+
"openclawVersion": "2026.7.2-beta.1"
|
|
34
34
|
},
|
|
35
35
|
"release": {
|
|
36
36
|
"publishToClawHub": true,
|
|
@@ -51,7 +51,7 @@
|
|
|
51
51
|
"README.md"
|
|
52
52
|
],
|
|
53
53
|
"peerDependencies": {
|
|
54
|
-
"openclaw": ">=2026.7.
|
|
54
|
+
"openclaw": ">=2026.7.2-beta.1"
|
|
55
55
|
},
|
|
56
56
|
"peerDependenciesMeta": {
|
|
57
57
|
"openclaw": {
|