mirror of
https://github.com/hansjone/dsh-im-ops.git
synced 2026-10-09 01:53:21 +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
11
plugin-src/host/rpc-authority.mjs
Normal file
11
plugin-src/host/rpc-authority.mjs
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
const RPC_AUTHORITIES = new Set(['loopback', 'trusted-host']);
|
||||
|
||||
/**
|
||||
* Resolve the browser authority accepted by an IM management RPC channel.
|
||||
* The default keeps credential and bot-management operations on loopback.
|
||||
*/
|
||||
export function resolveRpcAuthority(value) {
|
||||
if (value === undefined) return 'loopback';
|
||||
if (RPC_AUTHORITIES.has(value)) return value;
|
||||
throw new TypeError('dsh-im rpcAuthority must be "loopback" or "trusted-host"');
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue