Commit graph

4 commits

Author SHA1 Message Date
Ashid332
cfa640780a fix: skip canonical ID parsing for @-prefixed allow_from entries (#2815)
Matrix user IDs (MXIDs) contain colons (e.g. @alice:matrix.org) which
caused MatchAllowed to misinterpret them as canonical platform:id pairs.
The @ prefix in the allow_from entry is an explicit signal of a username
or MXID, not a platform:id separator.

Changes:
- Move isAtUsername check before the canonical parsing block
- Gate canonical parsing with !isAtUsername to skip it for @ entries
- Add direct match of full @-prefixed entry against PlatformID/Username
- Add test cases covering all Matrix allow_from formats from the issue

Fixes #2815
2026-05-08 21:42:54 +05:30
Badgerbees
bc0be17e88 fix(identity): support negative integers in isNumeric for Telegram group IDs 2026-03-21 17:09:02 +07:00
美電球
4ccea5eb93
fix(identity): prevent allowlist ID entries from matching usernames (#1406) 2026-03-13 15:41:18 +08:00
Hoshina
56d80373eb feat(identity): add unified user identity with canonical platform:id format
Introduce SenderInfo struct and pkg/identity package to standardize user
identification across all channels. Each channel now constructs structured
sender info (platform, platformID, canonicalID, username, displayName)
instead of ad-hoc string IDs. Allow-list matching supports all legacy
formats (numeric ID, @username, id|username) plus the new canonical
"platform:id" format. Session key resolution also handles canonical
peerIDs for backward-compatible identity link matching.
2026-02-23 06:56:48 +08:00