-
-
Notifications
You must be signed in to change notification settings - Fork 16
Description
The "source of truth" for identity and users in Jupyter comes from the Jupyter Server identity module here. This has the following attributes (ignoring color, avatar, initials):
username: str # the only truly required field # these fields are filled from username if not specified, name is the 'real' name of the user name: str = "" # display_name is a shorter name for us in UI, if different from name. e.g. a nickname display_name: str = ""The key here is that the username is the unique field and when hooked up to an identity provider (such as Github/Google oauth) it takes a value that matches the username of the underlying identity provider (for example, username=ellisonbg for me on GitHub).
The IUser class in Jupyter chat matches this data model exactly, but adds
mention_name
andbot
. I believe theIUser
class in jupyter_chat (both server and frontend) should match that of the Jupyter Server User class.Why did we introduce
mention_name
? I suspect (please correct me if I am wrong) that we introducedmention_name
because the default random anonymous Identity Provider ("Anonymous ") choose to use uuids for the username. While these approach satisfies the requirement of uniqueness, it doesn't satisfy the usual requirement that usernames are also human friendly. Because username didn't meet this human friendly requirement, we needed another name that did (with the logiclet mention_name = this.display_name || this.name || this.username;
).Based on this, I would propose the following:
- Submit a PR to Jupyter Server that ensures the default random anonymous identity provider uses usernames that are both unique and human friendly (I don't mind doing this, it is a minor change).
- Remove
mention_name
from the jupyter_chatIUser
interface and useusername
as the human readable, unique name that is used for at mentioning. With this change, Jupyter chat will follow the pattern that is used by other applications familiar to Jupyter users (GitHub, Slack, etc.).- Maybe move
bot: bool
down into Jupyter Server as well (less clear on this one, but definitely makes things simple).Let me know what people think and I can submit the PR to Jupyter Server.
Originally posted by @ellisonbg in #245