mirror of https://codeberg.org/pzp/pzp-hub.git
add hub.metadata() RPC as a placeholder for now
This commit is contained in:
parent
9998885daf
commit
c6003d42bf
|
@ -23,12 +23,13 @@ module.exports = {
|
||||||
manifest: {
|
manifest: {
|
||||||
createTunnel: 'duplex',
|
createTunnel: 'duplex',
|
||||||
ping: 'sync',
|
ping: 'sync',
|
||||||
|
metadata: 'async',
|
||||||
attendants: 'source',
|
attendants: 'source',
|
||||||
createToken: 'sync',
|
createToken: 'sync',
|
||||||
},
|
},
|
||||||
permissions: {
|
permissions: {
|
||||||
anonymous: {
|
anonymous: {
|
||||||
allow: ['createTunnel', 'ping', 'attendants', 'createToken'],
|
allow: ['createTunnel', 'ping', 'metadata', 'attendants', 'createToken'],
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
init(sstack, config) {
|
init(sstack, config) {
|
||||||
|
@ -43,7 +44,7 @@ module.exports = {
|
||||||
// Ensure that client connections are only from members or to-be members
|
// Ensure that client connections are only from members or to-be members
|
||||||
sstack.auth.hook(function (fn, args) {
|
sstack.auth.hook(function (fn, args) {
|
||||||
const [clientMetadata, cb] = args
|
const [clientMetadata, cb] = args
|
||||||
const {pubkey, extra} = clientMetadata
|
const { pubkey, extra } = clientMetadata
|
||||||
if (Members.has(pubkey)) {
|
if (Members.has(pubkey)) {
|
||||||
debug('authorized member %s to connect', pubkey)
|
debug('authorized member %s to connect', pubkey)
|
||||||
cb(null, true)
|
cb(null, true)
|
||||||
|
@ -93,6 +94,10 @@ module.exports = {
|
||||||
return cat([initial, notifyAttendants.listen()])
|
return cat([initial, notifyAttendants.listen()])
|
||||||
},
|
},
|
||||||
|
|
||||||
|
metadata(cb) {
|
||||||
|
cb(null, { name: '' })
|
||||||
|
},
|
||||||
|
|
||||||
createTunnel(target) {
|
createTunnel(target) {
|
||||||
if (attendants.has(target)) {
|
if (attendants.has(target)) {
|
||||||
// prettier-ignore
|
// prettier-ignore
|
||||||
|
|
Loading…
Reference in New Issue