Skip to content
This repository has been archived by the owner on Aug 1, 2023. It is now read-only.

Adds model config to validate usernames #44

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

hstove
Copy link
Collaborator

@hstove hstove commented Jul 24, 2019

This adds a static property to Model called validateUsername. By default, this is false. If true, then Radiks will save the current user's username when saving data. This is really all that is needed to send to Radiks-server, which does all of the actual validation.

cc @moxiegirl, @pradel , @friedger who have expressed interest here.

See stacks-archive/radiks-server#19 for the server code.

I have published a beta version for testing - 0.3.0-beta.1

TODO:

  • Include validateUsername on the BlockstackUser Radiks model by default

@friedger
Copy link
Collaborator

Using publish-data should be good practice anyway if the app is sharing data with other users.

What about usernames that are transferred?
The model will be associated with the username. Users should be aware of this if they transfer their username.

@pradel
Copy link
Contributor

pradel commented Jul 24, 2019

Would the same apply if you change your storage? The Gaia url will also change no?

@hstove
Copy link
Collaborator Author

hstove commented Jul 24, 2019

If you change your Gaia URL, then the profile.json would also get updated, so future writes would still work. If we have some migration tool in the browser at some point, we should maybe have a way to save your previous Gaia URLs.

Another option is to only check the address portion of the Gaia URL, not the domain. That would work pretty well if you changed hubs.

Sent with GitHawk

@hstove
Copy link
Collaborator Author

hstove commented Jul 24, 2019

@friedger if usernames are transferred, then new writes will no longer work. It might make sense to have some cron job that re-validates old data to see if the username still matches, but I think that’s outside of the scope of this PR.

Sent with GitHawk

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants