mirror of
https://github.com/hansjone/dsh-im-ops.git
synced 2026-10-11 08:10:50 +08:00
Add Telegram and Discord IM channels
This commit is contained in:
parent
7123fce47a
commit
cb74e1c4c7
66 changed files with 8579 additions and 1910 deletions
17
test/rpc-authority.test.mjs
Normal file
17
test/rpc-authority.test.mjs
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
import assert from 'node:assert/strict';
|
||||
import test from 'node:test';
|
||||
|
||||
import { resolveRpcAuthority } from '../plugin-src/host/rpc-authority.mjs';
|
||||
|
||||
test('IM management RPC authority defaults to loopback and accepts explicit trusted hosts', () => {
|
||||
assert.equal(resolveRpcAuthority(), 'loopback');
|
||||
assert.equal(resolveRpcAuthority('loopback'), 'loopback');
|
||||
assert.equal(resolveRpcAuthority('trusted-host'), 'trusted-host');
|
||||
});
|
||||
|
||||
test('IM management RPC authority rejects unknown policy values', () => {
|
||||
assert.throws(
|
||||
() => resolveRpcAuthority('public'),
|
||||
/rpcAuthority must be "loopback" or "trusted-host"/,
|
||||
);
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue