Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Store usernames on the Also Known As stream rather than the profile #1183

Open
dysbulic opened this issue Mar 6, 2022 · 0 comments
Open
Labels
Ceramic Issues surrounding successful integration with the Ceramic Network feature request Feature Requests
Projects

Comments

@dysbulic
Copy link
Member

dysbulic commented Mar 6, 2022

What would you like to be added?

Currently, a player's username (the slug used to identify them in /player/<username>) is stored as a string in the extended profile.

While it is a part of a player's profile, it is possible that they will have different usernames on different sites, so a more flexible location to store it is in the Also Known As stream.

The AKA stream relies on a claim url which displays the user's DID within the site in question. There are also attestations which are JWT-encoded Verifiable Credentials issued by parties which have verified that the given claim URL is valid.

For MetaGame, we could create a URL that exists solely to return the DID associated with a username. Something like https://my.metagame.wtf/api/player/<username>/did.json.

It could return { did: <DID> } for the DID associated with the ETH address which username is an alias for. It should not be necessary to store the DID, but rather to look it up using a CAIP-10 link. If the username doesn't exist, return a 404. If there is no DID associated with the ETH address, return a 500 error.

Why is this needed?

The current mechanism for storing username's is brittle. Currently, the player sets their username in their profile and it is read by the cache. If it already exists, it causes a uniqueness exception in the profile table. When that exception is caught, the last five characters of their DID is appended to the name and the save is retried.

There is a check when they are setting their username that it doesn't already exist. It is possible though, either through malicious code or a race condition, that two players would set the same username. By switching to a system where the username is going to the server and being saved into Ceramic after it is set, it should eliminate this possibility and make for a cleaner system.

The username could remain in the extended profile as their preferred username. The formatting restrictions still need to be relaxed, see #1176.

@dysbulic dysbulic added the feature request Feature Requests label Mar 6, 2022
@dysbulic dysbulic added this to Backburner in MyMeta via automation Mar 6, 2022
@dysbulic dysbulic changed the title Store usernames as an Also Known As entry rather than on the profile Store usernames as an Also Known As stream rather than on the profile Mar 6, 2022
@dysbulic dysbulic changed the title Store usernames as an Also Known As stream rather than on the profile Store usernames on the Also Known As stream rather than the profile Mar 6, 2022
@dysbulic dysbulic added the Ceramic Issues surrounding successful integration with the Ceramic Network label Mar 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Ceramic Issues surrounding successful integration with the Ceramic Network feature request Feature Requests
Projects
Status: Backburner
MyMeta
  
Backburner
Development

No branches or pull requests

1 participant