Skip to content

Conversation

jochenrill
Copy link
Contributor

PR #342 was only partially applied. Spaces should not be at the start
and end of a username but they can be inside.

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.
@lafriks
Copy link
Member

lafriks commented Nov 10, 2017

LGTM

@tboerger tboerger added the lgtm/need 1 This PR needs approval from one additional maintainer to be merged. label Nov 10, 2017
@lafriks lafriks added this to the 1.3.0 milestone Nov 10, 2017
@lafriks lafriks changed the title Correct ldap username validation. Allow spaces in username for LDAP users Nov 10, 2017
@codecov-io
Copy link

codecov-io commented Nov 10, 2017

Codecov Report

Merging #2880 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           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.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 134958f...83673ea. Read the comment docs.

@lunny
Copy link
Member

lunny commented Nov 10, 2017

Why we allow a username with a space in the middle of the word?

@jochenrill
Copy link
Contributor Author

Because it is allowed by the specification and Microsoft uses it:
https://msdn.microsoft.com/en-us/library/aa366101(v=vs.85).aspx

@ethantkoenig
Copy link
Member

Shouldn't we add a check for leading/trailing spaces, since those are disallowed?

@lafriks
Copy link
Member

lafriks commented Nov 12, 2017

@ethantkoenig is right. Best solution should be just to trim spaces for entered username

@jochenrill
Copy link
Contributor Author

jochenrill commented Nov 12, 2017

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.

@lafriks
Copy link
Member

lafriks commented Nov 12, 2017

No I meant only at the begining and end. If they are already trimmed than all is good

@lunny
Copy link
Member

lunny commented Nov 13, 2017

LGTM

@tboerger tboerger added lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. and removed lgtm/need 1 This PR needs approval from one additional maintainer to be merged. labels Nov 13, 2017
@lafriks lafriks merged commit f94e6fd into go-gitea:master Nov 13, 2017
@go-gitea go-gitea locked and limited conversation to collaborators Nov 23, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. type/bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants