Expand description
Nick + domain identities of this messenger server.
The server keeps no user database: it knows a nick, the Matrix localpart
derived from it (lowercase nick at FIRST CONTACT, frozen from then on), the
first-contact time, and the devices of the credentials a product vouches
for. Who a person is, how they log in and which nick rules apply are the
product server’s business; the product tells this server by signed
assertion (m4a_seam) and by lifecycle events.
Remote federated users are NOT identities: they stay negative-id proxy rows
in matrix_users.
Structs§
- Identity
- Reconcile
Outcome - What a reconcile pass changed.
- Resolved
- What a valid assertion resolved to.
Constants§
- NICK_
MAX - Longest nick the server will turn into a localpart.
Functions§
- apply_
account_ deleted - Event
account.deleted{nick}: devices gone, localpart tombstoned forever, the nick string freed. Returns whether an identity was retired. - apply_
credential_ revoked - Event
credential.revoked{cred_ref}: the device is removed. Returns the user id to wake. - apply_
nick_ changed - Event
nick.changed{old,new}.Ok(Some(id))when applied. - create_
identities_ schema - identity_
by_ id - identity_
by_ nick - legal_
localpart - The only nick check the server makes itself: the nick must be a legal, predictable Matrix localpart. Product nick rules are the product’s.
- name_
taken - Is
lowerunavailable as a nick or localpart for anyone butexcept_id? - nick_
of_ user - Current nick of an identity, for display labels.
- reconcile
- Apply the product’s snapshot of live credentials. Devices of a listed nick whose
credential is not in its list are removed; with
complete, identities whose nick is not listed at all are retired exactly asaccount.deletedwould. - resolve_
assertion - Resolve a verified assertion: find the identity by nick, else by the credential’s device (the product renamed the nick; follow it softly), else create it. Creation IS first contact: the Matrix user is made and the localpart frozen in the same transaction. Then the credential’s device.