feat(demo): mock federation.invite carries the trust level
Parity with the backend's invite trust threading so the demo's Invite a Peer / Link Your Nodes flows show the right level end-to-end. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
parent
dc3892182d
commit
b5265f4633
@ -2543,17 +2543,22 @@ app.post('/rpc/v1', (req, res) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
case 'federation.invite': {
|
case 'federation.invite': {
|
||||||
|
// trust level threads through the invite (backend parity):
|
||||||
|
// "Invite a Peer" sends observer, "Link Your Nodes" trusted.
|
||||||
|
const trust = params?.trust_level === 'observer' ? 'observer' : 'trusted'
|
||||||
const mockCode = 'fed1:' + Buffer.from(JSON.stringify({
|
const mockCode = 'fed1:' + Buffer.from(JSON.stringify({
|
||||||
did: 'did:key:z6MkTest228NodeInvite',
|
did: 'did:key:z6MkTest228NodeInvite',
|
||||||
onion: 'self228abc2def3ghi4jkl5mno6pqr7stu8vwx.onion',
|
onion: 'self228abc2def3ghi4jkl5mno6pqr7stu8vwx.onion',
|
||||||
pubkey: 'aabbccdd',
|
pubkey: 'aabbccdd',
|
||||||
token: 'mock-invite-token-' + Date.now(),
|
token: 'mock-invite-token-' + Date.now(),
|
||||||
|
trust,
|
||||||
})).toString('base64url')
|
})).toString('base64url')
|
||||||
return res.json({
|
return res.json({
|
||||||
result: {
|
result: {
|
||||||
code: mockCode,
|
code: mockCode,
|
||||||
did: 'did:key:z6MkTest228NodeInvite',
|
did: 'did:key:z6MkTest228NodeInvite',
|
||||||
onion: 'self228abc2def3ghi4jkl5mno6pqr7stu8vwx.onion',
|
onion: 'self228abc2def3ghi4jkl5mno6pqr7stu8vwx.onion',
|
||||||
|
trust_level: trust,
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user