Registration.md
October 8, 2021 ยท View on GitHub
Alias registration
An internal user who does not have an alias in the current room server can choose to register an alias. Not all internal users need to have aliases, so the process described here is optional.
Specification
- An internal user with SSB ID
feedIdand a room server with SSB IDroomIdare connected to each other via secret-handshake - The internal user chooses a
aliasas a candidate alias string - The internal user calls a specific muxrpc
asyncAPIroom.registerAlias(alias, signature)wheresignatureis a cryptographic signature of the string=room-alias-registration:${roomId}:${feedId}:${alias}usingfeedId's cryptographic keypair, read more about it in the alias database spec - The room, upon receiving the
room.registerAliasmuxrpc call, checks whether thataliasis valid (see spec in Alias string)- If it is invalid, respond
room.registerAliaswith an error - Else, proceed (below)
- If it is invalid, respond
- The room checks whether there already exists an entry in the Alias database with the key
alias- If there is, respond
room.registerAliaswith an error - Else, proceed (below)
- If there is, respond
- The room adds an entry to its Alias database for
key=alias&value=feedId+sig - The room responds
room.registerAliaswith a string containing the Alias endpoint URL for the newly registered alias, indicating success - The internal user receives the room's response to
room.registerAlias- If it is an error, then (optionally) display a user interface failure to register the alias
- If it is a successful
urlstring, then the internal user MAY publish an SSB msg of typeaboutwith a field listing all its aliases for various rooms, where this specificurlis included. The specific schema of the message type is an application-level concern
The above algorithm is also provided below as a UML sequence diagram:
sequenceDiagram
participant U as SSB peer
participant R as Room server
U->>R: (muxrpc async) `room.registerAlias(alias, signature)`
alt `alias` is an invalid alias string<br/>or already taken in the alias database<br/>or other errors
R-->>U: Respond room.registerAlias with an error
opt
U->>U: Display user interface error
end
else else
R->>R: Adds an entry to<br/>its alias database
R-->>U: Respond `room.registerAlias` with a `url` string
U->>U: Publishes an SSB<br/>msg of type<br/>`about`
end
Security considerations
Malicious internal user
A malicious internal user could take many or all possible aliases in case the room accidentally allows such malicious user to become an internal user. Arguably, some room implementations could choose to allow only one alias per internal user, and that would still be compliant with this spec.
Malicious room admin
The room admin could reply with errors when technically the muxrpc should have succeeded, e.g. pretending that the alias candidate is invalid or pretending that it's already registered.