





























@@ -20,11 +20,11 @@ describe("resolveDiscordDmCommandAccess", () => {
2020});
2121}
222223-it("allows open DMs and keeps command auth enabled without allowlist entries", async () => {
23+it("blocks open DMs without allowlist wildcard entries", async () => {
2424const result = await resolveOpenDmAccess([]);
252526-expect(result.decision).toBe("allow");
27-expect(result.commandAuthorized).toBe(true);
26+expect(result.decision).toBe("block");
27+expect(result.commandAuthorized).toBe(false);
2828});
29293030it("marks command auth true when sender is allowlisted", async () => {
@@ -34,7 +34,7 @@ describe("resolveDiscordDmCommandAccess", () => {
3434expect(result.commandAuthorized).toBe(true);
3535});
363637-it("keeps command auth enabled for open DMs when configured allowlist does not match", async () => {
37+it("blocks open DMs when configured allowlist does not match", async () => {
3838const result = await resolveDiscordDmCommandAccess({
3939accountId: "default",
4040dmPolicy: "open",
@@ -45,9 +45,9 @@ describe("resolveDiscordDmCommandAccess", () => {
4545readStoreAllowFrom: async () => [],
4646});
474748-expect(result.decision).toBe("allow");
48+expect(result.decision).toBe("block");
4949expect(result.allowMatch.allowed).toBe(false);
50-expect(result.commandAuthorized).toBe(true);
50+expect(result.commandAuthorized).toBe(false);
5151});
52525353it("returns pairing decision and unauthorized command auth for unknown senders", async () => {
@@ -80,7 +80,7 @@ describe("resolveDiscordDmCommandAccess", () => {
8080expect(result.commandAuthorized).toBe(true);
8181});
828283-it("keeps open DM command auth true when access groups are disabled", async () => {
83+it("keeps open DM blocked without wildcard even when access groups are disabled", async () => {
8484const result = await resolveDiscordDmCommandAccess({
8585accountId: "default",
8686dmPolicy: "open",
@@ -91,7 +91,7 @@ describe("resolveDiscordDmCommandAccess", () => {
9191readStoreAllowFrom: async () => [],
9292});
939394-expect(result.decision).toBe("allow");
95-expect(result.commandAuthorized).toBe(true);
94+expect(result.decision).toBe("block");
95+expect(result.commandAuthorized).toBe(false);
9696});
9797});
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。