-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Allow spaces in username for LDAP users #2880
Conversation
PR go-gitea#342 was only partially applied. Spaces should not be at the start and end of a username but they can be inside.
LGTM |
Codecov Report
@@ Coverage Diff @@
## master #2880 +/- ##
=======================================
Coverage 27.05% 27.05%
=======================================
Files 89 89
Lines 17650 17650
=======================================
Hits 4775 4775
Misses 12189 12189
Partials 686 686 Continue to review full report at Codecov.
|
Why we allow a username with a space in the middle of the word? |
Because it is allowed by the specification and Microsoft uses it: |
Shouldn't we add a check for leading/trailing spaces, since those are disallowed? |
@ethantkoenig is right. Best solution should be just to trim spaces for entered username |
Space at the begining and end are already being trimed (models/login_source.go) and triming them inside the username would be wrong. Suppose I wanted to bind to CN=Jeff Smith,OU=Sales,DC=Fabrikam,DC=COM (which is a valid Windows CN), I would like be able to configure cn=%s,OU=Sales,DC=Fabrikam,DC=COM as bind dn. |
No I meant only at the begining and end. If they are already trimmed than all is good |
LGTM |
PR #342 was only partially applied. Spaces should not be at the start
and end of a username but they can be inside.