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:
archipelago 2026-07-14 08:55:02 -04:00
parent dc3892182d
commit b5265f4633

View File

@ -2543,17 +2543,22 @@ app.post('/rpc/v1', (req, res) => {
}
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({
did: 'did:key:z6MkTest228NodeInvite',
onion: 'self228abc2def3ghi4jkl5mno6pqr7stu8vwx.onion',
pubkey: 'aabbccdd',
token: 'mock-invite-token-' + Date.now(),
trust,
})).toString('base64url')
return res.json({
result: {
code: mockCode,
did: 'did:key:z6MkTest228NodeInvite',
onion: 'self228abc2def3ghi4jkl5mno6pqr7stu8vwx.onion',
trust_level: trust,
},
})
}