Skip to content

fix(signal): honor wildcard in inbound allowlists - #5472

Merged
Re-bin merged 1 commit into
HKUDS:mainfrom
Wsp030914:fix/signal-wildcard-allowlist
Sep 3, 2026
Merged

Re-bin merged 1 commit into
HKUDS:mainfrom
Wsp030914:fix/signal-wildcard-allowlist

Conversation

@Wsp030914

Copy link
Copy Markdown
Contributor

Summary

  • honor * in Signal DM and group allowlist policy gates
  • preserve existing normalized sender matching and exact group ID matching
  • add receive-path regression tests that verify message content is preserved

Reproduction

Configure Signal with wildcard allowlists:

{
  channels: {
    signal: {
      enabled: true,
      phoneNumber: +10000000000,
      dm: {
        enabled: true,
        policy: allowlist,
        allowFrom: [*]
      },
      group: {
        enabled: true,
        policy: allowlist,
        allowFrom: [*],
        requireMention: false
      }
    }
  }
}

Send the bot a DM and a group message from identifiers not explicitly listed.

Actual behavior

The Signal-specific policy gate treats * as a literal identifier:

  • DMs are rejected by the nested policy gate. The pairing fallback then passes
    the channel-wide wildcard check with an empty payload, losing the original
    message content.
  • Group messages are dropped because the group ID does not equal *.

Expected behavior

* should retain the channel-wide allowlist meaning of allowing every sender
or group, and the original message content should reach the inbound bus.

Testing

  • uv run --no-sync pytest nanobot/channels/signal/tests/test_signal_channel.py nanobot/channels/signal/tests/test_signal_markdown.py -q — 190 passed
  • uv run --no-sync ruff check nanobot/channels/signal/runtime.py nanobot/channels/signal/tests/test_signal_channel.py
  • uv run --no-sync basedpyright nanobot/channels/signal/runtime.py nanobot/channels/signal/tests/test_signal_channel.py
  • git diff --check

@chengyongru chengyongru added bug Something isn't working channel fix priority: p2 Normal backlog: minor bug, enhancement, docs, cleanup, edge case, or unvalidated proposal. test labels Aug 21, 2026
@Re-bin
Re-bin force-pushed the fix/signal-wildcard-allowlist branch from fc91e39 to 97b8611 Compare September 3, 2026 06:03
@Re-bin
Re-bin force-pushed the fix/signal-wildcard-allowlist branch from 97b8611 to d023e07 Compare September 3, 2026 10:02

@Re-bin Re-bin left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Signal inbound DM and group checks now honor the documented wildcard allowlist without broadening access unless the operator explicitly configured it.

Signal regression tests and all current-head CI checks pass.

@Re-bin
Re-bin merged commit 0ec6aee into HKUDS:main Sep 3, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working channel fix priority: p2 Normal backlog: minor bug, enhancement, docs, cleanup, edge case, or unvalidated proposal. test

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants