{"action":"created","issue":{"url":"https://api.github.com/repos/Cardshifter/Cardshifter/issues/354","labels_url":"https://api.github.com/repos/Cardshifter/Cardshifter/issues/354/labels{/name}","comments_url":"https://api.github.com/repos/Cardshifter/Cardshifter/issues/354/comments","events_url":"https://api.github.com/repos/Cardshifter/Cardshifter/issues/354/events","html_url":"https://github.com/Cardshifter/Cardshifter/issues/354","id":100438687,"number":354,"title":"User name validation","user":{"login":"jacwah","id":3816754,"avatar_url":"https://avatars.githubusercontent.com/u/3816754?v=3","gravatar_id":"","url":"https://api.github.com/users/jacwah","html_url":"https://github.com/jacwah","followers_url":"https://api.github.com/users/jacwah/followers","following_url":"https://api.github.com/users/jacwah/following{/other_user}","gists_url":"https://api.github.com/users/jacwah/gists{/gist_id}","starred_url":"https://api.github.com/users/jacwah/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jacwah/subscriptions","organizations_url":"https://api.github.com/users/jacwah/orgs","repos_url":"https://api.github.com/users/jacwah/repos","events_url":"https://api.github.com/users/jacwah/events{/privacy}","received_events_url":"https://api.github.com/users/jacwah/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-08-12T00:08:31Z","updated_at":"2015-08-12T00:15:51Z","closed_at":null,"body":"_What user names are valid?_\r\n\r\nThis question recently sprung up with #345. It started with duplicated names, then @Phrancis mentioned empty ones. The code that closes that question adds the method  `Server.isValidUserName` which makes user name validation easy to implement.\r\n\r\nIn the issue above, I ended up posting a suggested set of rules for user names.\r\n\r\n>A user name...\r\n>- is unique. Two clients can not connect with the same name simultaneously.\r\n>- is at least 1 character and at most 20 characters long.\r\n>- contains only ASCII letters, spaces, underscores and decimal numbers.\r\n>- does not begin or end with whitespace.\r\n\r\n- A too long user name doesn't make sense and is annoying for UI development and to type.\r\n- Carefully crafted bytes can e.g. mess up a terminal window where logging is done and cause all sorts of trouble. It may also not be typeable.\r\n- Is that `x` spaces or a tab?\r\n- Names starting or ending with whitespace are confusing."},"comment":{"url":"https://api.github.com/repos/Cardshifter/Cardshifter/issues/comments/130117717","html_url":"https://github.com/Cardshifter/Cardshifter/issues/354#issuecomment-130117717","issue_url":"https://api.github.com/repos/Cardshifter/Cardshifter/issues/354","id":130117717,"user":{"login":"Phrancis","id":8539648,"avatar_url":"https://avatars.githubusercontent.com/u/8539648?v=3","gravatar_id":"","url":"https://api.github.com/users/Phrancis","html_url":"https://github.com/Phrancis","followers_url":"https://api.github.com/users/Phrancis/followers","following_url":"https://api.github.com/users/Phrancis/following{/other_user}","gists_url":"https://api.github.com/users/Phrancis/gists{/gist_id}","starred_url":"https://api.github.com/users/Phrancis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Phrancis/subscriptions","organizations_url":"https://api.github.com/users/Phrancis/orgs","repos_url":"https://api.github.com/users/Phrancis/repos","events_url":"https://api.github.com/users/Phrancis/events{/privacy}","received_events_url":"https://api.github.com/users/Phrancis/received_events","type":"User","site_admin":false},"created_at":"2015-08-12T00:15:51Z","updated_at":"2015-08-12T00:15:51Z","body":"_\"contains only ASCII letters, spaces, underscores and decimal numbers\"_ I'm assuming would also exclude problematic characters like slashes, quote marks and the like, correct?\r\n\r\nAt some point in the future we _may_ want to consider a more expansive allowed character set (perhaps with explicit exclusions instead of explicit inclusions) but for the foreseeable future I think what you suggested above should be completely reasonable. "}}