Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/JAVA/Openclaw/extensions/synology-chat/src/   (KI Agentensystem Version 22©)  Datei vom 26.3.2026 mit Größe 2 kB image not shown  

Quelle  security-audit.test.ts

  Sprache: JAVA
 

Spracherkennung für: .ts vermutete Sprache: Unknown {[0] [0] [0]} [Methode: Schwerpunktbildung, einfache Gewichte, sechs Dimensionen]

import { describe, expect, it } from "vitest";
import { collectSynologyChatSecurityAuditFindings } from "./security-audit.js";
import type { ResolvedSynologyChatAccount } from "./types.js";

function createAccount(params: {
  accountId: string;
  dangerouslyAllowNameMatching?: boolean;
}): ResolvedSynologyChatAccount {
  return {
    accountId: params.accountId,
    enabled: true,
    token: "t",
    incomingUrl: "https://nas.example.com/incoming",
    nasHost: "https://nas.example.com",
    webhookPath: "/webapi/entry.cgi",
    webhookPathSource: "explicit",
    dangerouslyAllowNameMatching: params.dangerouslyAllowNameMatching ?? false,
    dangerouslyAllowInheritedWebhookPath: false,
    dmPolicy: "allowlist",
    allowedUserIds: [],
    rateLimitPerMinute: 30,
    botName: "OpenClaw",
    allowInsecureSsl: false,
  };
}

describe("Synology Chat security audit findings", () => {
  it.each([
    {
      name: "audits base dangerous name matching",
      accountId: "default",
      orderedAccountIds: [] as string[],
      hasExplicitAccountPath: false,
      expectedMatch: {
        checkId: "channels.synology-chat.reply.dangerous_name_matching_enabled",
        severity: "info",
        title: "Synology Chat dangerous name matching is enabled",
      },
    },
    {
      name: "audits non-default accounts for dangerous name matching",
      accountId: "beta",
      orderedAccountIds: ["alpha", "beta"],
      hasExplicitAccountPath: true,
      expectedMatch: {
        checkId: "channels.synology-chat.reply.dangerous_name_matching_enabled",
        severity: "info",
        title: expect.stringContaining("(account: beta)"),
      },
    },
  ])("$name", (testCase) => {
    const findings = collectSynologyChatSecurityAuditFindings({
      account: createAccount({
        accountId: testCase.accountId,
        dangerouslyAllowNameMatching: true,
      }),
      accountId: testCase.accountId,
      orderedAccountIds: testCase.orderedAccountIds,
      hasExplicitAccountPath: testCase.hasExplicitAccountPath,
    });

    expect(findings).toEqual(
      expect.arrayContaining([expect.objectContaining(testCase.expectedMatch)]),
    );
  });
});

¤ Dauer der Verarbeitung: 0.0 Sekunden  (vorverarbeitet am  2026-04-27) ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

Beweissystem der NASA

Beweissystem Isabelle

NIST Cobol Testsuite

Cephes Mathematical Library

Wiener Entwicklungsmethode

Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.

Bemerkung:

Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.