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

Token id validation #39

Closed
the-frey opened this issue Dec 20, 2021 · 4 comments · Fixed by #40
Closed

Token id validation #39

the-frey opened this issue Dec 20, 2021 · 4 comments · Fixed by #40
Milestone

Comments

@the-frey
Copy link
Contributor

We probably need some basic rules in place in terms of what is acceptable to avoid borkage.

@the-frey the-frey added this to the MVP milestone Dec 20, 2021
@the-frey
Copy link
Contributor Author

the-frey commented Dec 21, 2021

Alphanumeric-only?

A domain name can be up to 63 characters (letters, numbers or combination) long plus the 4 characters used to identify the domain extension (.com, .net, .org). The only symbol character domain names can include is a hyphen (-) although the domain name cannot start or end with a hyphen nor have consecutive hyphens. Common symbols such as asterisks (*), under scores (_), and exclamation points (!) are not allowed.

Feels like we should basically allow the regex [A-z0-9\_\-]

That would allow:

  • th3fr3y
  • the-frey
  • _thefrey
  • the_frey
  • the--frey (this is the only one I'm unsure about. Single hyphen/underscore only?)

@the-frey
Copy link
Contributor Author

@danwlsn any thoughts on this?

@danwlsn
Copy link

danwlsn commented Dec 21, 2021

Happy with the keeping it simple; alphanumerical, hyphens and underscores.

A couple of notes I would add though. You have A-z but I believe it should be lower case?
I wouldn't want to have to battle off danWlsn when I'm the real danwlsn.

I'm in favour of only allowing single hyphen and underscore. Double underscore is too similar.
the_frey
the__frey

@the-frey
Copy link
Contributor Author

the-frey commented Dec 21, 2021

A couple of notes I would add though. You have A-z but I believe it should be lower case?

Yes, very good point, I think at the moment we don't even auto-downcase before save. Eek.

I'm in favour of only allowing single hyphen and underscore. Double underscore is too similar.

Yep, also agreed, in some fonts it's definitely confusing enough to be a pathway to impersonating others, especially if a browser font supports ligatures.

Thanks for the sense-check.

the-frey added a commit that referenced this issue Dec 22, 2021
* Validate username based on a set of constraints in #39

* Break out some more helpers
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants