radiks icon indicating copy to clipboard operation
radiks copied to clipboard

Adds model config to validate usernames

Open hstove opened this issue 6 years ago • 4 comments

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 https://github.com/blockstack-radiks/radiks-server/pull/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

hstove avatar Jul 24 '19 04:07 hstove

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.

friedger avatar Jul 24 '19 08:07 friedger

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

pradel avatar Jul 24 '19 10:07 pradel

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 avatar Jul 24 '19 13:07 hstove

@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

hstove avatar Jul 24 '19 13:07 hstove