| … | … | @@ -282,7 +282,9 @@ export class Peer { |
| 282 | 282 | networks: Array.isArray(fm.networks) ? fm.networks : [], |
| 283 | 283 | // identity.md §5.1 — the DESIGNATED credential. With none, a projection that needs one is |
| 284 | 284 | // withheld rather than published under a guess. |
| 285 | | credential: fm.credential || null |
| 285 | credential: fm.credential || null, |
| 286 | // The name a bridge grant produced, e.g. `alice@ap.example`. Absent until one is claimed. |
| 287 | fediverse: fm.fediverse || null |
| 286 | 288 | } |
| 287 | 289 | } |
| 288 | 290 | |
| … | … | @@ -325,10 +327,10 @@ export class Peer { |
| 325 | 327 | } |
| 326 | 328 | |
| 327 | 329 | /** Merges: a write naming only `networks` leaves the credential alone, and the reverse. */ |
| 328 | | async setReach ({ networks, credential } = {}) { |
| 330 | async setReach ({ networks, credential, fediverse } = {}) { |
| 329 | 331 | await this.feed.update() |
| 330 | 332 | const current = await this.reach() |
| 331 | | const fm = { networks: current.networks, credential: current.credential } |
| 333 | const fm = { networks: current.networks, credential: current.credential, fediverse: current.fediverse } |
| 332 | 334 | |
| 333 | 335 | if (networks !== undefined) { |
| 334 | 336 | if (!Array.isArray(networks)) throw new Error('setReach: networks must be an array') |
| … | … | @@ -345,7 +347,19 @@ export class Peer { |
| 345 | 347 | if (credential !== undefined) { |
| 346 | 348 | fm.credential = credential ? String(credential).slice(0, 256) : null |
| 347 | 349 | } |
| 350 | // ⛔ A HANDLE, NOT A CREDENTIAL. identity.md §5.1's `credential` is the DESIGNATED ATPROTO one |
| 351 | // and says so; the fediverse has no equivalent because §6 makes a bridge a RESOURCE you hold a |
| 352 | // grant on. What is recorded here is the name that grant produced — `alice@ap.example` — so the |
| 353 | // node can say where it publishes without pretending the two networks work the same way. |
| 354 | // |
| 355 | // ⚠ The daemon never learns what a fediverse IS. `fediverse` is already one of reach.js's |
| 356 | // NETWORKS, so this names a destination it can already name and nothing more; boundary.test.js |
| 357 | // forbids the projection vocabulary, not the word. |
| 358 | if (fediverse !== undefined) { |
| 359 | fm.fediverse = fediverse ? String(fediverse).slice(0, 256) : null |
| 360 | } |
| 348 | 361 | if (!fm.credential) delete fm.credential |
| 362 | if (!fm.fediverse) delete fm.fediverse |
| 349 | 363 | await this.feed.put(REACH, SELF, { frontmatter: fm, body: '' }) |
| 350 | 364 | return this.reach() |
| 351 | 365 | } |