matrix-org / matrix-authentication-service

OAuth2.0 + OpenID Provider for Matrix Homeservers
https://matrix-org.github.io/matrix-authentication-service/
Apache License 2.0
112 stars 32 forks source link

Why does upstream OAuth registration limit username to 14 characters? #2454

Open eforest opened 8 months ago

eforest commented 8 months ago

Why does upstream OAuth registration limit username to 14 characters? Is there any reason regarding integration with matrix-home-server?

see https://github.com/matrix-org/matrix-authentication-service/blob/main/policies/register.rego [21-23]

Best Regards

sandhose commented 8 months ago

I think this is a leftover from when I implemented the policy engine. There are no good reason for this arbitrary limit

sandhose commented 8 months ago

2471 bumped the limit to 64 characters. It's still a somewhat arbitrary limit, but probably better than before. I need to investigate what would be the impact of a very very long MXID

thegcat commented 7 months ago

Quick heads-up here as we ran into the other side of the problem (a user with a 2-character username getting bumped by MAS, issue incoming): the spec only limits the total length of the MXID to 255 characters, so the upper bound for a username would be 255 - length of the server name - 2.

matrixbot commented 2 months ago

For your information, this issue has been copied over to the Element fork of matrix-authentication-service: https://github.com/element-hq/matrix-authentication-service/issues/2454