diff --git a/lib/plugin-hub.cjs b/lib/plugin-hub.cjs index 7fdd433..6c8a75b 100644 --- a/lib/plugin-hub.cjs +++ b/lib/plugin-hub.cjs @@ -23,12 +23,13 @@ module.exports = { manifest: { createTunnel: 'duplex', ping: 'sync', + metadata: 'async', attendants: 'source', createToken: 'sync', }, permissions: { anonymous: { - allow: ['createTunnel', 'ping', 'attendants', 'createToken'], + allow: ['createTunnel', 'ping', 'metadata', 'attendants', 'createToken'], }, }, init(sstack, config) { @@ -43,7 +44,7 @@ module.exports = { // Ensure that client connections are only from members or to-be members sstack.auth.hook(function (fn, args) { const [clientMetadata, cb] = args - const {pubkey, extra} = clientMetadata + const { pubkey, extra } = clientMetadata if (Members.has(pubkey)) { debug('authorized member %s to connect', pubkey) cb(null, true) @@ -93,6 +94,10 @@ module.exports = { return cat([initial, notifyAttendants.listen()]) }, + metadata(cb) { + cb(null, { name: '' }) + }, + createTunnel(target) { if (attendants.has(target)) { // prettier-ignore