peeringdb / peeringdb

Server code for https://www.peeringdb.com/
BSD 2-Clause "Simplified" License
340 stars 111 forks source link

Validator: Add validator for X usernames, were requirements #1580

Closed netravnen closed 1 week ago

netravnen commented 1 month ago

are different for the generalized regex match.

A username can only contain alphanumeric characters (letters A-Z, numbers 0-9) with the exception of underscores, as noted above. Check to make sure your desired username does not contain any symbols, dashes, or spaces.

https://help.twitter.com/en/managing-your-account/x-username-rules

Add a specific if-else regex match for X usernames to take into account that PeeringDB users are able to have X usernames of less than 4 characters that are the current minimum our generalized username regexer checks in the string length match. I.e. We currently accept 4-32. X allows 1-15 in length.

grizz commented 3 weeks ago

@netravnen looks good, thanks!

We just need to add a couple tests for that, if you want to do that, otherwise we will before the next release on 05-28.

netravnen commented 2 weeks ago

We just need to add a couple tests for that, if you want to do that, otherwise we will before the next release on 05-28.

I have ATM no experience writing tests using Python frameworks. And do not expect to pick this up before the 28-May date. :(

grizz commented 1 week ago

@netravnen no worries at all, we'll do it quick :) Thanks for the patch!

grizz commented 1 week ago

Tests done in support branch, will be merged in for next release.