mirror of
https://github.com/hansjone/dsh-im-ops.git
synced 2026-10-10 23:10:46 +08:00
Restrict delivery HTTP to loopback and fix grant races.
Require trusted loopback requests for proactive send, accept hyphenated WhatsApp group JIDs, and serialize access-grant mutations to avoid lost concurrent updates. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
parent
01924e5f7e
commit
cbbf373b6a
8 changed files with 411 additions and 240 deletions
|
|
@ -34,6 +34,17 @@ function grant(overrides = {}) {
|
|||
});
|
||||
}
|
||||
|
||||
test('ACCESS_GRANT_GROUP_JID_PATTERN accepts legacy hyphen group JIDs', () => {
|
||||
const legacy = '123456789-120363000000000000@g.us';
|
||||
assert.doesNotThrow(() => validateAccessGrant({
|
||||
...emptyAccessGrant(),
|
||||
globalAdmins: ['8618111111111'],
|
||||
groups: {
|
||||
[legacy]: { admins: [], members: [] },
|
||||
},
|
||||
}));
|
||||
});
|
||||
|
||||
test('normalizeAccessPhone accepts E.164, JIDs, and rejects LID servers', () => {
|
||||
assert.equal(normalizeAccessPhone('+86 181-4238-7786'), '8618142387786');
|
||||
assert.equal(normalizeAccessPhone('8618142387786@s.whatsapp.net'), '8618142387786');
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue