summaryrefslogtreecommitdiffstats
path: root/rust/src/identifiers.rs
diff options
context:
space:
mode:
authorBryan Newbold <bnewbold@robocracy.org>2019-06-07 15:03:21 -0700
committerBryan Newbold <bnewbold@robocracy.org>2019-06-07 15:03:21 -0700
commitdb33b774c8c12a79e3ce36f4b67173d6ff4fcde0 (patch)
treeaf8c2c3101b19a9707db5ce2bd78a61471426013 /rust/src/identifiers.rs
parent123cc92cadb57e3a9e536e08a66ea54adab660ad (diff)
downloadfatcat-db33b774c8c12a79e3ce36f4b67173d6ff4fcde0.tar.gz
fatcat-db33b774c8c12a79e3ce36f4b67173d6ff4fcde0.zip
Revert "allow somewhat longer usernames"
This reverts commit 123cc92cadb57e3a9e536e08a66ea54adab660ad.
Diffstat (limited to 'rust/src/identifiers.rs')
-rw-r--r--rust/src/identifiers.rs4
1 files changed, 1 insertions, 3 deletions
diff --git a/rust/src/identifiers.rs b/rust/src/identifiers.rs
index e3e34200..597af338 100644
--- a/rust/src/identifiers.rs
+++ b/rust/src/identifiers.rs
@@ -70,7 +70,7 @@ pub fn uuid2fcid(id: &Uuid) -> String {
pub fn check_username(raw: &str) -> Result<()> {
lazy_static! {
- static ref RE: Regex = Regex::new(r"^[A-Za-z][A-Za-z0-9._-]{2,32}$").unwrap();
+ static ref RE: Regex = Regex::new(r"^[A-Za-z][A-Za-z0-9._-]{2,24}$").unwrap();
}
if raw.is_ascii() && RE.is_match(raw) {
Ok(())
@@ -92,8 +92,6 @@ fn test_check_username() {
assert!(check_username("g_____").is_ok());
assert!(check_username("bnewbold2-archive").is_ok());
assert!(check_username("bnewbold2-internetarchive").is_ok());
- assert!(check_username("bnewboldtestperiods-archive").is_ok());
- assert!(check_username("DisabledCommunity.Org-archive").is_ok());
assert!(check_username("").is_err());
assert!(check_username("_").is_err());