Welcome

@Serializable
@SerialName(value = "welcome")
data class Welcome(val assignedPeerId: String, val displayName: String, val sessionId: String, val key: DidKey, val deviceId: String? = null, val roomId: String? = null, val returnKind: ReturnKind? = null, val answers: ByteArray? = null, val membership: String? = null, val grant: ByteArray? = null, val previousPeerId: String? = null) : AdmitMessage

Sent by the host to confirm admission.

Also broadcast to all other already-admitted members so they can update their rosters. Four shapes, all minted by the host:

  • the direct Welcome, to the member it names, the one that answers that member's Hello;

  • its roster copy, to every other member;

  • a bootstrap Welcome per existing member, to the new member;

  • the host's own intro, to the new member.

assignedPeerId — the us.tractat.kuilt.core.PeerId value of the member this Welcome names. displayName, sessionId, deviceId — the identity that member was admitted with. roomId — the host's stable room identifier, on the direct Welcome and its roster copy; null on bootstrap Welcomes and the host intro. A joiner learns Room.roomId from it. key — the device key of the member assignedPeerId names (v3, #3210), on all four shapes: the direct Welcome and its roster copy carry the joiner's key from its Hello; a bootstrap Welcome carries an existing member's key as the host recorded it; the host intro carries the host's own key. Every one is the host's assertion. Required on the wire, unlike Hello.key: a v2 host, the only sender of a keyless Welcome, refuses a v3 Hello before it admits anyone, so a v3 joiner never receives one. returnKind — set on the direct Welcome when the host restored a seat it was holding rather than admitting a new member (v5, #3212): under the same peer id, or, taking over a partitioned seat of the same key, under a new one (v6, #3213). ReturnKind.Returning (v9, #3222) marks a device let back in on its pass, and rides the roster copy as well, so every member hears it. null is an ordinary admission. It describes the host's decision; a joiner reads a restore from membership instead, since only that names which membership came back. answers — the Hello.joinerNonce of the Hello this Welcome answers (v7, #3215), on the direct Welcome, the bootstrap Welcomes and the host intro; never on a roster copy. A joiner takes a direct Welcome as the answer to its Hello only when this equals the nonce of the latest Hello it sent, so a Welcome that answers an older Hello — the one before a reconnect, say — never closes the reconnect that followed it. On a bootstrap Welcome and the intro it says only which admission burst the frame belongs to (#3615): a joiner drops either when it names an older Hello, since that burst's view of the roster may be stale, and rebuilds its roster on the intro of the burst answering its latest Hello. Neither names the joiner, so neither is ever taken as the answer. Width Hello.JOINER_NONCE_SIZE, checked in the constructor. membership — an opaque id the host minted when it admitted this membership (v7, #3215), on the direct Welcome only. A restored seat keeps the id it had, and every new admission gets a new one. So a joiner that compares the id on the Welcome answering its reconnect with the one it already holds knows whether it came back to its own seat (the same id) or was admitted afresh because the seat was gone (any other id). grant — the wire form of a signed us.tractat.kuilt.identity.Grant the host issued the member this Welcome admits (v8, #3221), on the direct Welcome only: its pass back in, which the joiner keeps in its us.tractat.kuilt.identity.DeviceKeyStore. The host renews it while the member stays connected (GrantRenewal). null when the host issued none: it withheld the pass from a device revoked since this membership was admitted, or it could not sign. Opaque here, like Challenge.statement: a grant is checked over exactly the bytes its issuer signed. Compared by content. previousPeerId — on a Welcome marked ReturnKind.Returning (v9, #3222), the direct one and its roster copy: the peer id this device last held a seat under in this room, while the host still remembers it. null when it does not: the host restarted since, or the last pass it gave that membership has run out. null on every other Welcome.

Constructors

Link copied to clipboard
constructor(assignedPeerId: String, displayName: String, sessionId: String, key: DidKey, deviceId: String? = null, roomId: String? = null, returnKind: ReturnKind? = null, answers: ByteArray? = null, membership: String? = null, grant: ByteArray? = null, previousPeerId: String? = null)

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val key: DidKey
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Functions

Link copied to clipboard
open operator override fun equals(other: Any?): Boolean

Compares answers and grant by content: a decoded Welcome equals the one that was encoded.

Link copied to clipboard
open override fun hashCode(): Int