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

Project name validation #635

Merged
merged 6 commits into from
Jul 19, 2019
Merged

Project name validation #635

merged 6 commits into from
Jul 19, 2019

Conversation

macor161
Copy link
Contributor

@macor161 macor161 commented Jul 18, 2019

🦅 Pull Request

Closes #147. Displays an error during initialization when project name contains invalid chars.

🚨 Test instructions

aragon init my_app_name
or
create-aragon-app my_app_name

✔️ PR Todo

  • Include links to related issues/PRs
  • Update unit tests for this change
  • (N/A) Update the relevant documentation
  • Clear dependencies on other modules that have to be released before merging this

@macor161
Copy link
Contributor Author

hm.. seems like some CI checks are failing. I'm looking into this.

* @returns {boolean} `true` if valid
*/
function isValidEnsName(name) {
return /^[a-z0-9]+$/.test(name)
Copy link
Contributor

@0xGabi 0xGabi Jul 18, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@macor161 ENS allow the use of the - symbol as well (e.g. aragon-app is a valid name).

Copy link
Contributor Author

@macor161 macor161 Jul 18, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes I was wondering whether to add the hyphen or not, since it is not accepted in the main onboarding app (app.aragon.org). Is there an official documentation where I can find the accepted chars for Aragon subdomains? Maybe I should also rename the function to isValidAragonSubdomainName()

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are right about that. Nevertheless in that cause those are to link a dao to an aragonId. We are creating a subdomain in the open.aragonpm.eth registrar for Aragon apps. You think we should also stick to not use the hyphen?

Sorry I went ahead and made the changes 😅

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The choice to not use the hyphen is a purely arbitrary decision made by us, and not an ENS limitation. You can use any IRI (including emojis, etc.).

The frontend actually accepts this regex for self-assigned ENS names. Note that again, it is still a subset of possible ENS names, but it was chosen to avoid potential spoofing attacks on the frontend with unicode characters.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sohkai Thanks for clarifications!
@0xGabi Thanks for those light-speed fixes :)
So after discussing the subject, we decided to keep the hyphen since it was already possible to create apps that contain them with the current CLI.

@0xGabi 0xGabi merged commit b2ad914 into aragon:master Jul 19, 2019
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 this pull request may close these issues.

Illegal char error when using illegal ENS chars in app name during aragon init
3 participants