You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

233 lines
9.7 KiB

  1. ========
  2. Profiles
  3. ========
  4. A description of Synapse user profile metadata support.
  5. Overview
  6. ========
  7. Internally within Synapse users are referred to by an opaque ID, which consists
  8. of some opaque localpart combined with the domain name of their home server.
  9. Obviously this does not yield a very nice user experience; users would like to
  10. see readable names for other users that are in some way meaningful to them.
  11. Additionally, users like to be able to publish "profile" details to inform other
  12. users of other information about them.
  13. It is also conceivable that since we are attempting to provide a
  14. worldwide-applicable messaging system, that users may wish to present different
  15. subsets of information in their profile to different other people, from a
  16. privacy and permissions perspective.
  17. A Profile consists of a display name, an (optional?) avatar picture, and a set
  18. of other metadata fields that the user may wish to publish (email address, phone
  19. numbers, website URLs, etc...). We put no requirements on the display name other
  20. than it being a valid Unicode string. Since it is likely that users will end up
  21. having multiple accounts (perhaps by necessity of being hosted in multiple
  22. places, perhaps by choice of wanting multiple distinct identifies), it would be
  23. useful that a metadata field type exists that can refer to another Synapse User
  24. ID, so that clients and HSes can make use of this information.
  25. Metadata Fields
  26. ---------------
  27. [[TODO(paul): Likely this list is incomplete; more fields can be defined as we
  28. think of them. At the very least, any sort of supported ID for the 3rd Party ID
  29. servers should be accounted for here.]]
  30. * Synapse Directory Server username(s)
  31. * Email address
  32. * Phone number - classify "home"/"work"/"mobile"/custom?
  33. * Twitter/Facebook/Google+/... social networks
  34. * Location - keep this deliberately vague to allow people to choose how
  35. granular it is
  36. * "Bio" information - date of birth, etc...
  37. * Synapse User ID of another account
  38. * Web URL
  39. * Freeform description text
  40. Visibility Permissions
  41. ======================
  42. A home server implementation could offer the ability to set permissions on
  43. limited visibility of those fields. When another user requests access to the
  44. target user's profile, their own identity should form part of that request. The
  45. HS implementation can then decide which fields to make available to the
  46. requestor.
  47. A particular detail of implementation could allow the user to create one or more
  48. ACLs; where each list is granted permission to see a given set of non-public
  49. fields (compare to Google+ Circles) and contains a set of other people allowed
  50. to use it. By giving these ACLs strong identities within the HS, they can be
  51. referenced in communications with it, granting other users who encounter these
  52. the "ACL Token" to use the details in that ACL.
  53. If we further allow an ACL Token to be present on Room join requests or stored
  54. by 3PID servers, then users of these ACLs gain the extra convenience of not
  55. having to manually curate people in the access list; anyone in the room or with
  56. knowledge of the 3rd Party ID is automatically granted access. Every HS and
  57. client implementation would have to be aware of the existence of these ACL
  58. Token, and include them in requests if present, but not every HS implementation
  59. needs to actually provide the full permissions model. This can be used as a
  60. distinguishing feature among competing implementations. However, servers MUST
  61. NOT serve profile information from a cache if there is a chance that its limited
  62. understanding could lead to information leakage.
  63. Client Concerns of Multiple Accounts
  64. ====================================
  65. Because a given person may want to have multiple Synapse User accounts, client
  66. implementations should allow the use of multiple accounts simultaneously
  67. (especially in the field of mobile phone clients, which generally don't support
  68. running distinct instances of the same application). Where features like address
  69. books, presence lists or rooms are presented, the client UI should remember to
  70. make distinct with user account is in use for each.
  71. Directory Servers
  72. =================
  73. Directory Servers can provide a forward mapping from human-readable names to
  74. User IDs. These can provide a service similar to giving domain-namespaced names
  75. for Rooms; in this case they can provide a way for a user to reference their
  76. User ID in some external form (e.g. that can be printed on a business card).
  77. The format for Synapse user name will consist of a localpart specific to the
  78. directory server, and the domain name of that directory server:
  79. @localname:some.domain.name
  80. The localname is separated from the domain name using a colon, so as to ensure
  81. the localname can still contain periods, as users may want this for similarity
  82. to email addresses or the like, which typically can contain them. The format is
  83. also visually quite distinct from email addresses, phone numbers, etc... so
  84. hopefully reasonably "self-describing" when written on e.g. a business card
  85. without surrounding context.
  86. [[TODO(paul): we might have to think about this one - too close to email?
  87. Twitter? Also it suggests a format scheme for room names of
  88. #localname:domain.name, which I quite like]]
  89. Directory server administrators should be able to make some kind of policy
  90. decision on how these are allocated. Servers within some "closed" domain (such
  91. as company-specific ones) may wish to verify the validity of a mapping using
  92. their own internal mechanisms; "public" naming servers can operate on a FCFS
  93. basis. There are overlapping concerns here with the idea of the 3rd party
  94. identity servers as well, though in this specific case we are creating a new
  95. namespace to allocate names into.
  96. It would also be nice from a user experience perspective if the profile that a
  97. given name links to can also declare that name as part of its metadata.
  98. Furthermore as a security and consistency perspective it would be nice if each
  99. end (the directory server and the user's home server) check the validity of the
  100. mapping in some way. This needs investigation from a security perspective to
  101. ensure against spoofing.
  102. One such model may be that the user starts by declaring their intent to use a
  103. given user name link to their home server, which then contacts the directory
  104. service. At some point later (maybe immediately for "public open FCFS servers",
  105. maybe after some kind of human intervention for verification) the DS decides to
  106. honour this link, and includes it in its served output. It should also tell the
  107. HS of this fact, so that the HS can present this as fact when requested for the
  108. profile information. For efficiency, it may further wish to provide the HS with
  109. a cryptographically-signed certificate as proof, so the HS serving the profile
  110. can provide that too when asked, avoiding requesting HSes from constantly having
  111. to contact the DS to verify this mapping. (Note: This is similar to the security
  112. model often applied in DNS to verify PTR <-> A bidirectional mappings).
  113. Identity Servers
  114. ================
  115. The identity servers should support the concept of pointing a 3PID being able to
  116. store an ACL Token as well as the main User ID. It is however, beyond scope to
  117. do any kind of verification that any third-party IDs that the profile is
  118. claiming match up to the 3PID mappings.
  119. User Interface and Expectations Concerns
  120. ========================================
  121. Given the weak "security" of some parts of this model as compared to what users
  122. might expect, some care should be taken on how it is presented to users,
  123. specifically in the naming or other wording of user interface components.
  124. Most notably mere knowledge of an ACL Pointer is enough to read the information
  125. stored in it. It is possible that Home or Identity Servers could leak this
  126. information, allowing others to see it. This is a security-vs-convenience
  127. balancing choice on behalf of the user who would choose, or not, to make use of
  128. such a feature to publish their information.
  129. Additionally, unless some form of strong end-to-end user-based encryption is
  130. used, a user of ACLs for information privacy has to trust other home servers not
  131. to lie about the identify of the user requesting access to the Profile.
  132. API Requirements
  133. ================
  134. The data model presented here puts the following requirements on the APIs:
  135. Client-Server
  136. -------------
  137. Requests that a client can make to its Home Server
  138. * get/set my Display Name
  139. This should return/take a simple "text/plain" field
  140. * get/set my Avatar URL
  141. The avatar image data itself is not stored by this API; we'll just store a
  142. URL to let the clients fetch it. Optionally HSes could integrate this with
  143. their generic content attacmhent storage service, allowing a user to set
  144. upload their profile Avatar and update the URL to point to it.
  145. * get/add/remove my metadata fields
  146. Also we need to actually define types of metadata
  147. * get another user's Display Name / Avatar / metadata fields
  148. [[TODO(paul): At some later stage we should consider the API for:
  149. * get/set ACL permissions on my metadata fields
  150. * manage my ACL tokens
  151. ]]
  152. Server-Server
  153. -------------
  154. Requests that Home Servers make to others
  155. * get a user's Display Name / Avatar
  156. * get a user's full profile - name/avatar + MD fields
  157. This request must allow for specifying the User ID of the requesting user,
  158. for permissions purposes. It also needs to take into account any ACL Tokens
  159. the requestor has.
  160. * push a change of Display Name to observers (overlaps with the presence API)
  161. Room Event PDU Types
  162. --------------------
  163. Events that are pushed from Home Servers to other Home Servers or clients.
  164. * user Display Name change
  165. * user Avatar change
  166. [[TODO(paul): should the avatar image itself be stored in all the room
  167. histories? maybe this event should just be a hint to clients that they should
  168. re-fetch the avatar image]]